Dispatcher: fix dynamically built menu (#10080)

Applicable for Set font and Set highlight action actions.
Closes #10077.
reviewable/pr10086/r1
hius07 1 year ago committed by GitHub
parent c5997a6246
commit 3881899338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -529,6 +529,9 @@ function Dispatcher:getNameFromItem(item, settings, dont_show_value)
if type(value) == "table" then
display_value = string.format("%d / %d", unpack(value))
else
if not settingsList[item].args and settingsList[item].args_func then
settingsList[item].args, settingsList[item].toggle = settingsList[item].args_func()
end
local value_num = util.arrayContains(settingsList[item].args, value)
display_value = settingsList[item].toggle[value_num]
end
@ -770,7 +773,7 @@ function Dispatcher:_addItem(caller, menu, location, settings, section)
})
elseif settingsList[k].category == "string" or settingsList[k].category == "configurable" then
local sub_item_table = {}
if settingsList[k].args_func then
if not settingsList[k].args and settingsList[k].args_func then
settingsList[k].args, settingsList[k].toggle = settingsList[k].args_func()
end
for i=1,#settingsList[k].args do

Loading…
Cancel
Save