mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
(Menu) Refactor more hardcoded enums
This commit is contained in:
parent
a72a866db3
commit
5ef289fe28
@ -1870,7 +1870,7 @@ static int menu_action_ok(const char *dir,
|
||||
MENU_SETTINGS_SHADER_OPTIONS);
|
||||
}
|
||||
#endif
|
||||
else if (menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||
else if (!strcmp(menu_label, "deferred_core_list"))
|
||||
{
|
||||
strlcpy(g_settings.libretro, path, sizeof(g_settings.libretro));
|
||||
strlcpy(g_extern.fullpath, driver.menu->deferred_path,
|
||||
@ -1953,7 +1953,7 @@ static int menu_action_ok(const char *dir,
|
||||
else if (ret == 0)
|
||||
menu_entries_push(driver.menu->menu_stack,
|
||||
g_settings.libretro_directory, "deferred_core_list",
|
||||
MENU_SETTINGS_DEFERRED_CORE, driver.menu->selection_ptr);
|
||||
0, driver.menu->selection_ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ static void rgui_render(void)
|
||||
#endif
|
||||
/* Pretty-print libretro cores from menu. */
|
||||
if (!strcmp(label, "core_list") ||
|
||||
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||
!strcmp(label, "deferred_core_list"))
|
||||
{
|
||||
if (type == MENU_FILE_PLAIN)
|
||||
{
|
||||
|
@ -271,7 +271,7 @@ static void rmenu_render(void)
|
||||
/* Pretty-print libretro cores from menu. */
|
||||
if (
|
||||
!strcmp(label, "core_list") ||
|
||||
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||
!strcmp(label, "deferred_core_list"))
|
||||
{
|
||||
if (type == MENU_FILE_PLAIN)
|
||||
{
|
||||
|
@ -470,7 +470,7 @@ static void rmenu_xui_render(void)
|
||||
else
|
||||
// Pretty-print libretro cores from menu.
|
||||
if (!strcmp(label, "core_list") ||
|
||||
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||
!strcmp(label, "deferred_core_list"))
|
||||
{
|
||||
if (type == MENU_FILE_PLAIN)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ static void get_title(const char *label, const char *dir,
|
||||
{
|
||||
if (!strcmp(label, "core_list"))
|
||||
snprintf(title, sizeof_title, "CORE SELECTION %s", dir);
|
||||
else if (menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||
else if (!strcmp(label, "deferred_core_list"))
|
||||
snprintf(title, sizeof_title, "DETECTED CORES %s", dir);
|
||||
else if (menu_type == MENU_SETTINGS_CONFIG)
|
||||
snprintf(title, sizeof_title, "CONFIG %s", dir);
|
||||
|
@ -105,7 +105,6 @@ typedef enum
|
||||
MENU_SETTINGS_SHADER_PRESET_SAVE,
|
||||
|
||||
// settings options are done here too
|
||||
MENU_SETTINGS_DEFERRED_CORE,
|
||||
MENU_SETTINGS_CONFIG,
|
||||
MENU_SETTINGS_CORE_OPTIONS,
|
||||
MENU_SETTINGS_AUDIO_OPTIONS,
|
||||
|
@ -270,28 +270,27 @@ int menu_entries_push_list(menu_handle_t *menu,
|
||||
"No information available.", "",
|
||||
MENU_SETTINGS_CORE_OPTION_NONE, 0);
|
||||
}
|
||||
else if (!strcmp(label, "deferred_core_list"))
|
||||
{
|
||||
const core_info_t *info = NULL;
|
||||
file_list_clear(list);
|
||||
core_info_list_get_supported_cores(g_extern.core_info,
|
||||
driver.menu->deferred_path, &info, &list_size);
|
||||
for (i = 0; i < list_size; i++)
|
||||
{
|
||||
file_list_push(list, info[i].path, "",
|
||||
MENU_FILE_PLAIN, 0);
|
||||
file_list_set_alt_at_offset(list, i,
|
||||
info[i].display_name);
|
||||
}
|
||||
file_list_sort_on_alt(list);
|
||||
|
||||
do_action = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (menu_type)
|
||||
{
|
||||
case MENU_SETTINGS_DEFERRED_CORE:
|
||||
{
|
||||
const core_info_t *info = NULL;
|
||||
file_list_clear(list);
|
||||
core_info_list_get_supported_cores(g_extern.core_info,
|
||||
driver.menu->deferred_path, &info, &list_size);
|
||||
for (i = 0; i < list_size; i++)
|
||||
{
|
||||
file_list_push(list, info[i].path, "",
|
||||
MENU_FILE_PLAIN, 0);
|
||||
file_list_set_alt_at_offset(list, i,
|
||||
info[i].display_name);
|
||||
}
|
||||
file_list_sort_on_alt(list);
|
||||
|
||||
do_action = true;
|
||||
}
|
||||
break;
|
||||
case MENU_SETTINGS_SHADER_PARAMETERS:
|
||||
case MENU_SETTINGS_SHADER_PRESET_PARAMETERS:
|
||||
{
|
||||
@ -604,7 +603,7 @@ int menu_parse_and_resolve(file_list_t *list, file_list_t *menu_list)
|
||||
#endif
|
||||
|
||||
if (!strcmp(label, "history_list") ||
|
||||
menu_type == MENU_SETTINGS_DEFERRED_CORE)
|
||||
!strcmp(label, "deferred_core_list"))
|
||||
return menu_entries_push_list(driver.menu, list, dir, label, menu_type);
|
||||
|
||||
if (menu_parse_check(label, menu_type) == -1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user