From: Lukas Krickl Date: Sun, 30 Mar 2025 04:16:40 +0000 (+0200) Subject: ui: leaving build menu now clears oam X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=60d3186104ab8a211d2f7a37c4c69b8b78188ab2;p=gbrg%2F.git ui: leaving build menu now clears oam --- diff --git a/src/state.s b/src/state.s index a1446b3..d7911e1 100644 --- a/src/state.s +++ b/src/state.s @@ -90,12 +90,13 @@ st_cursor_delay: st_ui_building_selector: st_def 0, ui_building_selector_update, st_ui_building_selector +st_ui_buildung_selector_exit: + st_def 0, ui_building_selector_exit, st_cursor st_update_game: st_def 0x00, update_game, st_update_game - st_update_pause: st_def 0x00, update_pause, st_update_pause - st_update_game_over: st_def 0x00, update_game_over, st_update_game_over + diff --git a/src/ui.s b/src/ui.s index ed46d9d..03b5bb6 100644 --- a/src/ui.s +++ b/src/ui.s @@ -66,12 +66,20 @@ ui_building_selector_draw: ret + ; exit state for build menu + ; clears shadow oam +ui_building_selector_exit: + call shadow_oam_clear + + ldnull bc + ret + ui_building_selector_inputs: input_just BTNSELECT jr z, @not_select REL ; select back to regular state - ld bc, st_cursor + ld bc, st_ui_buildung_selector_exit ret @not_select: ldnull bc