From 3a5675ec6ddce4b2085484e620548fe022a32745 Mon Sep 17 00:00:00 2001 From: ry755 Date: Mon, 31 Jan 2022 19:54:32 -0800 Subject: [PATCH] fox32rom: Don't repush the submenu update event if the submenu closed --- submenu.asm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/submenu.asm b/submenu.asm index 624fd5a..569c778 100644 --- a/submenu.asm +++ b/submenu.asm @@ -193,6 +193,12 @@ submenu_update_event: mov r9, r2 ; r9: selected root menu item mov r10, r3 ; r10: hovering submenu item (or 0xFFFFFFFF for none) + ; check if the submenu overlay is enabled + ; if the submenu was closed then exit without repushing the update event to the event stack + in r0, 0x8000031D + cmp r0, 0 + ifz jmp submenu_update_event_end_no_push + ; get the current mouse position and check if the submenu overlay covers that position ; if the mouse is not in the submenu, then there is nothing to do call get_mouse_position