mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 02:38:11 +00:00
add menu settings for OSD text color
This commit is contained in:
parent
01f8e4e74f
commit
256bde3478
@ -3171,4 +3171,9 @@ MSG_HASH(MSG_INPUT_KIOSK_MODE_PASSWORD_OK,
|
||||
"Password correct.")
|
||||
MSG_HASH(MSG_INPUT_KIOSK_MODE_PASSWORD_NOK,
|
||||
"Password incorrect.")
|
||||
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_RED,
|
||||
"OSDメッセージの赤色値")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_GREEN,
|
||||
"OSDメッセージの緑色値")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_BLUE,
|
||||
"OSDメッセージの青色値")
|
||||
|
@ -1359,4 +1359,9 @@ MSG_HASH(MENU_ENUM_LABEL_VIDEO_MESSAGE_BGCOLOR_BLUE,
|
||||
"video_msg_bgcolor_blue")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_MESSAGE_BGCOLOR_OPACITY,
|
||||
"video_msg_bgcolor_opacity")
|
||||
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_RED,
|
||||
"video_msg_color_red")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_GREEN,
|
||||
"video_msg_color_green")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_BLUE,
|
||||
"video_msg_color_blue")
|
||||
|
@ -2011,6 +2011,18 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
snprintf(s, len,
|
||||
"Sets the opacity of the OSD background color. Valid values are between 0.0 and 1.0.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_RED:
|
||||
snprintf(s, len,
|
||||
"Sets the red value of the OSD text color. Valid values are between 0 and 255.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_GREEN:
|
||||
snprintf(s, len,
|
||||
"Sets the green value of the OSD text color. Valid values are between 0 and 255.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_BLUE:
|
||||
snprintf(s, len,
|
||||
"Sets the blue value of the OSD text color. Valid values are between 0 and 255.");
|
||||
break;
|
||||
default:
|
||||
if (string_is_empty(s))
|
||||
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE), len);
|
||||
|
@ -3255,3 +3255,9 @@ MSG_HASH(MSG_INPUT_KIOSK_MODE_PASSWORD_OK,
|
||||
"Password correct.")
|
||||
MSG_HASH(MSG_INPUT_KIOSK_MODE_PASSWORD_NOK,
|
||||
"Password incorrect.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_RED,
|
||||
"Onscreen Notification Red Color")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_GREEN,
|
||||
"Onscreen Notification Green Color")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_BLUE,
|
||||
"Onscreen Notification Blue Color")
|
||||
|
@ -1517,6 +1517,25 @@ static void menu_action_setting_disp_set_label_no_items(
|
||||
strlcpy(s2, path, len2);
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_video_msg_color(
|
||||
file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
const char *label,
|
||||
char *s, size_t len,
|
||||
const char *entry_label,
|
||||
const char *path,
|
||||
char *s2, size_t len2)
|
||||
{
|
||||
rarch_setting_t *setting = menu_setting_find(list->list[i].label);
|
||||
|
||||
if (!setting)
|
||||
return;
|
||||
|
||||
*w = 19;
|
||||
|
||||
snprintf(s, len, "%d", (int)(*setting->value.target.fraction * 255.0f));
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label(file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
const char *label,
|
||||
@ -1722,6 +1741,12 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_menu_more);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_RED:
|
||||
case MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_GREEN:
|
||||
case MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_BLUE:
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_video_msg_color);
|
||||
break;
|
||||
default:
|
||||
return - 1;
|
||||
}
|
||||
|
@ -5256,6 +5256,15 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_POS_Y,
|
||||
PARSE_ONLY_FLOAT, false);
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_RED,
|
||||
PARSE_ONLY_FLOAT, false);
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_GREEN,
|
||||
PARSE_ONLY_FLOAT, false);
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_BLUE,
|
||||
PARSE_ONLY_FLOAT, false);
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_BGCOLOR_ENABLE,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
|
@ -4840,6 +4840,48 @@ static bool setting_append_list(
|
||||
general_read_handler);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 0.01, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.video_msg_color_r,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_RED,
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_RED,
|
||||
((message_color >> 16) & 0xff) / 255.0f,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 1.0f/255.0f, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.video_msg_color_g,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_GREEN,
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_GREEN,
|
||||
((message_color >> 8) & 0xff) / 255.0f,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 1.0f/255.0f, true, true);
|
||||
|
||||
CONFIG_FLOAT(
|
||||
list, list_info,
|
||||
&settings->floats.video_msg_color_b,
|
||||
MENU_ENUM_LABEL_VIDEO_MESSAGE_COLOR_BLUE,
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_COLOR_BLUE,
|
||||
((message_color >> 0) & 0xff) / 255.0f,
|
||||
"%.3f",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 1, 1.0f/255.0f, true, true);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.video_msg_bgcolor_enable,
|
||||
|
@ -628,6 +628,9 @@ enum msg_hash_enums
|
||||
MENU_LABEL(VIDEO_FONT_SIZE),
|
||||
MENU_LABEL(VIDEO_MESSAGE_POS_X),
|
||||
MENU_LABEL(VIDEO_MESSAGE_POS_Y),
|
||||
MENU_LABEL(VIDEO_MESSAGE_COLOR_RED),
|
||||
MENU_LABEL(VIDEO_MESSAGE_COLOR_GREEN),
|
||||
MENU_LABEL(VIDEO_MESSAGE_COLOR_BLUE),
|
||||
MENU_LABEL(VIDEO_MESSAGE_BGCOLOR_ENABLE),
|
||||
MENU_LABEL(VIDEO_MESSAGE_BGCOLOR_RED),
|
||||
MENU_LABEL(VIDEO_MESSAGE_BGCOLOR_GREEN),
|
||||
|
Loading…
Reference in New Issue
Block a user