This commit is contained in:
twinaphex 2018-09-23 22:16:31 +02:00
parent c9494a922b
commit e0f01fd85e
2 changed files with 20 additions and 25 deletions

View File

@ -1290,25 +1290,6 @@ 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,
@ -1488,12 +1469,6 @@ 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;
}

View File

@ -175,6 +175,16 @@ static int setting_action_ok_uint(void *data, bool wraparound)
return 0;
}
static void setting_get_string_representation_float_video_msg_color(void *data,
char *s, size_t len)
{
rarch_setting_t *setting = (rarch_setting_t*)data;
if (!setting)
return;
snprintf(s, len, "%d", (int)(*setting->value.target.fraction * 255.0f));
}
static void setting_get_string_representation_max_users(void *data,
char *s, size_t len)
{
@ -6293,6 +6303,8 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_float_video_msg_color;
menu_settings_list_current_add_range(list, list_info, 0, 1, 1.0f/255.0f, true, true);
CONFIG_FLOAT(
@ -6307,6 +6319,8 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_float_video_msg_color;
menu_settings_list_current_add_range(list, list_info, 0, 1, 1.0f/255.0f, true, true);
CONFIG_FLOAT(
@ -6321,6 +6335,8 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_float_video_msg_color;
menu_settings_list_current_add_range(list, list_info, 0, 1, 1.0f/255.0f, true, true);
CONFIG_BOOL(
@ -7016,6 +7032,8 @@ static bool setting_append_list(
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_float_video_msg_color;
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);
@ -7030,6 +7048,8 @@ static bool setting_append_list(
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_float_video_msg_color;
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
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);