From f26af5cde434cb4825d254d2d507de898ec77d77 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 26 Feb 2020 11:20:02 -0500 Subject: Fixed bugs in return values for standard_dropdown and msgbox dialogs. standard_dropdown was not returning the right value and msgboxes could not return string output. --- core/ui.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/ui.lua') diff --git a/core/ui.lua b/core/ui.lua index c7d8dd40..88dd83c6 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -159,10 +159,12 @@ ui.dialogs = setmetatable({}, {__index = function(_, k) elseif not options.string_output then local i, value = result:match('^(%-?%d+)\n?(.*)$') i = tonumber(i) - if k == 'dropdown' then value = i > 0 and tonumber(value) + 1 or nil end + if k:find('dropdown') then + value = i > 0 and tonumber(value) + 1 or nil + end return i, value end - return result:match('([^\n]+)\n(.*)$') + return result:match('([^\n]+)\n?(.*)$') end end}) -- cgit v1.2.3