aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/ui.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2014-04-06 09:27:46 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2014-04-06 09:27:46 -0400
commiteff5df2952e26b5a1a25e95befe485068df10c81 (patch)
treef23fc53beb00faa544f6438b22720e0227beaba6 /core/ui.lua
parent1a5c81000bb47b2df408d3a55318d2b9f04427f0 (diff)
Fixed bug when cancelling dropdown dialog; core/ui.lua
Diffstat (limited to 'core/ui.lua')
-rw-r--r--core/ui.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/ui.lua b/core/ui.lua
index 3aa30855..128e16bd 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -131,7 +131,9 @@ ui.dialogs = setmetatable({}, {__index = function(t, k)
return button, options.select_multiple and items or items[1]
elseif not options.string_output then
local i, value = result:match('^(%-?%d+)\n?(.*)$')
- return tonumber(i), k ~= 'dropdown' and value or tonumber(value) + 1
+ i = tonumber(i)
+ if k == 'dropdown' then value = i > 0 and tonumber(value) + 1 or nil end
+ return i, value
end
return result:match('([^\n]+)\n(.*)$')
end