1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 17:58:41 +00:00

Refactor Configuration Settings

This commit is contained in:
twinaphex 2016-07-02 10:17:09 +02:00
parent 951686ba59
commit 662497d897
9 changed files with 89 additions and 3 deletions

View File

@ -1280,6 +1280,8 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
return "deferred_core_settings_list";
case MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST:
return "deferred_video_settings_list";
case MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST:
return "deferred_configuration_settings_list";
case MENU_ENUM_LABEL_ACCOUNTS_LIST:
return "accounts_list";
case MENU_ENUM_LABEL_DEFERRED_INPUT_HOTKEY_BINDS_LIST:
@ -1302,6 +1304,8 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
return "driver_settings";
case MENU_ENUM_LABEL_VIDEO_SETTINGS:
return "video_settings";
case MENU_ENUM_LABEL_CONFIGURATION_SETTINGS:
return "configuration_settings";
case MENU_ENUM_LABEL_AUDIO_SETTINGS:
return "audio_settings";
case MENU_ENUM_LABEL_DEBUG_PANEL_ENABLE:

View File

@ -114,6 +114,11 @@ static int deferred_push_video_settings_list(menu_displaylist_info_t *info)
return deferred_push_dlist(info, DISPLAYLIST_VIDEO_SETTINGS_LIST);
}
static int deferred_push_configuration_settings_list(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_CONFIGURATION_SETTINGS_LIST);
}
static int deferred_push_audio_settings_list(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_AUDIO_SETTINGS_LIST);
@ -607,6 +612,11 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_settings_list);
return 0;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_configuration_settings_list);
return 0;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_LIST)))
{
#ifdef HAVE_NETWORKING
@ -844,6 +854,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_video_settings_list);
break;
case MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_configuration_settings_list);
break;
case MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_audio_settings_list);
break;

View File

@ -465,6 +465,13 @@ int generic_action_ok_displaylist_push(const char *path,
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST;
break;
case ACTION_OK_DL_CONFIGURATION_SETTINGS_LIST:
info.directory_ptr = idx;
info.type = type;
info_path = path;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST;
break;
case ACTION_OK_DL_AUDIO_SETTINGS_LIST:
info.directory_ptr = idx;
info.type = type;
@ -2445,6 +2452,13 @@ static int action_ok_push_video_settings_list(const char *path,
ACTION_OK_DL_VIDEO_SETTINGS_LIST);
}
static int action_ok_push_configuration_settings_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
ACTION_OK_DL_CONFIGURATION_SETTINGS_LIST);
}
static int action_ok_push_core_settings_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@ -2851,6 +2865,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CORE_SETTINGS:
BIND_ACTION_OK(cbs, action_ok_push_core_settings_list);
break;
case MENU_ENUM_LABEL_CONFIGURATION_SETTINGS:
BIND_ACTION_OK(cbs, action_ok_push_configuration_settings_list);
break;
case MENU_ENUM_LABEL_PLAYLIST_SETTINGS:
BIND_ACTION_OK(cbs, action_ok_push_playlist_settings_list);
break;

View File

@ -200,6 +200,13 @@ static int action_get_video_settings_list(const char *path, const char *label,
return 0;
}
static int action_get_configuration_settings_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len)
{
sanitize_to_string(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS), len);
return 0;
}
static int action_get_audio_settings_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len)
{
@ -750,6 +757,12 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST)))
{
BIND_ACTION_GET_TITLE(cbs, action_get_configuration_settings_list);
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_LIST)))
{
BIND_ACTION_GET_TITLE(cbs, action_get_download_core_content_list);
@ -964,6 +977,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_video_settings_list);
break;
case MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_configuration_settings_list);
break;
case MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_core_settings_list);
break;

View File

@ -42,6 +42,7 @@ enum
ACTION_OK_DL_DRIVER_SETTINGS_LIST,
ACTION_OK_DL_VIDEO_SETTINGS_LIST,
ACTION_OK_DL_AUDIO_SETTINGS_LIST,
ACTION_OK_DL_CONFIGURATION_SETTINGS_LIST,
ACTION_OK_DL_CORE_SETTINGS_LIST,
ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST,
ACTION_OK_DL_PLAYLIST_SETTINGS_LIST,

View File

@ -3737,6 +3737,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
case DISPLAYLIST_INPUT_HOTKEY_BINDS_LIST:
case DISPLAYLIST_DRIVER_SETTINGS_LIST:
case DISPLAYLIST_VIDEO_SETTINGS_LIST:
case DISPLAYLIST_CONFIGURATION_SETTINGS_LIST:
case DISPLAYLIST_AUDIO_SETTINGS_LIST:
case DISPLAYLIST_CORE_SETTINGS_LIST:
case DISPLAYLIST_INPUT_SETTINGS_LIST:
@ -4039,6 +4040,26 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
MENU_ENUM_LABEL_RECORD_DRIVER,
PARSE_ONLY_STRING_OPTIONS, false);
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_CONFIGURATION_SETTINGS_LIST:
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_CONFIG_SAVE_ON_EXIT,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_CORE_SPECIFIC_CONFIG,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_GAME_SPECIFIC_OPTIONS,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_AUTO_OVERRIDES_ENABLE,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_AUTO_REMAPS_ENABLE,
PARSE_ONLY_BOOL, false);
info->need_refresh = true;
info->need_push = true;
break;
@ -4280,8 +4301,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
MENU_ENUM_LABEL_INPUT_SETTINGS, PARSE_ACTION, false);
ret = menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_CORE_SETTINGS, PARSE_ACTION, false);
ret = menu_displaylist_parse_settings(menu, info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS), PARSE_ONLY_GROUP, false);
ret = menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_CONFIGURATION_SETTINGS, PARSE_ACTION, false);
ret = menu_displaylist_parse_settings(menu, info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS), PARSE_ONLY_GROUP, false);
ret = menu_displaylist_parse_settings(menu, info,

View File

@ -102,6 +102,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_ACCOUNTS_LIST,
DISPLAYLIST_DRIVER_SETTINGS_LIST,
DISPLAYLIST_VIDEO_SETTINGS_LIST,
DISPLAYLIST_CONFIGURATION_SETTINGS_LIST,
DISPLAYLIST_AUDIO_SETTINGS_LIST,
DISPLAYLIST_CORE_SETTINGS_LIST,
DISPLAYLIST_INPUT_SETTINGS_LIST,

View File

@ -4218,6 +4218,15 @@ static bool setting_append_list(
parent_group);
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_CORE_SETTINGS);
CONFIG_ACTION(
list, list_info,
msg_hash_to_str(MENU_ENUM_LABEL_CONFIGURATION_SETTINGS),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS),
&group_info,
&subgroup_info,
parent_group);
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_CONFIGURATION_SETTINGS);
CONFIG_ACTION(
list, list_info,
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_SETTINGS),
@ -4473,7 +4482,7 @@ static bool setting_append_list(
START_GROUP(list, list_info, &group_info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS), parent_group);
parent_group = msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS);
parent_group = msg_hash_to_str(MENU_ENUM_LABEL_CONFIGURATION_SETTINGS);
START_SUB_GROUP(list, list_info, "State", &group_info, &subgroup_info,
parent_group);

View File

@ -686,6 +686,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_DEFERRED_INPUT_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_DRIVER_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_USER_BINDS_LIST,
@ -1332,7 +1333,10 @@ enum msg_hash_enums
MENU_ENUM_LABEL_CORE_SETTINGS,
MENU_ENUM_LABEL_VALUE_CORE_SETTINGS,
MENU_ENUM_LABEL_CONFIGURATION_SETTINGS,
MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS,
MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS,
MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS,
MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS,