From c1da2426711a4a5e73a46f2cca923df2dc43579a Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Thu, 5 Dec 2024 08:19:45 +0100 Subject: close #54 --- project-base/src/windows/platform.c | 2 +- src/scenes/world_map.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/project-base/src/windows/platform.c b/project-base/src/windows/platform.c index 6e2c9b9..247fdcc 100644 --- a/project-base/src/windows/platform.c +++ b/project-base/src/windows/platform.c @@ -255,6 +255,7 @@ static void create_key_tables() keycode_map[0x88] = KEY_LEFT_ALT; keycode_map[VK_CONTROL] = KEY_LEFT_CONTROL; keycode_map[VK_LCONTROL] = KEY_LEFT_CONTROL; + keycode_map[VK_SHIFT] = KEY_LEFT_SHIFT; keycode_map[VK_LSHIFT] = KEY_LEFT_SHIFT; keycode_map[VK_LWIN] = KEY_LEFT_SUPER; keycode_map[VK_SNAPSHOT] = KEY_PRINT_SCREEN; @@ -444,7 +445,6 @@ LRESULT CALLBACK main_window_callback(HWND window, UINT message, WPARAM wparam, else if (message == WM_KEYDOWN) { s32 key = wparam; - current_keyboard_to_handle->keys[keycode_map[key]] = true; current_keyboard_to_handle->input_keys[keycode_map[key]] = true; diff --git a/src/scenes/world_map.c b/src/scenes/world_map.c index b161cc3..410e8f8 100644 --- a/src/scenes/world_map.c +++ b/src/scenes/world_map.c @@ -748,11 +748,19 @@ static s32 world_map_push_invest_panel_item(s32 x, s32 y, s32 w, s32 index, char button_render(scale, BUTTON_STATIC, 0, item_x, item_y,item_w,item_h); renderer->render_text(fnt, content_x, content_y, text, COLOR_TEXT); if (push_info_panel_button(scale, img_arrow_left, button_left_x, btn_y, btn_size, *fval > 0, false)) { + if (keyboard_is_key_down(KEY_LEFT_SHIFT)) + *fval -= INVESTMENT_INCREMENT*10; + else *fval -= INVESTMENT_INCREMENT; } if (push_info_panel_button(scale, img_arrow_right, button_left_x+total_val_editor_w-btn_size, btn_y, btn_size, true, false)) { + if (keyboard_is_key_down(KEY_LEFT_SHIFT)) + *fval += INVESTMENT_INCREMENT*10; + else *fval += INVESTMENT_INCREMENT; } + if (*fval < 0) *fval = 0; + s32 item_text_w = renderer->calculate_text_width(fnt, value_str); s32 item_text_x = button_left_x + (total_val_editor_w/2) - (item_text_w/2); renderer->render_text(fnt, item_text_x, content_y, value_str, COLOR_TEXT); -- cgit v1.2.3-70-g09d2