From 2cfe9977a692da7bfb4f87de453ee789ccda79e0 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 5 Mar 2014 19:34:58 -0500 Subject: Added support for gtdialog's new `optionselect` dialog. This requires gtdialog r68 (changeset 1426c89d2874). --- core/ui.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/ui.lua') diff --git a/core/ui.lua b/core/ui.lua index 744b09e8..5ae30b79 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -86,7 +86,12 @@ ui.dialogs = setmetatable({}, {__index = function(t, k) -- @return Lua objects depending on the dialog kind return function(options) if not options.button1 then options.button1 = _L['_OK'] end - if options.select then options.select = options.select - 1 end + local select = options.select + if type(select) == 'number' then + options.select = select - 1 + elseif type(select) == 'table' then + for i = 1, #select do select[i] = select[i] - 1 end + end -- Transform key-value pairs into command line arguments. local args = {} for option, value in pairs(options) do -- cgit v1.2.3