Skip to content

Instantly share code, notes, and snippets.

@Quit
Created December 27, 2014 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Quit/1374f3f2d1a23a6f5ac0 to your computer and use it in GitHub Desktop.
Save Quit/1374f3f2d1a23a6f5ac0 to your computer and use it in GitHub Desktop.
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