From 7baf581b93ae19a7013ec91bbdd88f16d56a6ed4 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 24 May 2015 11:43:05 -0400 Subject: [PATCH] Make gui/gm-editor work with lua tables --- scripts/gui/gm-editor.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/gui/gm-editor.lua b/scripts/gui/gm-editor.lua index 4f7405121..7b104501d 100644 --- a/scripts/gui/gm-editor.lua +++ b/scripts/gui/gm-editor.lua @@ -212,14 +212,14 @@ function GmEditorUi:editSelected(index,choice) dialog.showInputPrompt(tostring(trg_key),"Enter new value:",COLOR_WHITE, tostring(trg.target[trg_key]),self:callback("commitEdit",trg_key)) - elseif trg_type=='boolean' then - trg.target[trg_key]= not trg.target[trg_key] + elseif trg_type == 'boolean' then + trg.target[trg_key] = not trg.target[trg_key] self:updateTarget(true) - elseif trg_type=='userdata' then + elseif trg_type == 'userdata' or trg_type == 'table' then self:pushTarget(trg.target[trg_key]) else - print("Unknow type:"..trg_type) - print("Subtype:"..tostring(trg.target[trg_key]._kind)) + print("Unknown type:"..trg_type) + pcall(function() print("Subtype:"..tostring(trg.target[trg_key]._kind)) end) end end end