WIP: core: Support a PlaceObject by AS3 class name instead of character ID #21242
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes issues with "Invalid PlaceObject type" in name, but only tested on #14745 .
TODO:
context.avm2.stage_domain()
, it should (I assume, need to check to be sure) use the domain from library of the swf this tag belongs to,let as3_stage_object = class.construct(activation, &[]);
. and then get the DO from the AS3 object. (this can also be left unimplemented with just a stub log for the future :P )class MySprite extends Sprite {}
and the PlaceObject "just works"; if that's confirmed to be the case, the implementation will definitely need to be swapped out forclass.construct()
.instantiate_child
where we should respect the PlaceObject class name, then move the code outside ofinstantiate_child
to some common function? (For example, currently this doesn't supportPlaceObjectAction::Replace
infn place_object
)PlaceObjectAction::Place
, but there's no id", my current solution is a hack (the magic number 65530). In fact, IMO it's kinda weird thatinstantiate_child
takes a PlaceObject and the id (which comes from this PlaceObject) as a separate argument - maybe this could be refactored as a whole?If someone wants to pick this up, just let me know, I'm not sure when I'd be able to continue this myself.