diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-11-30 23:17:13 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-11-30 23:17:13 +0100 |
| commit | 7c7b01a50676de67d805646ae2997f77d93cfb1e (patch) | |
| tree | 4bc8f221e291ff08d8af2fcca0cf23e57405607f /src/scenes/world_map.c | |
| parent | 81cc1fe615023e2d03b4373a3ac536f7dbcb0ea9 (diff) | |
close #25
Diffstat (limited to 'src/scenes/world_map.c')
| -rw-r--r-- | src/scenes/world_map.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/scenes/world_map.c b/src/scenes/world_map.c index 4dfef05..2cf7446 100644 --- a/src/scenes/world_map.c +++ b/src/scenes/world_map.c @@ -848,7 +848,8 @@ static void world_map_draw_purchase_location_panel(platform_window* window) s32 button_w = 178 * scale;
s32 button_h = 37 * scale;
- if (button_render(scale, true, "Purchase", screen_center_x - (button_w/2), panel_y + panel_h - button_h - vertical_pad, button_w, button_h))
+ s32 state = (_active_world->money < world_location_get_price(scene_data.location_to_purchase)) ? BUTTON_DISABLED : BUTTON_ENABLED;
+ if (button_render(scale, state, "Purchase", screen_center_x - (button_w/2), panel_y + panel_h - button_h - vertical_pad, button_w, button_h))
{
// Mark as owned.
scene_data.location_to_purchase->is_owned = true;
|
