mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 18:40:09 +00:00
(Menu) Refactor menu_entries_push
This commit is contained in:
parent
2baac0bb71
commit
9ab14a89c3
@ -542,8 +542,7 @@ static void defer_decision_manual(void)
|
|||||||
if (driver.menu)
|
if (driver.menu)
|
||||||
menu_entries_push(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
g_settings.libretro_directory, "deferred_core_list",
|
g_settings.libretro_directory, "deferred_core_list",
|
||||||
MENU_SETTINGS_DEFERRED_CORE, driver.menu->selection_ptr,
|
MENU_SETTINGS_DEFERRED_CORE, driver.menu->selection_ptr);
|
||||||
MENU_ACTION_OK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int menu_common_setting_set_perf(unsigned setting, unsigned action,
|
static int menu_common_setting_set_perf(unsigned setting, unsigned action,
|
||||||
@ -604,7 +603,7 @@ static void menu_common_setting_set_current_path_selection(
|
|||||||
case MENU_ACTION_OK:
|
case MENU_ACTION_OK:
|
||||||
menu_entries_push(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
start_path, "path_list", type,
|
start_path, "path_list", type,
|
||||||
driver.menu->selection_ptr, action);
|
driver.menu->selection_ptr);
|
||||||
break;
|
break;
|
||||||
case MENU_ACTION_START:
|
case MENU_ACTION_START:
|
||||||
*setting->value.string = '\0';
|
*setting->value.string = '\0';
|
||||||
@ -1346,19 +1345,19 @@ static int menu_settings_iterate(unsigned action)
|
|||||||
driver.menu->defer_core = (!strcmp(label, "detect_core_list"));
|
driver.menu->defer_core = (!strcmp(label, "detect_core_list"));
|
||||||
menu_entries_push(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
g_settings.menu_content_directory, "", MENU_FILE_DIRECTORY,
|
g_settings.menu_content_directory, "", MENU_FILE_DIRECTORY,
|
||||||
driver.menu->selection_ptr, action);
|
driver.menu->selection_ptr);
|
||||||
}
|
}
|
||||||
else if ((!strcmp(label, "history_list") ||
|
else if ((!strcmp(label, "history_list") ||
|
||||||
menu_common_type_is(type) == MENU_FILE_DIRECTORY)
|
menu_common_type_is(type) == MENU_FILE_DIRECTORY)
|
||||||
&& action == MENU_ACTION_OK)
|
&& action == MENU_ACTION_OK)
|
||||||
menu_entries_push(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
"", "", type, driver.menu->selection_ptr, action);
|
"", "", type, driver.menu->selection_ptr);
|
||||||
else if ((menu_common_type_is(type) == MENU_SETTINGS ||
|
else if ((menu_common_type_is(type) == MENU_SETTINGS ||
|
||||||
type == MENU_SETTINGS_CORE || type == MENU_SETTINGS_CONFIG ||
|
type == MENU_SETTINGS_CORE || type == MENU_SETTINGS_CONFIG ||
|
||||||
type == MENU_SETTINGS_DISK_APPEND) && action == MENU_ACTION_OK)
|
type == MENU_SETTINGS_DISK_APPEND) && action == MENU_ACTION_OK)
|
||||||
menu_entries_push(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
dir ? dir : label, "", type,
|
dir ? dir : label, "", type,
|
||||||
driver.menu->selection_ptr, action);
|
driver.menu->selection_ptr);
|
||||||
else if (type == MENU_SETTINGS_CUSTOM_VIEWPORT && action == MENU_ACTION_OK)
|
else if (type == MENU_SETTINGS_CUSTOM_VIEWPORT && action == MENU_ACTION_OK)
|
||||||
{
|
{
|
||||||
file_list_push(driver.menu->menu_stack, "", "",
|
file_list_push(driver.menu->menu_stack, "", "",
|
||||||
@ -1700,8 +1699,7 @@ static int menu_action_ok(const char *dir, unsigned menu_type)
|
|||||||
fill_pathname_join(cat_path, dir, path, sizeof(cat_path));
|
fill_pathname_join(cat_path, dir, path, sizeof(cat_path));
|
||||||
|
|
||||||
menu_entries_push(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
cat_path, "browser_list", type, driver.menu->selection_ptr,
|
cat_path, "browser_list", type, driver.menu->selection_ptr);
|
||||||
MENU_ACTION_OK);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -311,9 +311,9 @@ static int menu_common_shader_manager_setting_toggle(unsigned id, unsigned actio
|
|||||||
menu_common_setting_set_current_boolean(current_setting, action);
|
menu_common_setting_set_current_boolean(current_setting, action);
|
||||||
}
|
}
|
||||||
else if ((id == MENU_SETTINGS_SHADER_PARAMETERS
|
else if ((id == MENU_SETTINGS_SHADER_PARAMETERS
|
||||||
|| id == MENU_SETTINGS_SHADER_PRESET_PARAMETERS))
|
|| id == MENU_SETTINGS_SHADER_PRESET_PARAMETERS) && action == MENU_ACTION_OK)
|
||||||
menu_entries_push(driver.menu->menu_stack, "",
|
menu_entries_push(driver.menu->menu_stack, "",
|
||||||
"shader_parameters", id, driver.menu->selection_ptr, action);
|
"shader_parameters", id, driver.menu->selection_ptr);
|
||||||
else if (id >= MENU_SETTINGS_SHADER_PARAMETER_0 && id <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
else if (id >= MENU_SETTINGS_SHADER_PARAMETER_0 && id <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
||||||
{
|
{
|
||||||
struct gfx_shader *shader = NULL;
|
struct gfx_shader *shader = NULL;
|
||||||
@ -361,7 +361,7 @@ static int menu_common_shader_manager_setting_toggle(unsigned id, unsigned actio
|
|||||||
case MENU_ACTION_OK:
|
case MENU_ACTION_OK:
|
||||||
menu_entries_push(driver.menu->menu_stack,
|
menu_entries_push(driver.menu->menu_stack,
|
||||||
g_settings.video.shader_dir, "video_shader_preset",
|
g_settings.video.shader_dir, "video_shader_preset",
|
||||||
id, driver.menu->selection_ptr, action);
|
id, driver.menu->selection_ptr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ACTION_START:
|
case MENU_ACTION_START:
|
||||||
|
@ -827,12 +827,9 @@ void menu_flush_stack_type(unsigned final_type)
|
|||||||
|
|
||||||
void menu_entries_push(file_list_t *list,
|
void menu_entries_push(file_list_t *list,
|
||||||
const char *path, const char *label, unsigned type,
|
const char *path, const char *label, unsigned type,
|
||||||
size_t directory_ptr, unsigned action)
|
size_t directory_ptr)
|
||||||
{
|
{
|
||||||
if (action == MENU_ACTION_OK)
|
file_list_push(list, path, label, type, directory_ptr);
|
||||||
{
|
menu_clear_navigation(driver.menu);
|
||||||
file_list_push(list, path, label, type, directory_ptr);
|
driver.menu->need_refresh = true;
|
||||||
menu_clear_navigation(driver.menu);
|
|
||||||
driver.menu->need_refresh = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
void menu_entries_push(file_list_t *list,
|
void menu_entries_push(file_list_t *list,
|
||||||
const char *path, const char *label, unsigned type,
|
const char *path, const char *label, unsigned type,
|
||||||
size_t directory_ptr, unsigned action);
|
size_t directory_ptr);
|
||||||
int menu_entries_push_list(menu_handle_t *menu, const char *path,
|
int menu_entries_push_list(menu_handle_t *menu, const char *path,
|
||||||
const char *label, unsigned menu_type);
|
const char *label, unsigned menu_type);
|
||||||
int menu_parse_check(unsigned menu_type);
|
int menu_parse_check(unsigned menu_type);
|
||||||
|
@ -1479,7 +1479,7 @@ static void general_write_handler(const void *data)
|
|||||||
if (*setting->value.boolean)
|
if (*setting->value.boolean)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_entries_push(driver.menu->menu_stack, "", "help", 0, 0, MENU_ACTION_OK);
|
menu_entries_push(driver.menu->menu_stack, "", "help", 0, 0);
|
||||||
#endif
|
#endif
|
||||||
*setting->value.boolean = false;
|
*setting->value.boolean = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user