From a0831ec66a2f9184e6d149de2478627d78f8c82e Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 17 May 2014 07:52:55 +1000 Subject: Remove debugging and white space clean ups. --- lib/LSLGuiMess.lua | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'lib/LSLGuiMess.lua') diff --git a/lib/LSLGuiMess.lua b/lib/LSLGuiMess.lua index 7cab046..4f2fffe 100644 --- a/lib/LSLGuiMess.lua +++ b/lib/LSLGuiMess.lua @@ -31,33 +31,28 @@ llSetTouchText(string text) --[[ llDialog(key id, string message, list buttons, integer chat_channel) http://lslwiki.net/lslwiki/wakka.php?wakka=llDialog ]] -llDialog = function (id, message, buttons, channel) - local win = skang.window(200, 25 + 25 * #buttons, message, 'llDialogWindow') + llDialog = function (id, message, buttons, channel) + local win = skang.window(200, 25 + 25 * #buttons, message, 'llDialogWindow') -print('llDialog(' .. id .. ', ' .. message .. ', , ' .. channel .. ')') -skang.printTableStart(buttons, '', 'buttons') - - for i, v in ipairs(buttons) do - skang.thingasm{win, 'button' .. i, 'Selects button ' .. i, types = 'widget', widget='"button", "' .. v .. '", 10, ' .. (25 * i) .. ', 60, 25'} - win.W['button' .. i].action = 'purkle.say(' .. channel .. ', "onefang Rejected", "' .. id .. '", "' .. v .. '")' + for i, v in ipairs(buttons) do + skang.thingasm{win, 'button' .. i, 'Selects button ' .. i, types = 'widget', widget='"button", "' .. v .. '", 10, ' .. (25 * i) .. ', 60, 25'} + win.W['button' .. i].action = 'purkle.say(' .. channel .. ', "onefang Rejected", "' .. id .. '", "' .. v .. '")' + end end -end - -local doLua = function (command) - -- Yes I know, it hurt my brain just writing this. lol - -- It just swaps square brackets for curly ones, coz LSL uses [] to surround lists, and Lua uses {} to surround tables. - local c, err = loadstring(string.gsub(command, '[%[%]]', {['['] = '{', [']'] = '}'})) - if c then - setfenv(c, _M) - c() - else - print("ERROR - " .. err) + local doLua = function (command) + -- Yes I know, it hurt my brain just writing this. lol + -- It just swaps square brackets for curly ones, coz LSL uses [] to surround lists, and Lua uses {} to surround tables. + local c, err = loadstring(string.gsub(command, '[%[%]]', {['['] = '{', [']'] = '}'})) + if c then + setfenv(c, _M) + c() + else + print("ERROR - " .. err) + end end - -end -skang.thingasm('doLua', 'Run a Lua command.', doLua, 'string') + skang.thingasm('doLua', 'Run a Lua command.', doLua, 'string') skang.moduleEnd(_M) end -- cgit v1.1