diff options
author | 2014-04-06 09:27:46 -0400 | |
---|---|---|
committer | 2014-04-06 09:27:46 -0400 | |
commit | eff5df2952e26b5a1a25e95befe485068df10c81 (patch) | |
tree | f23fc53beb00faa544f6438b22720e0227beaba6 /core/ui.lua | |
parent | 1a5c81000bb47b2df408d3a55318d2b9f04427f0 (diff) |
Fixed bug when cancelling dropdown dialog; core/ui.lua
Diffstat (limited to 'core/ui.lua')
-rw-r--r-- | core/ui.lua | 4 |
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 |