From 310b9720bc736363bc4e99f6de1d1b6584abb031 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sat, 17 Jun 2023 16:11:08 +1000 Subject: [PATCH] fix(client/zoneCreator): require input confirmation --- resource/zoneCreator/client.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resource/zoneCreator/client.lua b/resource/zoneCreator/client.lua index aef843b..5dfee82 100644 --- a/resource/zoneCreator/client.lua +++ b/resource/zoneCreator/client.lua @@ -60,7 +60,7 @@ local function closeCreator(cancel) points[#points + 1] = vec(xCoord, yCoord) end - ---@type string[] + ---@type string[]? local input = lib.inputDialog(('Name your %s Zone'):format(firstToUpper(zoneType)), { { type = 'input', label = 'Name', placeholder = 'none' }, { type = 'select', label = 'Format', default = format, options = { @@ -68,7 +68,9 @@ local function closeCreator(cancel) { value = 'array', label = 'Array' }, { value = 'target', label = 'Target'}, }} - }) or {} + }) + + if not input then return end format = input[2]