From eff5df2952e26b5a1a25e95befe485068df10c81 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 6 Apr 2014 09:27:46 -0400 Subject: Fixed bug when cancelling dropdown dialog; core/ui.lua --- core/ui.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/ui.lua') 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 -- cgit v1.2.3