(Menu) Don't uppercase titles always
(GLUI) Show switch icons for certain text strings too
This commit is contained in:
parent
df01279cf3
commit
6b15d86c5c
|
@ -43,7 +43,7 @@ static INLINE void sanitize_to_string(char *s, const char *label, size_t len)
|
||||||
char new_label[PATH_MAX_LENGTH] = {0};
|
char new_label[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
strlcpy(new_label, label, sizeof(new_label));
|
strlcpy(new_label, label, sizeof(new_label));
|
||||||
strlcpy(s, string_to_upper(new_label), len);
|
strlcpy(s, new_label, len);
|
||||||
replace_chars(s, '_', ' ');
|
replace_chars(s, '_', ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,12 +285,12 @@ static int action_get_title_group_settings(const char *path, const char *label,
|
||||||
string_list_free(list_label);
|
string_list_free(list_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(s, string_to_upper(elem0), len);
|
strlcpy(s, elem0, len);
|
||||||
|
|
||||||
if (elem1[0] != '\0')
|
if (elem1[0] != '\0')
|
||||||
{
|
{
|
||||||
strlcat(s, " - ", len);
|
strlcat(s, " - ", len);
|
||||||
strlcat(s, string_to_upper(elem1), len);
|
strlcat(s, elem1, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -420,43 +420,43 @@ static int action_get_title_video_filter_directory(const char *path, const char
|
||||||
static int action_get_title_savefile_directory(const char *path, const char *label,
|
static int action_get_title_savefile_directory(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
return fill_title(s, "SAVEFILE DIR", path, len);
|
return fill_title(s, "Savefile Dir", path, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_overlay_directory(const char *path, const char *label,
|
static int action_get_title_overlay_directory(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
return fill_title(s, "OVERLAY DIR", path, len);
|
return fill_title(s, "OVERLAY_DIR", path, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_system_directory(const char *path, const char *label,
|
static int action_get_title_system_directory(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
return fill_title(s, "SYSTEM DIR", path, len);
|
return fill_title(s, "System Dir", path, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_assets_directory(const char *path, const char *label,
|
static int action_get_title_assets_directory(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
return fill_title(s, "ASSETS DIR", path, len);
|
return fill_title(s, "Assets Dir", path, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_extraction_directory(const char *path, const char *label,
|
static int action_get_title_extraction_directory(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
return fill_title(s, "CACHE DIR", path, len);
|
return fill_title(s, "Cache Dir", path, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_menu(const char *path, const char *label,
|
static int action_get_title_menu(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
return fill_title(s, "MENU", path, len);
|
return fill_title(s, "Menu", path, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_input_settings(const char *path, const char *label,
|
static int action_get_title_input_settings(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
strlcpy(s, "INPUT SETTINGS", len);
|
strlcpy(s, "Input Settings", len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -413,6 +413,24 @@ static void glui_render_label_value(glui_handle_t *glui, gl_t *gl,
|
||||||
|
|
||||||
hash_value = menu_hash_calculate(value);
|
hash_value = menu_hash_calculate(value);
|
||||||
|
|
||||||
|
if (!strcmp(value, "disabled") ||
|
||||||
|
!strcmp(value, "off"))
|
||||||
|
{
|
||||||
|
if (glui->textures.list[GLUI_TEXTURE_SWITCH_OFF].id)
|
||||||
|
texture_switch = glui->textures.list[GLUI_TEXTURE_SWITCH_OFF].id;
|
||||||
|
else
|
||||||
|
do_draw_text = true;
|
||||||
|
}
|
||||||
|
else if (!strcmp(value, "enabled") ||
|
||||||
|
!strcmp(value, "on"))
|
||||||
|
{
|
||||||
|
if (glui->textures.list[GLUI_TEXTURE_SWITCH_ON].id)
|
||||||
|
texture_switch = glui->textures.list[GLUI_TEXTURE_SWITCH_ON].id;
|
||||||
|
else
|
||||||
|
do_draw_text = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
switch (hash_value)
|
switch (hash_value)
|
||||||
{
|
{
|
||||||
case MENU_VALUE_COMP:
|
case MENU_VALUE_COMP:
|
||||||
|
@ -451,6 +469,7 @@ static void glui_render_label_value(glui_handle_t *glui, gl_t *gl,
|
||||||
do_draw_text = true;
|
do_draw_text = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (do_draw_text)
|
if (do_draw_text)
|
||||||
glui_blit_line(width - glui->margin, y, width, height, value_str, color, TEXT_ALIGN_RIGHT);
|
glui_blit_line(width - glui->margin, y, width, height, value_str, color, TEXT_ALIGN_RIGHT);
|
||||||
|
@ -665,10 +684,12 @@ static void glui_frame(void)
|
||||||
width, height,
|
width, height,
|
||||||
&shadow_bg[0]);
|
&shadow_bg[0]);
|
||||||
|
|
||||||
|
|
||||||
ticker_limit = (width - glui->margin*2) / glui->glyph_width -
|
ticker_limit = (width - glui->margin*2) / glui->glyph_width -
|
||||||
strlen(menu_hash_to_str(MENU_VALUE_BACK)) * 2;
|
strlen(menu_hash_to_str(MENU_VALUE_BACK)) * 2;
|
||||||
menu_animation_ticker_str(title_buf, ticker_limit,
|
menu_animation_ticker_str(title_buf, ticker_limit,
|
||||||
*frame_count / 100, title, true);
|
*frame_count / 100, title, true);
|
||||||
|
RARCH_LOG("title_msg: %s\n", title_buf);
|
||||||
glui_blit_line(width / 2, 0, width, height, title_buf,
|
glui_blit_line(width / 2, 0, width, height, title_buf,
|
||||||
title_color, TEXT_ALIGN_CENTER);
|
title_color, TEXT_ALIGN_CENTER);
|
||||||
|
|
||||||
|
|
|
@ -1338,6 +1338,24 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strcmp(entry.value, "disabled") ||
|
||||||
|
!strcmp(entry.value, "off"))
|
||||||
|
{
|
||||||
|
if (xmb->textures.list[XMB_TEXTURE_SWITCH_OFF].id)
|
||||||
|
texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_OFF].id;
|
||||||
|
else
|
||||||
|
do_draw_text = true;
|
||||||
|
}
|
||||||
|
else if (!strcmp(entry.value, "enabled") ||
|
||||||
|
!strcmp(entry.value, "on"))
|
||||||
|
{
|
||||||
|
if (xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id)
|
||||||
|
texture_switch = xmb->textures.list[XMB_TEXTURE_SWITCH_ON].id;
|
||||||
|
else
|
||||||
|
do_draw_text = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
switch (hash_value)
|
switch (hash_value)
|
||||||
{
|
{
|
||||||
case MENU_VALUE_COMP:
|
case MENU_VALUE_COMP:
|
||||||
|
@ -1376,6 +1394,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, gl_t *gl,
|
||||||
do_draw_text = true;
|
do_draw_text = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ticker_limit = 35;
|
ticker_limit = 35;
|
||||||
if (entry.value[0] == '\0')
|
if (entry.value[0] == '\0')
|
||||||
|
|
Loading…
Reference in New Issue