From 04008d76b9f0298b9cd5d495b042055a2cca910d Mon Sep 17 00:00:00 2001 From: spykyvenator Date: Fri, 1 Mar 2024 12:00:26 +0100 Subject: [PATCH 1/3] add: multiple menu keybinds --- src/wipeout/game.c | 10 ++++++++++ src/wipeout/game.h | 8 ++++++++ src/wipeout/menu.c | 8 ++++---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/wipeout/game.c b/src/wipeout/game.c index 919ed21..50c519b 100755 --- a/src/wipeout/game.c +++ b/src/wipeout/game.c @@ -544,6 +544,16 @@ void game_init(void) { input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_LEFT, A_MENU_LEFT); input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_RIGHT, A_MENU_RIGHT); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_W, A_MENU_UP_2); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_S, A_MENU_DOWN_2); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_A, A_MENU_LEFT_2); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_D, A_MENU_RIGHT_2); + + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_K, A_MENU_UP_3); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_J, A_MENU_DOWN_3); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_H, A_MENU_LEFT_3); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_L, A_MENU_RIGHT_3); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_BACKSPACE, A_MENU_BACK); input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_C, A_MENU_BACK); input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_V, A_MENU_BACK); diff --git a/src/wipeout/game.h b/src/wipeout/game.h index ac62a90..51fc840 100755 --- a/src/wipeout/game.h +++ b/src/wipeout/game.h @@ -35,6 +35,14 @@ typedef enum { A_MENU_DOWN, A_MENU_LEFT, A_MENU_RIGHT, + A_MENU_UP_2, + A_MENU_DOWN_2, + A_MENU_LEFT_2, + A_MENU_RIGHT_2, + A_MENU_UP_3, + A_MENU_DOWN_3, + A_MENU_LEFT_3, + A_MENU_RIGHT_3, A_MENU_BACK, A_MENU_SELECT, A_MENU_START, diff --git a/src/wipeout/menu.c b/src/wipeout/menu.c index 4cd005a..3e2b9cf 100644 --- a/src/wipeout/menu.c +++ b/src/wipeout/menu.c @@ -86,18 +86,18 @@ void menu_update(menu_t *menu) { int selected_data = 0; if (page->entries_len > 0) { if (flags_is(page->layout_flags, MENU_HORIZONTAL)) { - if (input_pressed(A_MENU_LEFT)) { + if (input_pressed(A_MENU_LEFT) || input_pressed(A_MENU_LEFT_2) || input_pressed(A_MENU_LEFT_3)) { page->index--; } - else if (input_pressed(A_MENU_RIGHT)) { + else if (input_pressed(A_MENU_RIGHT) || input_pressed(A_MENU_RIGHT_2) || input_pressed(A_MENU_RIGHT_3)) { page->index++; } } else { - if (input_pressed(A_MENU_UP)) { + if (input_pressed(A_MENU_UP) || input_pressed(A_MENU_UP_2) || input_pressed(A_MENU_UP_3)) { page->index--; } - if (input_pressed(A_MENU_DOWN)) { + if (input_pressed(A_MENU_DOWN) || input_pressed(A_MENU_DOWN_2) || input_pressed(A_MENU_DOWN_3)) { page->index++; } } From e916dfbb0c7a8591778e8bb50c84c06d9e144dfc Mon Sep 17 00:00:00 2001 From: spykyvenator Date: Fri, 1 Mar 2024 12:03:38 +0100 Subject: [PATCH 2/3] add: hall of fame nav --- src/wipeout/ingame_menus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wipeout/ingame_menus.c b/src/wipeout/ingame_menus.c index 1eb93ed..b286f46 100644 --- a/src/wipeout/ingame_menus.c +++ b/src/wipeout/ingame_menus.c @@ -325,10 +325,10 @@ static void hall_of_fame_draw_name_entry(menu_t *menu, ui_pos_t anchor, vec2i_t c_first = 36; } - if (input_pressed(A_MENU_UP)) { + if (input_pressed(A_MENU_UP) || input_pressed(A_MENU_UP_2) || input_pressed(A_MENU_UP_3)) { hs_char_index++; } - else if (input_pressed(A_MENU_DOWN)) { + else if (input_pressed(A_MENU_DOWN) || input_pressed(A_MENU_DOWN_2) || input_pressed(A_MENU_DOWN_3)) { hs_char_index--; } From 5df422e70572ec3f4c384ef214c67290f73694ef Mon Sep 17 00:00:00 2001 From: spykyvenator Date: Sat, 2 Mar 2024 14:19:54 +0100 Subject: [PATCH 3/3] remove: unneeded extra keyactions --- src/wipeout/game.c | 16 ++++++++-------- src/wipeout/game.h | 8 -------- src/wipeout/ingame_menus.c | 4 ++-- src/wipeout/menu.c | 8 ++++---- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/wipeout/game.c b/src/wipeout/game.c index 50c519b..e6d155c 100755 --- a/src/wipeout/game.c +++ b/src/wipeout/game.c @@ -544,15 +544,15 @@ void game_init(void) { input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_LEFT, A_MENU_LEFT); input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_RIGHT, A_MENU_RIGHT); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_W, A_MENU_UP_2); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_S, A_MENU_DOWN_2); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_A, A_MENU_LEFT_2); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_D, A_MENU_RIGHT_2); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_W, A_MENU_UP); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_S, A_MENU_DOWN); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_A, A_MENU_LEFT); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_D, A_MENU_RIGHT); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_K, A_MENU_UP_3); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_J, A_MENU_DOWN_3); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_H, A_MENU_LEFT_3); - input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_L, A_MENU_RIGHT_3); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_K, A_MENU_UP); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_J, A_MENU_DOWN); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_H, A_MENU_LEFT); + input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_L, A_MENU_RIGHT); input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_BACKSPACE, A_MENU_BACK); input_bind(INPUT_LAYER_SYSTEM, INPUT_KEY_C, A_MENU_BACK); diff --git a/src/wipeout/game.h b/src/wipeout/game.h index 51fc840..ac62a90 100755 --- a/src/wipeout/game.h +++ b/src/wipeout/game.h @@ -35,14 +35,6 @@ typedef enum { A_MENU_DOWN, A_MENU_LEFT, A_MENU_RIGHT, - A_MENU_UP_2, - A_MENU_DOWN_2, - A_MENU_LEFT_2, - A_MENU_RIGHT_2, - A_MENU_UP_3, - A_MENU_DOWN_3, - A_MENU_LEFT_3, - A_MENU_RIGHT_3, A_MENU_BACK, A_MENU_SELECT, A_MENU_START, diff --git a/src/wipeout/ingame_menus.c b/src/wipeout/ingame_menus.c index b286f46..1eb93ed 100644 --- a/src/wipeout/ingame_menus.c +++ b/src/wipeout/ingame_menus.c @@ -325,10 +325,10 @@ static void hall_of_fame_draw_name_entry(menu_t *menu, ui_pos_t anchor, vec2i_t c_first = 36; } - if (input_pressed(A_MENU_UP) || input_pressed(A_MENU_UP_2) || input_pressed(A_MENU_UP_3)) { + if (input_pressed(A_MENU_UP)) { hs_char_index++; } - else if (input_pressed(A_MENU_DOWN) || input_pressed(A_MENU_DOWN_2) || input_pressed(A_MENU_DOWN_3)) { + else if (input_pressed(A_MENU_DOWN)) { hs_char_index--; } diff --git a/src/wipeout/menu.c b/src/wipeout/menu.c index 3e2b9cf..4cd005a 100644 --- a/src/wipeout/menu.c +++ b/src/wipeout/menu.c @@ -86,18 +86,18 @@ void menu_update(menu_t *menu) { int selected_data = 0; if (page->entries_len > 0) { if (flags_is(page->layout_flags, MENU_HORIZONTAL)) { - if (input_pressed(A_MENU_LEFT) || input_pressed(A_MENU_LEFT_2) || input_pressed(A_MENU_LEFT_3)) { + if (input_pressed(A_MENU_LEFT)) { page->index--; } - else if (input_pressed(A_MENU_RIGHT) || input_pressed(A_MENU_RIGHT_2) || input_pressed(A_MENU_RIGHT_3)) { + else if (input_pressed(A_MENU_RIGHT)) { page->index++; } } else { - if (input_pressed(A_MENU_UP) || input_pressed(A_MENU_UP_2) || input_pressed(A_MENU_UP_3)) { + if (input_pressed(A_MENU_UP)) { page->index--; } - if (input_pressed(A_MENU_DOWN) || input_pressed(A_MENU_DOWN_2) || input_pressed(A_MENU_DOWN_3)) { + if (input_pressed(A_MENU_DOWN)) { page->index++; } }