+str_am_attack:
+.str "attack"
+.db 0
+
+str_am_eat:
+.str "eat"
+.db 0
+
+str_am_rest:
+.str "rest"
+.db 0
+
+ ; label
+action_menu_str_table:
+ dw str_am_attack
+ dw str_am_eat
+ dw str_am_rest
+action_menu_str_table_end:
+
+ ; map to actions
+action_menu_action_table:
+ dw st_action_attack_init
+ dw st_action_attack_init
+ dw st_action_attack_init
+action_menu_action_table_end:
+
+#define ACTION_MENU_STR_TABLE_LEN (action_menu_str_table_end - action_menu_str_table) / 2
+
; game state for action menu selector
; the action menu allows the player to select
; any action the character can perform
; returns:
; bc: next state
update_action_menu:
+ ; exit menu on b button press
+ ld b, BTNB
+ input_just
+ jr z, @notb REL
+ ld bc, st_update_game
+ ret
+@notb:
+
+
ldnull bc
ret
ld a, st_update_action_menu HI
ld [hl], a
+ ; draw the initial status line
+ ld a, [action_menu_cursor]
+ call select_menu_draw_status
+
ret
+
; b: button pressed
select_menu_update:
ret
+
+ ; draws a status text for the current selection
+ ; inputs:
+ ; hl: string ptr table
+ ; a: selection
+select_menu_draw_status:
+ add a, a ; * 2 for table offset
+ ld d, 0
+ ld e, a
+ add hl, de ; hl = string ptr
+
+ ret