Roads now will need to check adjacent tiles to draw the correct tile.
+#define BUILDING_ROAD_NORTH_SOUTH 0x77
+#define BUILDING_ROAD_WEAT_EAST 0x78
+
+
; places a building at the current cursor position
; performs pre-checks and displays an error
; if pre-conditions for building fail
call cursor_get_cell
call cursor_get_tile
- ld a, UI_TILE_ROAD
+ ld a, BUILDING_ROAD_NORTH_SOUTH
call bg_update_queue_push
ldnull bc
ret
handle_inputs:
+ input_held BTNA
+ jr z, @not_a REL
+
+ ; next state: building state
+ call building_build
+@not_a:
+
+ ; movement keys with cooldown
+
input_held BTNDOWN
jr z, @notdown REL
ld bc, st_ui_building_selector
ret
@not_select:
-
- input_just BTNA
- jr z, @not_a REL
-
- ; next state: building state
- call building_build
- ldnull bc
- ret
-@not_a:
@done:
ldnull bc
ret
st_ui_building_selector_delay:
st_def CURSOR_MOVE_TIMER, st_null_fn, st_ui_building_selector
st_ui_buildung_selector_exit:
- st_def 0, ui_building_selector_exit, st_cursor
+ st_def 8, ui_building_selector_exit, st_cursor
st_update_game:
st_def 0x00, update_game, st_update_game