diff options
author | David Walter Seikel | 2014-03-31 22:45:21 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-03-31 22:45:21 +1000 |
commit | bd05c036e46f6fbbaa8c79414a48dc02d00e7d33 (patch) | |
tree | bd0d349e97147cc4d2a1c6faa1f5a075bb5c9701 /ClientHamr/GuiLua/test.lua | |
parent | More ways to call thing, and rename it thingasm. (diff) | |
download | SledjHamr-bd05c036e46f6fbbaa8c79414a48dc02d00e7d33.zip SledjHamr-bd05c036e46f6fbbaa8c79414a48dc02d00e7d33.tar.gz SledjHamr-bd05c036e46f6fbbaa8c79414a48dc02d00e7d33.tar.bz2 SledjHamr-bd05c036e46f6fbbaa8c79414a48dc02d00e7d33.tar.xz |
Clean up after my thingasm.
Diffstat (limited to 'ClientHamr/GuiLua/test.lua')
-rw-r--r-- | ClientHamr/GuiLua/test.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ClientHamr/GuiLua/test.lua b/ClientHamr/GuiLua/test.lua index aebe4ae..34f2bf9 100644 --- a/ClientHamr/GuiLua/test.lua +++ b/ClientHamr/GuiLua/test.lua | |||
@@ -31,7 +31,7 @@ local fool | |||
31 | 31 | ||
32 | -- TODO - Could have a table of tables, and ipair through the top level, passing the inner ones to skang.thing{}. | 32 | -- TODO - Could have a table of tables, and ipair through the top level, passing the inner ones to skang.thing{}. |
33 | 33 | ||
34 | skang.thingasm('fooble,f', 'Help text goes here', 1, nil, '"edit", "The fooble:", 1, 1, 10, 50', true) | 34 | skang.thingasm{'fooble,f', 'Help text goes here', 1, widget='"edit", "The fooble:", 1, 1, 10, 50', required=true} |
35 | skang.thingasm('bar', 'Help text', "Default") | 35 | skang.thingasm('bar', 'Help text', "Default") |
36 | skang.thingasm('foo') | 36 | skang.thingasm('foo') |
37 | 37 | ||
@@ -54,6 +54,7 @@ local copy = skang.copy(test, 'copy') | |||
54 | 54 | ||
55 | print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.get(test, 'ffunc', 'help') .. ' ->> ' .. skang.get(test, 'f', 'action')) | 55 | print('End ' .. test.bar .. ' ' .. test.VERSION .. ' ' .. skang.get(test, 'ffunc', 'help') .. ' ->> ' .. skang.get(test, 'f', 'action')) |
56 | print('foo = ' .. test.foo .. ' ->> ' .. skang.get(test, 'foo', 'help')) | 56 | print('foo = ' .. test.foo .. ' ->> ' .. skang.get(test, 'foo', 'help')) |
57 | print('cfooble = ' .. test_c.cfooble .. ' ->> ' .. skang.get(test_c, 'cfooble', 'help') .. '[' .. skang.get(test_c, 'cfooble', 'widget') .. ']') | ||
57 | print('cfunc ->> ' .. skang.get(test_c, 'cfunc', 'help')) | 58 | print('cfunc ->> ' .. skang.get(test_c, 'cfunc', 'help')) |
58 | test.ffunc('one', 2) | 59 | test.ffunc('one', 2) |
59 | test_c.cfunc(0, 'zero') | 60 | test_c.cfunc(0, 'zero') |
@@ -120,10 +121,10 @@ print('') | |||
120 | local stuff = {} | 121 | local stuff = {} |
121 | stuff.t = {} | 122 | stuff.t = {} |
122 | 123 | ||
123 | skang.thingasm{stuff, 'a', help = 'A test stufflet'} | 124 | skang.thingasm{stuff, 'a', 'A test stufflet'} |
124 | skang.thingasm{stuff.t, 'b', help = 'A sub stufflet'} | 125 | skang.thingasm{stuff.t, 'b', 'A sub stufflet'} |
125 | skang.thingasm{stuff.t, 'c', help = 'Another sub stufflet'} | 126 | skang.thingasm{stuff.t, 'c', 'Another sub stufflet'} |
126 | skang.thingasm{stuff, 's', help = 'A Stuff', types='table'} | 127 | skang.thingasm{stuff, 's', 'A Stuff', types='table'} |
127 | stuff.s{'sa,a', help = 'A stufflet in a Stuff'} | 128 | stuff.s{'sa,a', help = 'A stufflet in a Stuff'} |
128 | stuff.s{'sb,b', help = 'Another stufflet in a Stuff'} | 129 | stuff.s{'sb,b', help = 'Another stufflet in a Stuff'} |
129 | 130 | ||
@@ -141,7 +142,7 @@ print(skang.get(stuff.t, 'c', 'help')) | |||
141 | print(skang.get(stuff, 's', 'help')) | 142 | print(skang.get(stuff, 's', 'help')) |
142 | print(skang.get(stuff.s, 'sa', 'help')) | 143 | print(skang.get(stuff.s, 'sa', 'help')) |
143 | print(skang.get(stuff.s, 'sb', 'help')) | 144 | print(skang.get(stuff.s, 'sb', 'help')) |
144 | skang.thingasm{test, 'baz,b', help = 'A test stufflet for test'} | 145 | skang.thingasm{test, 'baz,b', 'A test stufflet for test'} |
145 | print(skang.get(test, 'b', 'help')) | 146 | print(skang.get(test, 'b', 'help')) |
146 | print(skang.get(test, 'f', 'help')) | 147 | print(skang.get(test, 'f', 'help')) |
147 | --skang.printTableStart(getmetatable(stuff.s), '', 'stuff.s metatable') | 148 | --skang.printTableStart(getmetatable(stuff.s), '', 'stuff.s metatable') |