+#define UI_TILE_WAREHOUSE 128
+#define UI_TILE_ROAD 129
+#define UI_TILE_FARM 130
+#define UI_TILE_LUMBER 131
+
+#define UI_CURSOR_BUILDING_BASE_X 2
+#define UI_CURSOR_BUILDING_BASE_Y 120
+
; inits UI
ui_init:
call ui_draw
; during blanking
ui_draw:
ld hl, SCRN1
- ld a, 128
- ld [hl], a
+ inc hl
+
+ ld a, UI_TILE_WAREHOUSE
+ ld [hl+], a
+
+ ld a, UI_TILE_ROAD
+ ld [hl+], a
+
+ ld a, UI_TILE_FARM
+ ld [hl+], a
+
+ ld a, UI_TILE_LUMBER
+ ld [hl+], a
ret
; ui building selector state
ui_building_selector_update:
+ call ui_building_selector_inputs
+ push bc
+ call ui_building_selector_draw
+ pop bc
+ ret
+
+ui_building_selector_draw:
+ ld hl, PLAYER_SPRITE1
+
+ ld a, UI_CURSOR_BUILDING_BASE_Y
+ add a, OBJ_OFF_Y
+ ld [hl+], a
+
+ ld a, UI_CURSOR_BUILDING_BASE_X
+ add a, OBJ_OFF_X
+ ld [hl+], a
+
+ ld a, CURSOR_TILE
+ ld [hl+], a
+
+ ret
+
+ui_building_selector_inputs:
+ input_just BTNSELECT
+ jr z, @not_select REL
+ ; select back to regular state
+
+ ld bc, st_cursor
+ ret
+@not_select:
ldnull bc
ret