core: Remove NotAvm2 AVM2 mouse pick enum option since it is equivalent to Miss

This commit is contained in:
Lord-McSweeney 2023-07-31 21:49:19 -07:00 committed by Lord-McSweeney
parent cdbb08b4ee
commit 7eb3c3be0c
5 changed files with 5 additions and 9 deletions

View File

@ -600,7 +600,7 @@ impl<'gc> TInteractiveObject<'gc> for Avm1Button<'gc> {
_point: Point<Twips>, _point: Point<Twips>,
_require_button_mode: bool, _require_button_mode: bool,
) -> Avm2MousePick<'gc> { ) -> Avm2MousePick<'gc> {
Avm2MousePick::NotAvm2 Avm2MousePick::Miss
} }
fn mouse_cursor(self, context: &mut UpdateContext<'_, 'gc>) -> MouseCursor { fn mouse_cursor(self, context: &mut UpdateContext<'_, 'gc>) -> MouseCursor {

View File

@ -2163,7 +2163,7 @@ impl<'gc> TInteractiveObject<'gc> for EditText<'gc> {
) -> Avm2MousePick<'gc> { ) -> Avm2MousePick<'gc> {
// Don't do anything if run in an AVM1 context. // Don't do anything if run in an AVM1 context.
if !self.as_displayobject().movie().is_action_script_3() { if !self.as_displayobject().movie().is_action_script_3() {
return Avm2MousePick::NotAvm2; return Avm2MousePick::Miss;
} }
// The text is hovered if the mouse is over any child nodes. // The text is hovered if the mouse is over any child nodes.

View File

@ -498,7 +498,6 @@ pub enum Avm2MousePick<'gc> {
Hit(InteractiveObject<'gc>), Hit(InteractiveObject<'gc>),
PropagateToParent, PropagateToParent,
Miss, Miss,
NotAvm2,
} }
impl<'gc> Debug for Avm2MousePick<'gc> { impl<'gc> Debug for Avm2MousePick<'gc> {
@ -507,7 +506,6 @@ impl<'gc> Debug for Avm2MousePick<'gc> {
Avm2MousePick::Hit(target) => write!(f, "Hit({:?})", target.as_displayobject().name()), Avm2MousePick::Hit(target) => write!(f, "Hit({:?})", target.as_displayobject().name()),
Avm2MousePick::PropagateToParent => write!(f, "PropagateToParent"), Avm2MousePick::PropagateToParent => write!(f, "PropagateToParent"),
Avm2MousePick::Miss => write!(f, "Miss"), Avm2MousePick::Miss => write!(f, "Miss"),
Avm2MousePick::NotAvm2 => write!(f, "NotAvm2"),
} }
} }
} }
@ -555,8 +553,6 @@ impl<'gc> Avm2MousePick<'gc> {
} }
// A miss in a child always stays a miss, regardless of parent settings. // A miss in a child always stays a miss, regardless of parent settings.
Avm2MousePick::Miss => Avm2MousePick::Miss, Avm2MousePick::Miss => Avm2MousePick::Miss,
Avm2MousePick::NotAvm2 => Avm2MousePick::NotAvm2,
}; };
res res
} }

View File

@ -217,7 +217,7 @@ impl<'gc> TInteractiveObject<'gc> for LoaderDisplay<'gc> {
) -> Avm2MousePick<'gc> { ) -> Avm2MousePick<'gc> {
// Don't do anything if run in an AVM1 context. // Don't do anything if run in an AVM1 context.
if !self.as_displayobject().movie().is_action_script_3() { if !self.as_displayobject().movie().is_action_script_3() {
return Avm2MousePick::NotAvm2; return Avm2MousePick::Miss;
} }
// We have at most one child // We have at most one child

View File

@ -3216,7 +3216,7 @@ impl<'gc> TInteractiveObject<'gc> for MovieClip<'gc> {
) -> Avm2MousePick<'gc> { ) -> Avm2MousePick<'gc> {
// Don't do anything if run in an AVM1 context. // Don't do anything if run in an AVM1 context.
if !self.movie().is_action_script_3() { if !self.movie().is_action_script_3() {
return Avm2MousePick::NotAvm2; return Avm2MousePick::Miss;
} }
if self.visible() { if self.visible() {
@ -3327,7 +3327,7 @@ impl<'gc> TInteractiveObject<'gc> for MovieClip<'gc> {
Avm2MousePick::PropagateToParent => { Avm2MousePick::PropagateToParent => {
found_propagate = Some(res); found_propagate = Some(res);
} }
Avm2MousePick::Miss | Avm2MousePick::NotAvm2 => {} Avm2MousePick::Miss => {}
} }
} }