Created
December 27, 2014 22:20
-
-
Save Quit/1374f3f2d1a23a6f5ac0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local jelly_console | |
local MOD = class() | |
function MOD:__init() | |
radiant.events.listen(radiant, 'radiant:modules_loaded', self, self.on_loaded) | |
end | |
function MOD:on_loaded(...) | |
-- Use rawget to avoid strict lua getting all upset | |
jelly_console = rawget(_G, 'jelly_console') | |
if jelly_console then | |
self:register_console_commands() | |
end | |
end | |
function MOD:register_console_commands() | |
jelly_console.add_command('@my_command', function(...) | |
end) | |
end | |
return MOD() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment