(RGUI) Make sure entry_value is correct

This commit is contained in:
twinaphex 2020-09-12 09:58:23 +02:00
parent d416974f52
commit 59acce5035

View File

@ -3816,6 +3816,7 @@ static void rgui_render(void *data,
char entry_title_buf[255];
char type_str_buf[255];
menu_entry_t entry;
const char *entry_value = NULL;
size_t entry_title_max_len = 0;
unsigned entry_value_len = 0;
enum rgui_entry_value_type entry_value_type = RGUI_ENTRY_VALUE_NONE;
@ -3836,6 +3837,11 @@ static void rgui_render(void *data,
entry.sublabel_enabled = false;
menu_entry_get(&entry, 0, (unsigned)i, NULL, true);
if (entry.enum_idx == MENU_ENUM_LABEL_CHEEVOS_PASSWORD)
entry_value = entry.password_value;
else
entry_value = entry.value;
/* Get base length of entry title field */
entry_title_max_len = rgui_term_layout.width - (1 + 2);
@ -3878,7 +3884,7 @@ static void rgui_render(void *data,
/* Get 'type' of entry value component */
entry_value_type = rgui_get_entry_value_type(
entry.value, entry.checked, rgui_switch_icons);
entry_value, entry.checked, rgui_switch_icons);
switch (entry_value_type)
{
@ -3887,7 +3893,7 @@ static void rgui_render(void *data,
* of value string */
if (rgui_full_width_layout)
{
entry_value_len = (unsigned)strlen(entry.value);
entry_value_len = (unsigned)strlen(entry_value);
entry_value_len = (entry_value_len
> rgui_term_layout.value_maxlen) ?
rgui_term_layout.value_maxlen :
@ -3959,7 +3965,7 @@ static void rgui_render(void *data,
if (use_smooth_ticker)
{
ticker_smooth.field_width = entry_value_len * FONT_WIDTH_STRIDE;
ticker_smooth.src_str = entry.value;
ticker_smooth.src_str = entry_value;
ticker_smooth.dst_str = type_str_buf;
ticker_smooth.dst_str_len = sizeof(type_str_buf);
ticker_smooth.x_offset = &ticker_x_offset;
@ -3970,7 +3976,7 @@ static void rgui_render(void *data,
{
ticker.s = type_str_buf;
ticker.len = entry_value_len;
ticker.str = entry.value;
ticker.str = entry_value;
gfx_animation_ticker(&ticker);
}