diff options
Diffstat (limited to '')
-rw-r--r-- | ClientHamr/GuiLua/skang.lua | 34 |
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 |
136 | end | 136 | end |
137 | 137 | ||
138 | module = function () | ||
139 | end | ||
140 | load = function () | ||
141 | end | ||
142 | clear = function () | ||
143 | end | ||
144 | window = function (width, height, title) | ||
145 | end | ||
146 | quit = function () | ||
147 | end | ||
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. |
160 | newParam = function (module, name, required, shortcut, default, help) | 150 | newParam = 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) |
164 | end | 154 | end |
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. |
168 | newCommand = function (module, name, types, help, func) | 158 | newCommand = 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) |
172 | end | 162 | end |
173 | 163 | ||
@@ -179,7 +169,7 @@ clear = function () | |||
179 | end | 169 | end |
180 | window = function (width, height, title) | 170 | window = function (width, height, title) |
181 | end | 171 | end |
182 | load = function (name) | 172 | skang = function (name) |
183 | end | 173 | end |
184 | get = function (name) | 174 | get = function (name) |
185 | end | 175 | end |
@@ -188,13 +178,13 @@ end | |||
188 | quit = function () | 178 | quit = function () |
189 | end | 179 | end |
190 | 180 | ||
191 | newCommand(_M, 'module', 'name', '', module) | 181 | newCommand(_M, 'module', 'file,acl', 'Load a module.', module) |
192 | newCommand(_M, 'clear', '', '', clear) | 182 | newCommand(_M, 'clear', '', 'The current skin is cleared of all widgets.', clear) -- Was in SkangAWT in Java. |
193 | newCommand(_M, 'window', 'w,h,name', '', window) | 183 | newCommand(_M, 'window', 'x,y,name', 'Specifies the size and title of the application Frame.', window, 'GGG') -- Was in SkangAWT in Java. |
194 | newCommand(_M, 'load', 'name', '', load) | 184 | newCommand(_M, 'skang', 'URL', 'Parse the contents of a skang file or URL.', skang) |
195 | newCommand(_M, 'get', 'name', '', get) -- This should be in the modules, not actually here. | 185 | newCommand(_M, 'get', 'name', 'Get the current value of an existing thing.', get) -- This should be in the modules, not actually here? |
196 | newCommand(_M, 'set', 'name,data', '', set) -- This should be in the modules, not actually here. | 186 | newCommand(_M, 'set', 'name,data', 'Set the current value of an existing Thing.', set) -- This should be in the modules, not actually here? |
197 | newCommand(_M, 'quit', '', '', quit) | 187 | newCommand(_M, 'quit', '', 'Quit, exit, remove thyself.', quit) |
198 | 188 | ||
199 | 189 | ||
200 | -- Restore the environment. | 190 | -- Restore the environment. |