From 59acce503572942ddc0b317da273b98dcb25f8fc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 12 Sep 2020 09:58:23 +0200 Subject: [PATCH] (RGUI) Make sure entry_value is correct --- menu/drivers/rgui.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 5b958c5b6f..8892078bb9 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -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); }