mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Start refactoring list building
This commit is contained in:
parent
5da4cb754a
commit
57edd31fdf
@ -372,7 +372,7 @@ bool generic_menu_init_list(void *data)
|
||||
|
||||
info.list = selection_buf;
|
||||
info.type = MENU_SETTINGS;
|
||||
info.flags = SL_FLAG_MAIN_MENU | SL_FLAG_MAIN_MENU_SETTINGS;
|
||||
info.flags = SL_FLAG_MAIN_MENU | SL_FLAG_SETTINGS;
|
||||
strlcpy(info.label, menu_hash_to_str(MENU_VALUE_MAIN_MENU), sizeof(info.label));
|
||||
|
||||
menu_entries_push(menu_stack, info.path, info.label, info.type, info.flags, 0);
|
||||
|
@ -1534,7 +1534,7 @@ static int menu_displaylist_parse_settings_in_subgroup(menu_displaylist_info_t *
|
||||
}
|
||||
}
|
||||
|
||||
menu_displaylist_realloc_settings(menu->entries, SL_FLAG_ALL_SETTINGS);
|
||||
menu_displaylist_realloc_settings(menu->entries, SL_FLAG_SETTINGS_GROUP_ALL);
|
||||
|
||||
info->setting = menu_setting_find(elem0);
|
||||
|
||||
@ -2386,7 +2386,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
||||
need_push = true;
|
||||
break;
|
||||
case DISPLAYLIST_SETTINGS:
|
||||
info->flags = SL_FLAG_ALL_SETTINGS;
|
||||
info->flags = SL_FLAG_SETTINGS_GROUP_ALL;
|
||||
ret = menu_displaylist_parse_settings(menu, info, info->flags);
|
||||
need_push = true;
|
||||
break;
|
||||
@ -2395,7 +2395,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
|
||||
need_push = true;
|
||||
break;
|
||||
case DISPLAYLIST_SETTINGS_ALL:
|
||||
menu_displaylist_realloc_settings(menu->entries, SL_FLAG_ALL_SETTINGS);
|
||||
menu_displaylist_realloc_settings(menu->entries, SL_FLAG_SETTINGS_GROUP_ALL);
|
||||
|
||||
setting = menu_setting_find(menu_hash_to_str(MENU_LABEL_VALUE_DRIVER_SETTINGS));
|
||||
flags = menu_setting_get_flags(setting);
|
||||
@ -2891,7 +2891,7 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
|
||||
switch (hash_label)
|
||||
{
|
||||
case MENU_VALUE_MAIN_MENU:
|
||||
info.flags = SL_FLAG_MAIN_MENU | SL_FLAG_MAIN_MENU_SETTINGS;
|
||||
info.flags = SL_FLAG_MAIN_MENU | SL_FLAG_SETTINGS;
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_MAIN_MENU);
|
||||
case MENU_VALUE_HORIZONTAL_MENU:
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL);
|
||||
|
@ -2894,7 +2894,7 @@ static bool setting_append_list_main_menu_options(
|
||||
#endif
|
||||
|
||||
|
||||
if (mask & SL_FLAG_MAIN_MENU_SETTINGS)
|
||||
if (mask & SL_FLAG_SETTINGS)
|
||||
{
|
||||
CONFIG_ACTION(
|
||||
menu_hash_to_str(MENU_LABEL_SETTINGS),
|
||||
@ -6656,56 +6656,56 @@ rarch_setting_t *menu_setting_new(unsigned mask)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_DRIVER_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_DRIVER_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_driver_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_CORE_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_CORE_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_core_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_CONFIGURATION_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_CONFIGURATION_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_configuration_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_LOGGING_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_LOGGING_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_logging_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_SAVING_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_SAVING_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_saving_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_REWIND_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_REWIND_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_rewind_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_VIDEO_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_VIDEO_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_video_options(&list, list_info, root))
|
||||
goto error;
|
||||
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_AUDIO_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_AUDIO_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_audio_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_INPUT_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_INPUT_OPTIONS)
|
||||
{
|
||||
unsigned user;
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -6717,15 +6717,13 @@ rarch_setting_t *menu_setting_new(unsigned mask)
|
||||
setting_append_list_input_player_options(&list, list_info, root, user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (mask & SL_FLAG_INPUT_HOTKEY_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_INPUT_HOTKEY_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_input_hotkey_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_RECORDING_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_RECORDING_OPTIONS)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
@ -6736,88 +6734,88 @@ rarch_setting_t *menu_setting_new(unsigned mask)
|
||||
}
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_FRAME_THROTTLE_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_FRAME_THROTTLE_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_frame_throttling_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_FONT_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_FONT_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_font_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_OVERLAY_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_OVERLAY_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_overlay_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_MENU_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_MENU_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_menu_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_MENU_BROWSER_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_MENU_BROWSER_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_menu_file_browser_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
#if defined(HAVE_IMAGEVIEWER) || defined(HAVE_FFMPEG)
|
||||
if (mask & SL_FLAG_MULTIMEDIA_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_MULTIMEDIA_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_multimedia_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mask & SL_FLAG_UI_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_UI_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_ui_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_PLAYLIST_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_PLAYLIST_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_playlist_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_CHEEVOS_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_CHEEVOS_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_cheevos_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_CORE_UPDATER_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_CORE_UPDATER_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_core_updater_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_NETPLAY_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_NETPLAY_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_netplay_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
if (mask & SL_FLAG_USER_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_USER_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_user_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_DIRECTORY_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_DIRECTORY_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_directory_options(&list, list_info, root))
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (mask & SL_FLAG_PRIVACY_OPTIONS)
|
||||
if (mask & SL_FLAG_SETTINGS_PRIVACY_OPTIONS)
|
||||
{
|
||||
if (!setting_append_list_privacy_options(&list, list_info, root))
|
||||
goto error;
|
||||
|
@ -61,42 +61,42 @@ enum setting_flags
|
||||
|
||||
enum setting_list_flags
|
||||
{
|
||||
SL_FLAG_MAIN_MENU = (1 << 0),
|
||||
SL_FLAG_MAIN_MENU_SETTINGS = (1 << 1),
|
||||
SL_FLAG_DRIVER_OPTIONS = (1 << 2),
|
||||
SL_FLAG_CORE_OPTIONS = (1 << 3),
|
||||
SL_FLAG_CONFIGURATION_OPTIONS = (1 << 4),
|
||||
SL_FLAG_REWIND_OPTIONS = (1 << 5),
|
||||
SL_FLAG_VIDEO_OPTIONS = (1 << 6),
|
||||
SL_FLAG_SHADER_OPTIONS = (1 << 7),
|
||||
SL_FLAG_FONT_OPTIONS = (1 << 8),
|
||||
SL_FLAG_AUDIO_OPTIONS = (1 << 9),
|
||||
SL_FLAG_INPUT_OPTIONS = (1 << 10),
|
||||
SL_FLAG_INPUT_HOTKEY_OPTIONS = (1 << 11),
|
||||
SL_FLAG_OVERLAY_OPTIONS = (1 << 12),
|
||||
SL_FLAG_MENU_OPTIONS = (1 << 13),
|
||||
SL_FLAG_MULTIMEDIA_OPTIONS = (1 << 14),
|
||||
SL_FLAG_UI_OPTIONS = (1 << 15),
|
||||
SL_FLAG_CHEEVOS_OPTIONS = (1 << 16),
|
||||
SL_FLAG_CORE_UPDATER_OPTIONS = (1 << 17),
|
||||
SL_FLAG_NETPLAY_OPTIONS = (1 << 18),
|
||||
SL_FLAG_USER_OPTIONS = (1 << 19),
|
||||
SL_FLAG_DIRECTORY_OPTIONS = (1 << 20),
|
||||
SL_FLAG_PRIVACY_OPTIONS = (1 << 21),
|
||||
SL_FLAG_PLAYLIST_OPTIONS = (1 << 22),
|
||||
SL_FLAG_MENU_BROWSER_OPTIONS = (1 << 23),
|
||||
SL_FLAG_PATCH_OPTIONS = (1 << 24),
|
||||
SL_FLAG_RECORDING_OPTIONS = (1 << 25),
|
||||
SL_FLAG_FRAME_THROTTLE_OPTIONS= (1 << 26),
|
||||
SL_FLAG_LOGGING_OPTIONS = (1 << 27),
|
||||
SL_FLAG_SAVING_OPTIONS = (1 << 28),
|
||||
SL_FLAG_ALL = (1 << 29),
|
||||
SL_FLAG_ALLOW_EMPTY_LIST = (1 << 30)
|
||||
SL_FLAG_MAIN_MENU = (1 << 0),
|
||||
SL_FLAG_SETTINGS = (1 << 1),
|
||||
SL_FLAG_SETTINGS_DRIVER_OPTIONS = (1 << 2),
|
||||
SL_FLAG_SETTINGS_CORE_OPTIONS = (1 << 3),
|
||||
SL_FLAG_SETTINGS_CONFIGURATION_OPTIONS = (1 << 4),
|
||||
SL_FLAG_SETTINGS_REWIND_OPTIONS = (1 << 5),
|
||||
SL_FLAG_SETTINGS_VIDEO_OPTIONS = (1 << 6),
|
||||
SL_FLAG_SETTINGS_SHADER_OPTIONS = (1 << 7),
|
||||
SL_FLAG_SETTINGS_FONT_OPTIONS = (1 << 8),
|
||||
SL_FLAG_SETTINGS_AUDIO_OPTIONS = (1 << 9),
|
||||
SL_FLAG_SETTINGS_INPUT_OPTIONS = (1 << 10),
|
||||
SL_FLAG_SETTINGS_INPUT_HOTKEY_OPTIONS = (1 << 11),
|
||||
SL_FLAG_SETTINGS_OVERLAY_OPTIONS = (1 << 12),
|
||||
SL_FLAG_SETTINGS_MENU_OPTIONS = (1 << 13),
|
||||
SL_FLAG_SETTINGS_MULTIMEDIA_OPTIONS = (1 << 14),
|
||||
SL_FLAG_SETTINGS_UI_OPTIONS = (1 << 15),
|
||||
SL_FLAG_SETTINGS_CHEEVOS_OPTIONS = (1 << 16),
|
||||
SL_FLAG_SETTINGS_CORE_UPDATER_OPTIONS = (1 << 17),
|
||||
SL_FLAG_SETTINGS_NETPLAY_OPTIONS = (1 << 18),
|
||||
SL_FLAG_SETTINGS_USER_OPTIONS = (1 << 19),
|
||||
SL_FLAG_SETTINGS_DIRECTORY_OPTIONS = (1 << 20),
|
||||
SL_FLAG_SETTINGS_PRIVACY_OPTIONS = (1 << 21),
|
||||
SL_FLAG_SETTINGS_PLAYLIST_OPTIONS = (1 << 22),
|
||||
SL_FLAG_SETTINGS_MENU_BROWSER_OPTIONS = (1 << 23),
|
||||
SL_FLAG_SETTINGS_PATCH_OPTIONS = (1 << 24),
|
||||
SL_FLAG_SETTINGS_RECORDING_OPTIONS = (1 << 25),
|
||||
SL_FLAG_SETTINGS_FRAME_THROTTLE_OPTIONS = (1 << 26),
|
||||
SL_FLAG_SETTINGS_LOGGING_OPTIONS = (1 << 27),
|
||||
SL_FLAG_SETTINGS_SAVING_OPTIONS = (1 << 28),
|
||||
SL_FLAG_SETTINGS_ALL = (1 << 29),
|
||||
SL_FLAG_ALLOW_EMPTY_LIST = (1 << 30)
|
||||
};
|
||||
|
||||
typedef struct rarch_setting rarch_setting_t;
|
||||
|
||||
#define SL_FLAG_ALL_SETTINGS (SL_FLAG_ALL - SL_FLAG_MAIN_MENU)
|
||||
#define SL_FLAG_SETTINGS_GROUP_ALL (SL_FLAG_SETTINGS_ALL - SL_FLAG_MAIN_MENU)
|
||||
|
||||
int menu_setting_generic(rarch_setting_t *setting, bool wraparound);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user