XMB: Current menu icon refactor (#18508)
Some checks failed
CI 3DS / build (push) Waiting to run
CI Android / build (push) Waiting to run
CI DOS/DJGPP / build (push) Waiting to run
CI Emscripten / build (push) Waiting to run
CI GameCube / build (push) Waiting to run
CI Linux (i686) / build (push) Waiting to run
CI Windows (MSVC) / msvc (Debug, x64, 2019) (push) Waiting to run
CI Windows (MSVC) / msvc (Debug, x64, 2022) (push) Waiting to run
CI Windows (MSVC) / msvc (Release, x64, 2019) (push) Waiting to run
CI Windows (MSVC) / msvc (Release, x64, 2022) (push) Waiting to run
CI Windows (MSVC) / msvc (Release, x64, UWP) (push) Waiting to run
CI Windows (MSVC) / msvc (ReleaseAngle, x64, UWP) (push) Waiting to run
CI Windows (MSYS2) / msys2-build-test (CLANG64) (push) Waiting to run
CI Windows (MSYS2) / msys2-build-test (MINGW64) (push) Waiting to run
CI Windows (MSYS2) / msys2-build-test (UCRT64) (push) Waiting to run
CI macOS / build (push) Waiting to run
CI Miyoo ARM32 / build (push) Waiting to run
CI PS2 / build (push) Waiting to run
CI PS3/PSL1GHT / build (push) Waiting to run
CI PS4/ORBIS / build (push) Waiting to run
CI PSP / build (push) Waiting to run
CI PSVita / build (push) Waiting to run
CI RS90 Odbeta MIPS32 / build (push) Waiting to run
CI RetroFW MIPS32 / build (push) Waiting to run
CI Switch/libnx / build (push) Waiting to run
CI Wii / build (push) Waiting to run
CI WiiU / build (push) Waiting to run
CI Windows i686 (MXE) / build (push) Waiting to run
CI Windows x64 (MXE) / build (push) Waiting to run
RetroArch CI / linux-c89 (push) Waiting to run
CI webOS / build (push) Waiting to run
Crowdin Workflow / sync (push) Has been cancelled

This commit is contained in:
sonninnos 2025-12-13 15:01:41 +02:00 committed by GitHub
parent 11cd891eaf
commit 0be544b82d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 741 additions and 598 deletions

View File

@ -843,7 +843,8 @@
#define DEFAULT_XMB_VERTICAL_FADE_FACTOR 100
#define DEFAULT_XMB_SHOW_TITLE_HEADER true
#define DEFAULT_XMB_SWITCH_ICONS true
#define DEFAULT_XMB_TITLE_MARGIN 5
#define DEFAULT_XMB_CURRENT_MENU_ICON 1
#define DEFAULT_XMB_TITLE_MARGIN 3
#define DEFAULT_XMB_TITLE_MARGIN_HORIZONTAL_OFFSET 0
#define MAXIMUM_XMB_TITLE_MARGIN 12
#define DEFAULT_XMB_ALPHA_FACTOR 90

View File

@ -2448,6 +2448,7 @@ static struct config_uint_setting *populate_settings_uint(
SETTING_UINT("menu_xmb_thumbnail_scale_factor", &settings->uints.menu_xmb_thumbnail_scale_factor, true, DEFAULT_XMB_THUMBNAIL_SCALE_FACTOR, false);
SETTING_UINT("menu_xmb_vertical_fade_factor", &settings->uints.menu_xmb_vertical_fade_factor, true, DEFAULT_XMB_VERTICAL_FADE_FACTOR, false);
SETTING_UINT("xmb_alpha_factor", &settings->uints.menu_xmb_alpha_factor, true, DEFAULT_XMB_ALPHA_FACTOR, false);
SETTING_UINT("xmb_current_menu_icon", &settings->uints.menu_xmb_current_menu_icon, true, DEFAULT_XMB_CURRENT_MENU_ICON, false);
SETTING_UINT("xmb_layout", &settings->uints.menu_xmb_layout, true, DEFAULT_XMB_MENU_LAYOUT, false);
SETTING_UINT("xmb_theme", &settings->uints.menu_xmb_theme, true, DEFAULT_XMB_ICON_THEME, false);
SETTING_UINT("xmb_menu_color_theme", &settings->uints.menu_xmb_color_theme, true, DEFAULT_XMB_THEME, false);

View File

@ -304,6 +304,7 @@ typedef struct settings
unsigned menu_xmb_layout;
unsigned menu_xmb_shader_pipeline;
unsigned menu_xmb_alpha_factor;
unsigned menu_xmb_current_menu_icon;
unsigned menu_xmb_theme;
unsigned menu_xmb_color_theme;
unsigned menu_xmb_thumbnail_scale_factor;

View File

@ -1194,7 +1194,7 @@ MSG_HASH(
#endif
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST,
"core_updater"
"deferred_core_updater_list"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST,

View File

@ -12203,6 +12203,26 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Color Theme Alpha Factor"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON,
"Current Menu Icon"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_XMB_CURRENT_MENU_ICON,
"Current menu icon can be hidden, under the horizontal menu or in header title."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_NONE,
"None"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_NORMAL,
"Normal"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_TITLE,
"Title"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Font"

View File

@ -1109,6 +1109,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_disk_options,
#ifdef HAVE_XMB
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_layout, MENU_ENUM_SUBLABEL_XMB_LAYOUT)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_icon_theme, MENU_ENUM_SUBLABEL_XMB_THEME)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_current_menu_icon, MENU_ENUM_SUBLABEL_XMB_CURRENT_MENU_ICON)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_switch_icons, MENU_ENUM_SUBLABEL_XMB_SWITCH_ICONS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_shadows_enable, MENU_ENUM_SUBLABEL_XMB_SHADOWS_ENABLE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_xmb_vertical_thumbnails, MENU_ENUM_SUBLABEL_XMB_VERTICAL_THUMBNAILS)
@ -3373,6 +3374,11 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_XMB_THEME:
#ifdef HAVE_XMB
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_xmb_icon_theme);
#endif
break;
case MENU_ENUM_LABEL_XMB_CURRENT_MENU_ICON:
#ifdef HAVE_XMB
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_xmb_current_menu_icon);
#endif
break;
case MENU_ENUM_LABEL_XMB_SWITCH_ICONS:

File diff suppressed because it is too large Load Diff

View File

@ -352,6 +352,14 @@ enum xmb_icon_theme
XMB_ICON_THEME_LAST
};
enum xmb_current_menu_icon
{
XMB_CURRENT_MENU_ICON_NONE = 0,
XMB_CURRENT_MENU_ICON_NORMAL,
XMB_CURRENT_MENU_ICON_TITLE,
XMB_CURRENT_MENU_ICON_LAST
};
enum xmb_shader_pipeline
{
#ifndef HAVE_PSGL

View File

@ -11868,6 +11868,7 @@ unsigned menu_displaylist_build_list(
{MENU_ENUM_LABEL_XMB_SWITCH_ICONS, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_MENU_RGUI_SWITCH_ICONS, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_MATERIALUI_SWITCH_ICONS, PARSE_ONLY_BOOL, true},
{MENU_ENUM_LABEL_XMB_CURRENT_MENU_ICON, PARSE_ONLY_UINT, true},
{MENU_ENUM_LABEL_OZONE_HEADER_ICON, PARSE_ONLY_UINT, true},
{MENU_ENUM_LABEL_OZONE_HEADER_SEPARATOR, PARSE_ONLY_UINT, true},
{MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR, PARSE_ONLY_BOOL, true},

View File

@ -4119,6 +4119,28 @@ static size_t setting_get_string_representation_uint_rgui_particle_effect(
return 0;
}
static size_t setting_get_string_representation_uint_menu_ticker_type(
rarch_setting_t *setting, char *s, size_t len)
{
if (setting)
{
switch (*setting->value.target.unsigned_integer)
{
case TICKER_TYPE_BOUNCE:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MENU_TICKER_TYPE_BOUNCE),
len);
case TICKER_TYPE_LOOP:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MENU_TICKER_TYPE_LOOP),
len);
}
}
return 0;
}
#ifdef HAVE_XMB
static size_t setting_get_string_representation_uint_menu_xmb_animation_move_up_down(
rarch_setting_t *setting, char *s, size_t len)
@ -4175,31 +4197,7 @@ static size_t setting_get_string_representation_uint_menu_xmb_animation_horizont
}
return 0;
}
#endif
static size_t setting_get_string_representation_uint_menu_ticker_type(
rarch_setting_t *setting, char *s, size_t len)
{
if (setting)
{
switch (*setting->value.target.unsigned_integer)
{
case TICKER_TYPE_BOUNCE:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MENU_TICKER_TYPE_BOUNCE),
len);
case TICKER_TYPE_LOOP:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_MENU_TICKER_TYPE_LOOP),
len);
}
}
return 0;
}
#ifdef HAVE_XMB
static size_t setting_get_string_representation_uint_xmb_icon_theme(
rarch_setting_t *setting, char *s, size_t len)
{
@ -4387,6 +4385,73 @@ static size_t setting_get_string_representation_uint_xmb_menu_color_theme(
}
return 0;
}
static size_t setting_get_string_representation_uint_xmb_current_menu_icon(
rarch_setting_t *setting, char *s, size_t len)
{
if (setting)
{
switch (*setting->value.target.unsigned_integer)
{
case 0:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_NONE), len);
case 2:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_TITLE), len);
case 1:
default:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_NORMAL), len);
}
}
return 0;
}
#endif
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
#if defined(HAVE_XMB) && defined(HAVE_SHADERPIPELINE)
static size_t setting_get_string_representation_uint_xmb_shader_pipeline(
rarch_setting_t *setting, char *s, size_t len)
{
if (setting)
{
switch (*setting->value.target.unsigned_integer)
{
case XMB_SHADER_PIPELINE_WALLPAPER:
return strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
case XMB_SHADER_PIPELINE_SIMPLE_RIBBON:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON_SIMPLIFIED), len);
case XMB_SHADER_PIPELINE_RIBBON:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON), len);
case XMB_SHADER_PIPELINE_SIMPLE_SNOW:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SIMPLE_SNOW), len);
case XMB_SHADER_PIPELINE_SNOW:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SNOW), len);
case XMB_SHADER_PIPELINE_BOKEH:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH), len);
case XMB_SHADER_PIPELINE_SNOWFLAKE:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SNOWFLAKE), len);
}
}
return 0;
}
#endif
#endif
#ifdef HAVE_MATERIALUI
@ -4767,47 +4832,6 @@ static size_t setting_get_string_representation_uint_ozone_font_scale(
}
#endif
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
#if defined(HAVE_XMB) && defined(HAVE_SHADERPIPELINE)
static size_t setting_get_string_representation_uint_xmb_shader_pipeline(
rarch_setting_t *setting, char *s, size_t len)
{
if (setting)
{
switch (*setting->value.target.unsigned_integer)
{
case XMB_SHADER_PIPELINE_WALLPAPER:
return strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF), len);
case XMB_SHADER_PIPELINE_SIMPLE_RIBBON:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON_SIMPLIFIED), len);
case XMB_SHADER_PIPELINE_RIBBON:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_RIBBON), len);
case XMB_SHADER_PIPELINE_SIMPLE_SNOW:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SIMPLE_SNOW), len);
case XMB_SHADER_PIPELINE_SNOW:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SNOW), len);
case XMB_SHADER_PIPELINE_BOKEH:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_BOKEH), len);
case XMB_SHADER_PIPELINE_SNOWFLAKE:
return strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_SHADER_PIPELINE_SNOWFLAKE), len);
}
}
return 0;
}
#endif
#endif
#ifdef HAVE_SCREENSHOTS
#ifdef HAVE_GFX_WIDGETS
@ -18968,6 +18992,24 @@ static bool setting_append_list(
(*list)[list_info->index - 1].action_right = &setting_uint_action_right_with_refresh;
menu_settings_list_current_add_range(list, list_info, 0, 500, 1, true, true);
CONFIG_UINT(
list, list_info,
&settings->uints.menu_xmb_current_menu_icon,
MENU_ENUM_LABEL_XMB_CURRENT_MENU_ICON,
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON,
DEFAULT_XMB_CURRENT_MENU_ICON,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].action_left = &setting_uint_action_left_with_refresh;
(*list)[list_info->index - 1].action_right = &setting_uint_action_right_with_refresh;
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_uint_xmb_current_menu_icon;
menu_settings_list_current_add_range(list, list_info, 0, XMB_CURRENT_MENU_ICON_LAST-1, 1, true, true);
CONFIG_BOOL(
list, list_info,
&settings->bools.menu_xmb_show_title_header,
@ -20128,7 +20170,9 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].action_left = &setting_uint_action_left_with_refresh;
(*list)[list_info->index - 1].action_right = &setting_uint_action_right_with_refresh;
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_uint_ozone_header_icon;
menu_settings_list_current_add_range(list, list_info, 0, OZONE_HEADER_ICON_LAST-1, 1, true, true);

View File

@ -800,6 +800,10 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_GRAY_DARK,
MENU_ENUM_LABEL_VALUE_XMB_MENU_COLOR_THEME_GRAY_LIGHT,
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_NONE,
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_NORMAL,
MENU_ENUM_LABEL_VALUE_XMB_CURRENT_MENU_ICON_TITLE,
MENU_LABEL(SHADER_PIPELINE_RIBBON_SIMPLIFIED),
MENU_LABEL(SHADER_PIPELINE_RIBBON),
MENU_LABEL(SHADER_PIPELINE_SIMPLE_SNOW),
@ -1612,6 +1616,7 @@ enum msg_hash_enums
MENU_LABEL(SHOW_ADVANCED_SETTINGS),
MENU_LABEL(THREADED_DATA_RUNLOOP_ENABLE),
MENU_LABEL(XMB_ALPHA_FACTOR),
MENU_LABEL(XMB_CURRENT_MENU_ICON),
MENU_LABEL(MENU_FONT_COLOR_RED),
MENU_LABEL(MENU_FONT_COLOR_GREEN),
MENU_LABEL(MENU_FONT_COLOR_BLUE),