ui: leaving build menu now clears oam
authorLukas Krickl <lukas@krickl.dev>
Sun, 30 Mar 2025 04:16:40 +0000 (06:16 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sun, 30 Mar 2025 04:16:40 +0000 (06:16 +0200)
src/state.s
src/ui.s

index a1446b3e8de3733b090cfeaba645226c6c5f157f..d7911e1c3c8fb9e375e4bc6fe6cf414d82e90d1f 100644 (file)
@@ -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
+
index ed46d9da140c6e4849df480f4fee3e645bff0802..03b5bb6f7f3763dc07df581525e774ca368f3641 100644 (file)
--- 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