From 693bb84084417b909e823a93688a9dd1fa71b256 Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 19 May 2018 13:18:38 +0200 Subject: [PATCH] Fix show current and default values in config dialog (#3961) --- frontend/ui/data/creoptions.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/ui/data/creoptions.lua b/frontend/ui/data/creoptions.lua index ec8b38b99..409a30a87 100644 --- a/frontend/ui/data/creoptions.lua +++ b/frontend/ui/data/creoptions.lua @@ -38,7 +38,7 @@ local function showValues(configurable, option) end if not default then default = "not set" - if option.toggle then + if option.toggle and option.values then value_current = current current = arg_table[current] end @@ -48,6 +48,20 @@ local function showValues(configurable, option) default = arg_table[default] current = arg_table[current] end + if option.labels and option.values then + for i=1,#option.labels do + if default == option.values[i] then + default = option.labels[i] + break + end + end + for i=1,#option.labels do + if current == option.values[i] then + current = option.labels[i] + break + end + end + end if option.name_text_true_values and option.toggle and option.values and value_default then UIManager:show(InfoMessage:new{ text = T(_("%1:\nCurrent value: %2 (%5%4)\nDefault value: %3 (%6%4)"), option.name_text,