core: Fix AVM2 buttons getting constructed with the wrong initial state.
This code was always wrong; and only saved from breaking by other wrong code elsewhere. Specifically: * `SimpleButton.construct_frame` sets the wrong initial state * but `MovieClip.instantiate_child` fires frame events before `post_instantiation` * and `SimpleButton.post_instantiation` sets the correct state
This commit is contained in:
parent
eb0eede07d
commit
cbf2e94aba
|
@ -425,8 +425,6 @@ impl<'gc> TDisplayObject<'gc> for Avm2Button<'gc> {
|
|||
if run_frame {
|
||||
self.run_frame_avm2(context);
|
||||
}
|
||||
|
||||
self.set_state(context, ButtonState::Up);
|
||||
}
|
||||
|
||||
fn enter_frame(&self, context: &mut UpdateContext<'_, 'gc, '_>) {
|
||||
|
@ -547,7 +545,7 @@ impl<'gc> TDisplayObject<'gc> for Avm2Button<'gc> {
|
|||
|
||||
self.frame_constructed(context);
|
||||
|
||||
self.set_state(context, ButtonState::Over);
|
||||
self.set_state(context, ButtonState::Up);
|
||||
|
||||
//NOTE: Yes, we do have to run these in a different order from the
|
||||
//regular run_frame method.
|
||||
|
|
Loading…
Reference in New Issue