summaryrefslogtreecommitdiffstats
path: root/source/squirrelbindings/cSquirrelBaseClass.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/squirrelbindings/cSquirrelBaseClass.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/squirrelbindings/cSquirrelBaseClass.h b/source/squirrelbindings/cSquirrelBaseClass.h
index a66ca7ddd..279c47027 100644
--- a/source/squirrelbindings/cSquirrelBaseClass.h
+++ b/source/squirrelbindings/cSquirrelBaseClass.h
@@ -3,6 +3,7 @@
#include "../cPlugin_Squirrel.h"
#include "../cPluginManager.h"
#include "../cRoot.h"
+#include "../cSquirrelCommandBinder.h"
//The baseclass for squirrel plugins
class cSquirrelBaseClass
@@ -24,6 +25,17 @@ public:
cRoot::Get()->GetPluginManager()->AddHook(m_Instance, (cPluginManager::PluginHook) a_Hook);
}
+ void AddCommand( std::string a_Command, std::string a_Description, std::string a_Permission )
+ {
+ if(m_Instance) m_Instance->AddCommand(a_Command, a_Description, a_Permission);
+ }
+
+ bool BindCommand( const std::string a_Command, const std::string a_Permission, Sqrat::Function a_Callback)
+ {
+ if(!m_Instance) return false;
+ return cRoot::Get()->GetPluginManager()->GetSquirrelCommandBinder()->BindCommand(a_Command, a_Permission, m_Instance, a_Callback);
+ }
+
protected:
cPlugin_Squirrel *m_Instance;
}; \ No newline at end of file