From b7654dac7e75a51f5fd88babf0afe0a8bea8d8ad Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Mon, 9 Oct 2017 10:30:25 +0200 Subject: [PATCH] Implemented setting for showing/hiding the "Shaders" option in the Quick Menu. --- config.def.h | 1 + configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/menu_displaylist.c | 18 +++++++++++++----- menu/menu_setting.c | 17 +++++++++++++++++ msg_hash.h | 1 + 22 files changed, 98 insertions(+), 5 deletions(-) diff --git a/config.def.h b/config.def.h index aa8b126937..b46cc3b9bc 100644 --- a/config.def.h +++ b/config.def.h @@ -243,6 +243,7 @@ static bool quick_menu_show_add_to_favorites = true; static bool quick_menu_show_options = true; static bool quick_menu_show_controls = true; static bool quick_menu_show_cheats = true; +static bool quick_menu_show_shaders = true; static bool menu_show_online_updater = true; diff --git a/configuration.c b/configuration.c index bcc10275ef..70e90dc143 100644 --- a/configuration.c +++ b/configuration.c @@ -1198,6 +1198,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("quick_menu_show_options", &settings->bools.quick_menu_show_options, true, quick_menu_show_options, false); SETTING_BOOL("quick_menu_show_controls", &settings->bools.quick_menu_show_controls, true, quick_menu_show_controls, false); SETTING_BOOL("quick_menu_show_cheats", &settings->bools.quick_menu_show_cheats, true, quick_menu_show_cheats, false); + SETTING_BOOL("quick_menu_show_shaders", &settings->bools.quick_menu_show_shaders, true, quick_menu_show_shaders, false); #ifdef HAVE_MATERIALUI SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, materialui_icons_enable, false); #endif diff --git a/configuration.h b/configuration.h index caa71a4a0c..733fea6912 100644 --- a/configuration.h +++ b/configuration.h @@ -145,6 +145,7 @@ typedef struct settings bool quick_menu_show_options; bool quick_menu_show_controls; bool quick_menu_show_cheats; + bool quick_menu_show_shaders; /* Netplay */ bool netplay_public_announce; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 585a75b677..64731bce7b 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3095,3 +3095,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index a34364c2bb..ab74e64961 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3095,3 +3095,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 7597cdfaf9..4a98160856 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3089,3 +3089,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index f4dff1dcf5..8b4786a641 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2958,3 +2958,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index f2bafa0b80..4a0e7876d4 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3127,3 +3127,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index b2a28dcfd5..182180d98a 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3181,3 +3181,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 2036449811..c806e4c6ee 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3097,3 +3097,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 320a01d2e1..bea2016f20 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3090,3 +3090,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 5ffe91b4ce..83352e9fe8 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1321,3 +1321,5 @@ MSG_HASH(MENU_ENUM_LABEL_QUICK_MENU_SHOW_CONTROLS, "quick_menu_show_controls") MSG_HASH(MENU_ENUM_LABEL_QUICK_MENU_SHOW_CHEATS, "quick_menu_show_cheats") +MSG_HASH(MENU_ENUM_LABEL_QUICK_MENU_SHOW_SHADERS, + "quick_menu_show_shaders") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 5d94f43416..9196317a3e 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2958,3 +2958,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index 7f3168541a..165d3949fc 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4036,3 +4036,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 2ccfb9a83e..06608c6ea3 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3065,3 +3065,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 6dbb12b19a..c9481f6599 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3148,3 +3148,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index f0620b1420..32ab61d581 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3183,3 +3183,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 9a5286fa45..38e275b317 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3119,3 +3119,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_CHEATS, "Show Cheats") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS, "Show/hide the 'Cheats' option.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + "Show Shaders") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS, + "Show/hide the 'Shaders' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index eb8f44e005..1be70b0476 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -297,6 +297,7 @@ default_sublabel_macro(action_bind_sublabel_quick_menu_show_add_to_favorites, default_sublabel_macro(action_bind_sublabel_quick_menu_show_options, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_OPTIONS) default_sublabel_macro(action_bind_sublabel_quick_menu_show_controls, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CONTROLS) default_sublabel_macro(action_bind_sublabel_quick_menu_show_cheats, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_CHEATS) +default_sublabel_macro(action_bind_sublabel_quick_menu_show_shaders, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SHADERS) default_sublabel_macro(action_bind_sublabel_menu_favorites_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_FAVORITES) default_sublabel_macro(action_bind_sublabel_menu_images_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_IMAGES) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) @@ -620,6 +621,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_QUICK_MENU_SHOW_CHEATS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_cheats); break; + case MENU_ENUM_LABEL_QUICK_MENU_SHOW_SHADERS: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_shaders); + break; case MENU_ENUM_LABEL_XMB_SHOW_FAVORITES: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_favorites_tab); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index e39f0c99a8..cbd8ff161b 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2936,11 +2936,14 @@ static int menu_displaylist_parse_load_content_settings( MENU_SETTING_ACTION_CORE_DISK_OPTIONS, 0, 0); #ifdef HAVE_SHADER_MANAGER - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS), - msg_hash_to_str(MENU_ENUM_LABEL_SHADER_OPTIONS), - MENU_ENUM_LABEL_SHADER_OPTIONS, - MENU_SETTING_ACTION, 0, 0); + if (settings->bools.quick_menu_show_shaders) + { + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS), + msg_hash_to_str(MENU_ENUM_LABEL_SHADER_OPTIONS), + MENU_ENUM_LABEL_SHADER_OPTIONS, + MENU_SETTING_ACTION, 0, 0); + } #endif #ifdef HAVE_LAKKA @@ -5398,6 +5401,11 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_QUICK_MENU_SHOW_CHEATS, PARSE_ONLY_BOOL, false); +#ifdef HAVE_SHADER_MANAGER + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_QUICK_MENU_SHOW_SHADERS, + PARSE_ONLY_BOOL, false); +#endif info->need_refresh = true; info->need_push = true; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 0777c8c368..ff1d48c4f5 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5941,6 +5941,23 @@ static bool setting_append_list( general_read_handler, SD_FLAG_LAKKA_ADVANCED); +#ifdef HAVE_SHADER_MANAGER + CONFIG_BOOL( + list, list_info, + &settings->bools.quick_menu_show_shaders, + MENU_ENUM_LABEL_QUICK_MENU_SHOW_SHADERS, + MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_SHADERS, + quick_menu_show_shaders, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); +#endif + if (string_is_not_equal_fast(ui_companion_driver_get_ident(), "null", 4)) { CONFIG_BOOL( diff --git a/msg_hash.h b/msg_hash.h index ed12fa4680..ffba51ce63 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -716,6 +716,7 @@ enum msg_hash_enums MENU_LABEL(QUICK_MENU_SHOW_OPTIONS), MENU_LABEL(QUICK_MENU_SHOW_CONTROLS), MENU_LABEL(QUICK_MENU_SHOW_CHEATS), + MENU_LABEL(QUICK_MENU_SHOW_SHADERS), /* UI settings */ MENU_LABEL(VIDEO_DISABLE_COMPOSITION),