From c9462b6959a4343e5d25a974c27336b721a77a1d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 1 Sep 2014 19:44:14 +0200 Subject: [PATCH] (Menu) Move setting from menu_setting_set to menu_setting_start_toggle --- frontend/menu/backend/menu_common_backend.c | 51 ++++++++++----------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/frontend/menu/backend/menu_common_backend.c b/frontend/menu/backend/menu_common_backend.c index 93ea132df2..d884b5468c 100644 --- a/frontend/menu/backend/menu_common_backend.c +++ b/frontend/menu/backend/menu_common_backend.c @@ -1070,31 +1070,6 @@ static int menu_setting_set(unsigned id, unsigned action) } } break; - case MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL: - if (action == MENU_ACTION_OK) - { - unsigned i; - struct retro_keybind *target = (struct retro_keybind*) - &g_settings.input.binds[port][0]; - const struct retro_keybind *def_binds = - port ? retro_keybinds_rest : retro_keybinds_1; - - driver.menu->binds.begin = MENU_SETTINGS_BIND_BEGIN; - driver.menu->binds.last = MENU_SETTINGS_BIND_LAST; - - for (i = MENU_SETTINGS_BIND_BEGIN; - i <= MENU_SETTINGS_BIND_LAST; i++, target++) - { - if (driver.menu->bind_mode_keyboard) - target->key = def_binds[i - MENU_SETTINGS_BIND_BEGIN].key; - else - { - target->joykey = NO_BTN; - target->joyaxis = AXIS_NONE; - } - } - } - break; #if defined(GEKKO) case MENU_SETTINGS_VIDEO_RESOLUTION: if (action == MENU_ACTION_LEFT) @@ -1261,7 +1236,31 @@ static int menu_setting_ok_toggle(unsigned type, const char *dir, const char *label, unsigned action) { - if (type >= MENU_SETTINGS_BIND_BEGIN && + if (type == MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL) + { + unsigned i; + struct retro_keybind *target = (struct retro_keybind*) + &g_settings.input.binds[driver.menu->current_pad][0]; + const struct retro_keybind *def_binds = + driver.menu->current_pad ? retro_keybinds_rest : retro_keybinds_1; + + driver.menu->binds.begin = MENU_SETTINGS_BIND_BEGIN; + driver.menu->binds.last = MENU_SETTINGS_BIND_LAST; + + for (i = MENU_SETTINGS_BIND_BEGIN; + i <= MENU_SETTINGS_BIND_LAST; i++, target++) + { + if (driver.menu->bind_mode_keyboard) + target->key = def_binds[i - MENU_SETTINGS_BIND_BEGIN].key; + else + { + target->joykey = NO_BTN; + target->joyaxis = AXIS_NONE; + } + } + return 0; + } + else if (type >= MENU_SETTINGS_BIND_BEGIN && type <= MENU_SETTINGS_BIND_ALL_LAST) { struct retro_keybind *bind = (struct retro_keybind*)