aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-18 02:04:10 +1000
committerDavid Walter Seikel2014-05-18 02:04:10 +1000
commit92c93795f1a933516e3e64051ab77cde6d6ffaa3 (patch)
tree6f3c5615a5f390e65e230601efa3a3cd3ad43cf5 /lib
parentllDialog()'s share the one window and set of widgets now. Still needs more w... (diff)
downloadSledjHamr-92c93795f1a933516e3e64051ab77cde6d6ffaa3.zip
SledjHamr-92c93795f1a933516e3e64051ab77cde6d6ffaa3.tar.gz
SledjHamr-92c93795f1a933516e3e64051ab77cde6d6ffaa3.tar.bz2
SledjHamr-92c93795f1a933516e3e64051ab77cde6d6ffaa3.tar.xz
LSLGui, clean up the mess.
Diffstat (limited to 'lib')
-rw-r--r--lib/LSLGuiMess.lua15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/LSLGuiMess.lua b/lib/LSLGuiMess.lua
index 5c5cd9b..101f28e 100644
--- a/lib/LSLGuiMess.lua
+++ b/lib/LSLGuiMess.lua
@@ -36,12 +36,12 @@ TODO - Like the files window, just reuse a single window, hiding and showing it
36]] 36]]
37 37
38 local dialogs = {count = 0, current = 0} 38 local dialogs = {count = 0, current = 0}
39 local buttCount = 12 * 8
39 local w = 80 40 local w = 80
40 local h = 20 41 local h = 20
41 local x = 2 + (((1 - 1) % 3) * w) 42 local x = 2 + (((1 - 1) % 3) * w)
42 local y = h * math.floor((1 - 1) / 3) 43 local y = h * math.floor((1 - 1) / 3)
43 local buttCount = 12 * 8 44 local dialog = skang.window(4 + w * 3, h * math.ceil((buttCount + 1) / 3), message, 'llDialogWindow')
44 local dialog = skang.window(4 + w * 3, h * math.ceil((--[[#buttons]] buttCount + 1) / 3), message, 'llDialogWindow')
45 45
46 for i = 1, buttCount do 46 for i = 1, buttCount do
47 x = 2 + (((i - 1) % 3) * w) 47 x = 2 + (((i - 1) % 3) * w)
@@ -50,14 +50,11 @@ TODO - Like the files window, just reuse a single window, hiding and showing it
50 skang.hide(dialog.W['button' .. i].Cwidget) 50 skang.hide(dialog.W['button' .. i].Cwidget)
51 end 51 end
52 x = 2 + (((3 - 1) % 3) * w) 52 x = 2 + (((3 - 1) % 3) * w)
53 y = h * math.floor((--[[#buttons]] buttCount + 1) / 3) 53 y = h * math.floor((buttCount + 1) / 3)
54 skang.thingasm{dialog, 'ignore', 'Ignore this dialog', types = 'widget', widget='"button", "ignore", ' .. x .. ', ' .. y .. ', ' .. w - 20 .. ', ' .. h} 54 skang.thingasm{dialog, 'ignore', 'Ignore this dialog', types = 'widget', widget='"button", "ignore", ' .. x .. ', ' .. y .. ', ' .. w - 20 .. ', ' .. h}
55 skang.thingasm{dialog, 'switch', 'Switch to next dialog', types = 'widget', widget='"button", ">", ' .. (x + w - 20) .. ', ' .. y .. ', ' .. 20 .. ', ' .. h} 55 skang.thingasm{dialog, 'switch', 'Switch to next dialog', types = 'widget', widget='"button", ">", ' .. (x + w - 20) .. ', ' .. y .. ', ' .. 20 .. ', ' .. h}
56 56
57 llDialog = function (id, message, buttons, channel) 57 llDialog = function (id, message, buttons, channel)
58 local x = 2 + (((1 - 1) % 3) * w)
59 local y = h * math.floor((1 - 1) / 3)
60
61 dialogs.count = dialogs.count + 1 58 dialogs.count = dialogs.count + 1
62 dialogs[dialogs.count] = buttons 59 dialogs[dialogs.count] = buttons
63 -- Hide the last set of buttons 60 -- Hide the last set of buttons
@@ -69,11 +66,9 @@ TODO - Like the files window, just reuse a single window, hiding and showing it
69 dialogs.current = dialogs.count 66 dialogs.current = dialogs.count
70 67
71 for i, v in ipairs(buttons) do 68 for i, v in ipairs(buttons) do
72 x = 2 + (((i - 1) % 3) * w)
73 y = h * math.floor((i - 1) / 3)
74 skang.show(dialog.W['button' .. i].Cwidget)
75 dialog.W['button' .. i].text = v
76 dialog.W['button' .. i].action = 'purkle.say(' .. channel .. ', "onefang Rejected", "' .. id .. '", "' .. v .. '")' 69 dialog.W['button' .. i].action = 'purkle.say(' .. channel .. ', "onefang Rejected", "' .. id .. '", "' .. v .. '")'
70 dialog.W['button' .. i].text = v
71 skang.show(dialog.W['button' .. i].Cwidget)
77 end 72 end
78 end 73 end
79 74