aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-03-20 14:38:47 +1000
committerDavid Walter Seikel2014-03-20 14:38:47 +1000
commitfe28833efb271d5258b0e7bc2d96e02a31572c2e (patch)
treed47c542993c8a71fa8d9073bd29707a0e0f90e70 /ClientHamr
parentRemove the module() code again. (diff)
downloadSledjHamr-fe28833efb271d5258b0e7bc2d96e02a31572c2e.zip
SledjHamr-fe28833efb271d5258b0e7bc2d96e02a31572c2e.tar.gz
SledjHamr-fe28833efb271d5258b0e7bc2d96e02a31572c2e.tar.bz2
SledjHamr-fe28833efb271d5258b0e7bc2d96e02a31572c2e.tar.xz
Added boss and acl arguments for params and commands, and filled in more for the stubs.
Diffstat (limited to 'ClientHamr')
-rw-r--r--ClientHamr/GuiLua/skang.lua34
1 files changed, 12 insertions, 22 deletions
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua
index 62ea957..ec8a496 100644
--- a/ClientHamr/GuiLua/skang.lua
+++ b/ClientHamr/GuiLua/skang.lua
@@ -135,16 +135,6 @@ moduleBegin = function (name, author, copyright, version, timestamp, skin)
135 return result 135 return result
136end 136end
137 137
138module = function ()
139end
140load = function ()
141end
142clear = function ()
143end
144window = function (width, height, title)
145end
146quit = function ()
147end
148 138
149-- skang.newParam stashes the default value into _M['bar'], and the details into ThingSpace.parameters['bar']. 139-- skang.newParam stashes the default value into _M['bar'], and the details into ThingSpace.parameters['bar'].
150-- Actually, if it's not required, and there's no default, then skip setting _M['bar']. 140-- Actually, if it's not required, and there's no default, then skip setting _M['bar'].
@@ -157,17 +147,17 @@ end
157-- Then we have to deal with widgets linking to specific clones. 147-- Then we have to deal with widgets linking to specific clones.
158-- Actually, not sure matrix-RAD solved that either. lol 148-- Actually, not sure matrix-RAD solved that either. lol
159-- This could even be done with an array of these arguments, not including the _M. 149-- This could even be done with an array of these arguments, not including the _M.
160newParam = function (module, name, required, shortcut, default, help) 150newParam = function (module, name, required, shortcut, default, help, acl, boss)
161 module[name] = default 151 module[name] = default
162 ThingSpace.parameters[name] = {module = module, name = name, required = required, shortcut = shortcut, default = default, help = help, } 152 ThingSpace.parameters[name] = {module = module, name = name, required = required, shortcut = shortcut, default = default, help = help, acl = acl, boss = boss, }
163 print(name .. ' -> ' .. shortcut .. ' -> ' .. help) 153 print(name .. ' -> ' .. shortcut .. ' -> ' .. help)
164end 154end
165 155
166-- skang.newCommand stashes the function into _M['func'], and stashes it all (including the function) into ThingSpace.commands['func']. 156-- skang.newCommand stashes the function into _M['func'], and stashes it all (including the function) into ThingSpace.commands['func'].
167-- TODO - Could use _call so that ThingSpace.commands['foo'](arg) works. 157-- TODO - Could use _call so that ThingSpace.commands['foo'](arg) works.
168newCommand = function (module, name, types, help, func) 158newCommand = function (module, name, types, help, func, acl, boss)
169 module[name] = func 159 module[name] = func
170 ThingSpace.commands[name] = {module = module, name = name, help = help, func = func, } 160 ThingSpace.commands[name] = {module = module, name = name, help = help, func = func, acl = acl, boss = boss, }
171 print(name .. '(' .. types .. ') -> ' .. help) 161 print(name .. '(' .. types .. ') -> ' .. help)
172end 162end
173 163
@@ -179,7 +169,7 @@ clear = function ()
179end 169end
180window = function (width, height, title) 170window = function (width, height, title)
181end 171end
182load = function (name) 172skang = function (name)
183end 173end
184get = function (name) 174get = function (name)
185end 175end
@@ -188,13 +178,13 @@ end
188quit = function () 178quit = function ()
189end 179end
190 180
191newCommand(_M, 'module', 'name', '', module) 181newCommand(_M, 'module', 'file,acl', 'Load a module.', module)
192newCommand(_M, 'clear', '', '', clear) 182newCommand(_M, 'clear', '', 'The current skin is cleared of all widgets.', clear) -- Was in SkangAWT in Java.
193newCommand(_M, 'window', 'w,h,name', '', window) 183newCommand(_M, 'window', 'x,y,name', 'Specifies the size and title of the application Frame.', window, 'GGG') -- Was in SkangAWT in Java.
194newCommand(_M, 'load', 'name', '', load) 184newCommand(_M, 'skang', 'URL', 'Parse the contents of a skang file or URL.', skang)
195newCommand(_M, 'get', 'name', '', get) -- This should be in the modules, not actually here. 185newCommand(_M, 'get', 'name', 'Get the current value of an existing thing.', get) -- This should be in the modules, not actually here?
196newCommand(_M, 'set', 'name,data', '', set) -- This should be in the modules, not actually here. 186newCommand(_M, 'set', 'name,data', 'Set the current value of an existing Thing.', set) -- This should be in the modules, not actually here?
197newCommand(_M, 'quit', '', '', quit) 187newCommand(_M, 'quit', '', 'Quit, exit, remove thyself.', quit)
198 188
199 189
200-- Restore the environment. 190-- Restore the environment.