Merge pull request #5972 from RobLoach/xmb-font-color

Menu: Allow changing Font Color
This commit is contained in:
Twinaphex 2017-12-28 01:44:05 +01:00 committed by GitHub
commit 073954c561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 154 additions and 8 deletions

View File

@ -273,6 +273,9 @@ static bool menu_show_core_updater = true;
#ifdef HAVE_XMB
static unsigned xmb_scale_factor = 100;
static unsigned xmb_alpha_factor = 75;
static unsigned menu_font_color_red = 255;
static unsigned menu_font_color_green = 255;
static unsigned menu_font_color_blue = 255;
static unsigned xmb_icon_theme = XMB_ICON_THEME_MONOCHROME;
static unsigned xmb_theme = XMB_THEME_ELECTRIC_BLUE;
#ifdef HAVE_LAKKA

View File

@ -1412,6 +1412,9 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("xmb_scale_factor", &settings->uints.menu_xmb_scale_factor, true, xmb_scale_factor, false);
SETTING_UINT("xmb_theme", &settings->uints.menu_xmb_theme, true, xmb_icon_theme, false);
SETTING_UINT("xmb_menu_color_theme", &settings->uints.menu_xmb_color_theme, true, xmb_theme, false);
SETTING_UINT("menu_font_color_red", &settings->uints.menu_font_color_red, true, menu_font_color_red, false);
SETTING_UINT("menu_font_color_green", &settings->uints.menu_font_color_green, true, menu_font_color_green, false);
SETTING_UINT("menu_font_color_blue", &settings->uints.menu_font_color_blue, true, menu_font_color_blue, false);
#endif
SETTING_UINT("materialui_menu_color_theme", &settings->uints.menu_materialui_color_theme, true, MATERIALUI_THEME_BLUE, false);
SETTING_UINT("menu_shader_pipeline", &settings->uints.menu_xmb_shader_pipeline, true, menu_shader_pipeline, false);
@ -1442,7 +1445,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("video_msg_bgcolor_red", &settings->uints.video_msg_bgcolor_red, true, message_bgcolor_red, false);
SETTING_UINT("video_msg_bgcolor_green", &settings->uints.video_msg_bgcolor_green, true, message_bgcolor_green, false);
SETTING_UINT("video_msg_bgcolor_blue", &settings->uints.video_msg_bgcolor_blue, true, message_bgcolor_blue, false);
*size = count;
return tmp;
@ -2483,7 +2486,7 @@ static bool config_load_file(const char *path, bool set_defaults,
snprintf(buf, sizeof(buf), "led%u_map", i + 1);
CONFIG_GET_INT_BASE(conf, settings, uints.led_map[i], buf);
}
{
/* ugly hack around C89 not allowing mixing declarations and code */
int buffer_size = 0;

View File

@ -352,6 +352,9 @@ typedef struct settings
unsigned menu_xmb_theme;
unsigned menu_xmb_color_theme;
unsigned menu_materialui_color_theme;
unsigned menu_font_color_red;
unsigned menu_font_color_green;
unsigned menu_font_color_blue;
unsigned camera_width;
unsigned camera_height;

View File

@ -1,4 +1,4 @@
MSG_HASH(
MSG_HASH(
MSG_COMPILER,
"编译器"
)
@ -1698,6 +1698,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"菜单透明度因子")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"菜单字体")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1749,6 +1749,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"WLAN")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Menü-Transparenz")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Menü-Schriftart")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1594,6 +1594,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Menu Alpha Factor")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Menu Font")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -2315,6 +2315,12 @@ const char *msg_hash_to_str_es(enum msg_hash_enums msg)
return "Pantalla completa en ventana";
case MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR:
return "Transparencia del XMB";
case MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED:
return "Fuente del XMB Red";
case MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN:
return "Fuente del XMB Green";
case MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE:
return "Fuente del XMB Blue";
case MENU_ENUM_LABEL_VALUE_XMB_FONT:
return "Fuente del XMB";
case MENU_ENUM_LABEL_VALUE_XMB_SCALE_FACTOR:

View File

@ -1719,6 +1719,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Transparence du fond")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Police du menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1747,6 +1747,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Menu del fattore Alfa")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Font del Menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1,4 +1,4 @@
#if defined(_MSC_VER) && !defined(_XBOX)
#if defined(_MSC_VER) && !defined(_XBOX)
/* https://support.microsoft.com/en-us/kb/980263 */
#pragma execution_character_set("utf-8")
#endif
@ -1773,6 +1773,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"メニューの透明性")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"メニューのフォント")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1,4 +1,4 @@
MSG_HASH(
MSG_HASH(
MSG_COMPILER,
"컴파일러"
)
@ -1695,6 +1695,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"메뉴 알파 요소")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"메뉴 폰트")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1161,6 +1161,12 @@ MSG_HASH(MENU_ENUM_LABEL_WIFI_SETTINGS,
"wifi_settings")
MSG_HASH(MENU_ENUM_LABEL_XMB_ALPHA_FACTOR,
"xmb_alpha_factor")
MSG_HASH(MENU_ENUM_LABEL_MENU_FONT_COLOR_RED,
"menu_font_color_red")
MSG_HASH(MENU_ENUM_LABEL_MENU_FONT_COLOR_GREEN,
"menu_font_color_green")
MSG_HASH(MENU_ENUM_LABEL_MENU_FONT_COLOR_BLUE,
"menu_font_color_blue")
MSG_HASH(MENU_ENUM_LABEL_XMB_FONT,
"xmb_font")
MSG_HASH(MENU_ENUM_LABEL_XMB_MAIN_MENU_ENABLE_SETTINGS,

View File

@ -1592,6 +1592,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Menu Alpha Factor")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Menu Font")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1687,6 +1687,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Fator Alfa do Menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Fonte do Menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1,4 +1,4 @@
#if defined(_MSC_VER) && !defined(_XBOX)
#if defined(_MSC_VER) && !defined(_XBOX)
/* https://support.microsoft.com/en-us/kb/980263 */
#pragma execution_character_set("utf-8")
#endif
@ -1728,6 +1728,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Меню Alpha Factor")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Шрифт")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1761,6 +1761,12 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS,
"Wi-Fi")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ALPHA_FACTOR,
"Menu Alpha Factor")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
"Menu Font Red Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
"Menu Font Green Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
"Menu Font Blue Color")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_FONT,
"Menu Font")
MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_ICON_THEME_CUSTOM,

View File

@ -1,4 +1,4 @@
/* RetroArch - A frontend for libretro.
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2016-2017 - Brad Parker
*

View File

@ -730,6 +730,7 @@ static void xmb_draw_text(
{
uint32_t color;
uint8_t a8;
settings_t *settings;
if (alpha > xmb->alpha)
alpha = xmb->alpha;
@ -740,7 +741,11 @@ static void xmb_draw_text(
if (a8 == 0)
return;
color = FONT_COLOR_RGBA(255, 255, 255, a8);
settings = config_get_ptr();
color = FONT_COLOR_RGBA(
settings->uints.menu_font_color_red,
settings->uints.menu_font_color_green,
settings->uints.menu_font_color_blue, a8);
menu_display_draw_text(font, str, x, y,
width, height, color, text_align, scale_factor,

View File

@ -5266,6 +5266,15 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_XMB_FONT,
PARSE_ONLY_PATH, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_FONT_COLOR_RED,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_FONT_COLOR_GREEN,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_MENU_FONT_COLOR_BLUE,
PARSE_ONLY_UINT, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_XMB_THEME,
PARSE_ONLY_UINT, false);

View File

@ -5535,6 +5535,48 @@ static bool setting_append_list(
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_REINIT);
CONFIG_UINT(
list, list_info,
&settings->uints.menu_font_color_red,
MENU_ENUM_LABEL_MENU_FONT_COLOR_RED,
MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_RED,
menu_font_color_red,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, 0, 255, 1, true, true);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_UINT(
list, list_info,
&settings->uints.menu_font_color_green,
MENU_ENUM_LABEL_MENU_FONT_COLOR_GREEN,
MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_GREEN,
menu_font_color_green,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, 0, 255, 1, true, true);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_UINT(
list, list_info,
&settings->uints.menu_font_color_blue,
MENU_ENUM_LABEL_MENU_FONT_COLOR_BLUE,
MENU_ENUM_LABEL_VALUE_MENU_FONT_COLOR_BLUE,
menu_font_color_blue,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, 0, 255, 1, true, true);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED);
CONFIG_UINT(
list, list_info,
&settings->uints.menu_xmb_theme,

View File

@ -740,6 +740,9 @@ enum msg_hash_enums
MENU_LABEL(ENTRY_HOVER_COLOR),
MENU_LABEL(XMB_ALPHA_FACTOR),
MENU_LABEL(XMB_SCALE_FACTOR),
MENU_LABEL(MENU_FONT_COLOR_RED),
MENU_LABEL(MENU_FONT_COLOR_GREEN),
MENU_LABEL(MENU_FONT_COLOR_BLUE),
MENU_LABEL(XMB_FONT),
MENU_LABEL(XMB_THEME),
MENU_LABEL(XMB_MAIN_MENU_ENABLE_SETTINGS),