avm1: Change cursor to arrow when the `enabled` property is set to false

This commit is contained in:
Toad06 2022-02-05 15:36:13 +01:00 committed by Mike Welsh
parent 81c8f040fa
commit fff9cd1d63
4 changed files with 4 additions and 2 deletions

View File

@ -545,7 +545,7 @@ impl<'gc> TInteractiveObject<'gc> for Avm1Button<'gc> {
}
fn mouse_cursor(self, _context: &mut UpdateContext<'_, 'gc, '_>) -> MouseCursor {
if self.use_hand_cursor() {
if self.use_hand_cursor() && self.enabled() {
MouseCursor::Hand
} else {
MouseCursor::Arrow

View File

@ -805,6 +805,7 @@ impl<'gc> TInteractiveObject<'gc> for Avm2Button<'gc> {
}
fn mouse_cursor(self, _context: &mut UpdateContext<'_, 'gc, '_>) -> MouseCursor {
// TODO: Should we also need to check for the `enabled` property like AVM1 buttons?
if self.use_hand_cursor() {
MouseCursor::Hand
} else {

View File

@ -2211,7 +2211,7 @@ impl<'gc> TInteractiveObject<'gc> for MovieClip<'gc> {
}
fn mouse_cursor(self, context: &mut UpdateContext<'_, 'gc, '_>) -> MouseCursor {
if self.use_hand_cursor() && self.is_button_mode(context) {
if self.use_hand_cursor() && self.enabled() && self.is_button_mode(context) {
MouseCursor::Hand
} else {
MouseCursor::Arrow

View File

@ -1235,6 +1235,7 @@ impl Player {
if released_inside {
// Released inside the clicked object.
if let Some(down_object) = context.mouse_down_object {
new_cursor = down_object.mouse_cursor(context);
events.push((down_object, ClipEvent::Release));
} else {
events.push((context.stage.into(), ClipEvent::Release));