diff options
author | David Walter Seikel | 2014-05-17 13:17:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-17 13:17:42 +1000 |
commit | 4795ccc5af0a0119a5d21aa4a2f3dadefc07de13 (patch) | |
tree | d4e0e6d319a69af6a053ecbb57f32be498c380db | |
parent | Fake llRequestPermissions(). (diff) | |
download | SledjHamr-4795ccc5af0a0119a5d21aa4a2f3dadefc07de13.zip SledjHamr-4795ccc5af0a0119a5d21aa4a2f3dadefc07de13.tar.gz SledjHamr-4795ccc5af0a0119a5d21aa4a2f3dadefc07de13.tar.bz2 SledjHamr-4795ccc5af0a0119a5d21aa4a2f3dadefc07de13.tar.xz |
Make llDialog() a lot more clever. Still needs more.
-rw-r--r-- | lib/LSLGuiMess.lua | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/LSLGuiMess.lua b/lib/LSLGuiMess.lua index 4f2fffe..f9c0e04 100644 --- a/lib/LSLGuiMess.lua +++ b/lib/LSLGuiMess.lua | |||
@@ -32,12 +32,22 @@ llSetTouchText(string text) | |||
32 | http://lslwiki.net/lslwiki/wakka.php?wakka=llDialog | 32 | http://lslwiki.net/lslwiki/wakka.php?wakka=llDialog |
33 | ]] | 33 | ]] |
34 | llDialog = function (id, message, buttons, channel) | 34 | llDialog = function (id, message, buttons, channel) |
35 | local win = skang.window(200, 25 + 25 * #buttons, message, 'llDialogWindow') | 35 | local w = 80 |
36 | local h = 20 | ||
37 | local x = 2 + (((1 - 1) % 3) * w) | ||
38 | local y = h * math.floor((1 - 1) / 3) | ||
39 | local dialog = skang.window(4 + w * 3, h * math.ceil((#buttons + 1) / 3), message, 'llDialogWindow') | ||
36 | 40 | ||
37 | for i, v in ipairs(buttons) do | 41 | for i, v in ipairs(buttons) do |
38 | skang.thingasm{win, 'button' .. i, 'Selects button ' .. i, types = 'widget', widget='"button", "' .. v .. '", 10, ' .. (25 * i) .. ', 60, 25'} | 42 | x = 2 + (((i - 1) % 3) * w) |
39 | win.W['button' .. i].action = 'purkle.say(' .. channel .. ', "onefang Rejected", "' .. id .. '", "' .. v .. '")' | 43 | y = h * math.floor((i - 1) / 3) |
44 | skang.thingasm{dialog, 'button' .. i, 'Selects button ' .. i, types = 'widget', widget='"button", "' .. v .. '", ' .. x .. ', ' .. y .. ', ' .. w .. ', ' .. h} | ||
45 | dialog.W['button' .. i].action = 'purkle.say(' .. channel .. ', "onefang Rejected", "' .. id .. '", "' .. v .. '")' | ||
40 | end | 46 | end |
47 | x = 2 + (((3 - 1) % 3) * w) | ||
48 | y = h * math.floor((#buttons + 1) / 3) | ||
49 | skang.thingasm{dialog, 'ignore', 'Ignore this dialog', types = 'widget', widget='"button", "ignore", ' .. x .. ', ' .. y .. ', ' .. w - 20 .. ', ' .. h} | ||
50 | skang.thingasm{dialog, 'switch', 'Switch to next dialog', types = 'widget', widget='"button", ">", ' .. (x + w - 20) .. ', ' .. y .. ', ' .. 20 .. ', ' .. h} | ||
41 | end | 51 | end |
42 | 52 | ||
43 | 53 | ||