From e357f6b320b3fef0f3b1363516227a32bc35a97b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 20 Oct 2015 01:35:08 +0200 Subject: [PATCH] (Menu) Improvements --- menu/intl/menu_hash_us.c | 6 ++++++ menu/menu_displaylist.c | 4 +++- menu/menu_hash.h | 5 +++++ menu/menu_setting.c | 24 ++++++++++-------------- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/menu/intl/menu_hash_us.c b/menu/intl/menu_hash_us.c index 8525b92245..29d9a5e3f5 100644 --- a/menu/intl/menu_hash_us.c +++ b/menu/intl/menu_hash_us.c @@ -26,6 +26,10 @@ static const char *menu_hash_to_str_us_label(uint32_t hash) { switch (hash) { + case MENU_LABEL_CHEEVOS_USERNAME: + return "cheevos_username"; + case MENU_LABEL_CHEEVOS_PASSWORD: + return "cheevos_password"; case MENU_LABEL_ACCOUNTS_CHEEVOS_USERNAME: return "accounts_cheevos_username"; case MENU_LABEL_ACCOUNTS_CHEEVOS_PASSWORD: @@ -662,6 +666,8 @@ const char *menu_hash_to_str_us(uint32_t hash) switch (hash) { + case MENU_LABEL_VALUE_ACCOUNTS_CHEEVOS_SETTINGS: + return "Accounts Cheevos"; case MENU_LABEL_VALUE_ACCOUNTS_CHEEVOS_USERNAME: return "Username"; case MENU_LABEL_VALUE_ACCOUNTS_CHEEVOS_PASSWORD: diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 08aac139d0..b90ff270a8 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2289,7 +2289,9 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type) break; case DISPLAYLIST_ACCOUNTS_CHEEVOS_LIST: #ifdef HAVE_CHEEVOS - ret = menu_displaylist_parse_settings(menu, info, "Accounts", PARSE_NONE); + ret = menu_displaylist_parse_settings(menu, info, + menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_CHEEVOS_SETTINGS), + PARSE_NONE); #else menu_entries_push(info->list, menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS), diff --git a/menu/menu_hash.h b/menu/menu_hash.h index 5eafc2893c..c45ae506ae 100644 --- a/menu/menu_hash.h +++ b/menu/menu_hash.h @@ -22,6 +22,11 @@ extern "C" { #endif +#define MENU_LABEL_CHEEVOS_USERNAME 0x6ce57e31U +#define MENU_LABEL_CHEEVOS_PASSWORD 0x86c38d24U + +#define MENU_LABEL_VALUE_ACCOUNTS_CHEEVOS_SETTINGS 0xe0b53ce3U + #define MENU_LABEL_ACCOUNTS_CHEEVOS_PASSWORD 0x45cf62e3U #define MENU_LABEL_VALUE_ACCOUNTS_CHEEVOS_PASSWORD 0xe5a73d05U diff --git a/menu/menu_setting.c b/menu/menu_setting.c index e2290a5d28..8f19752461 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5905,22 +5905,18 @@ static bool setting_append_list_playlist_options( return true; } -static bool setting_append_list_accounts_options( +#ifdef HAVE_CHEEVOS +static bool setting_append_list_accounts_cheevos_options( rarch_setting_t **list, rarch_setting_info_t *list_info, const char *parent_group) { -#ifdef HAVE_CHEEVOS rarch_setting_group_info_t group_info = {0}; rarch_setting_group_info_t subgroup_info = {0}; settings_t *settings = config_get_ptr(); START_GROUP(group_info, -#if 0 - menu_hash_to_str(MENU_LABEL_VALUE_USER_SETTINGS), -#else - "Accounts", -#endif + menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_CHEEVOS_SETTINGS), parent_group); parent_group = menu_hash_to_str(MENU_LABEL_VALUE_SETTINGS); @@ -5929,11 +5925,10 @@ static bool setting_append_list_accounts_options( CONFIG_STRING( settings->cheevos.username, -#if 0 menu_hash_to_str(MENU_LABEL_CHEEVOS_USERNAME), +#if 0 menu_hash_to_str(MENU_LABEL_VALUE_CHEEVOS_USERNAME), #else - "cheevos_username", "Username", #endif "", @@ -5946,11 +5941,10 @@ static bool setting_append_list_accounts_options( CONFIG_STRING( settings->cheevos.password, + menu_hash_to_str(MENU_LABEL_CHEEVOS_PASSWORD), #if 0 - menu_hash_to_str(MENU_LABEL_CHEEVOS_USERNAME), - menu_hash_to_str(MENU_LABEL_VALUE_CHEEVOS_USERNAME), + menu_hash_to_str(MENU_LABEL_VALUE_CHEEVOS_PASSWORD), #else - "cheevos_password", "Password", #endif "", @@ -5963,10 +5957,10 @@ static bool setting_append_list_accounts_options( END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); -#endif return true; } +#endif static bool setting_append_list_user_options( rarch_setting_t **list, @@ -6792,8 +6786,10 @@ rarch_setting_t *menu_setting_new(void) if (!setting_append_list_user_options(&list, list_info, root)) goto error; - if (!setting_append_list_accounts_options(&list, list_info, root)) +#ifdef HAVE_CHEEVOS + if (!setting_append_list_accounts_cheevos_options(&list, list_info, root)) goto error; +#endif if (!setting_append_list_directory_options(&list, list_info, root)) goto error;