allow for game plugins to be written in python

This commit is contained in:
Tannin
2016-01-10 19:50:19 +01:00
parent 40192cb583
commit 2fcb932e16
4 changed files with 65 additions and 8 deletions
+51
View File
@@ -13,6 +13,57 @@ using namespace MOBase;
catch (...) { throw MyException("An unknown exception was thrown in python code"); }
/////////////////////////////
/// IPlugin Wrapper
bool IPluginWrapper::init(MOBase::IOrganizer *moInfo)
{
try {
return this->get_override("init")(bpy::ptr(moInfo));
} PYCATCH;
}
QString IPluginWrapper::name() const
{
try {
return this->get_override("name")().as<QString>();
} PYCATCH;
}
QString IPluginWrapper::author() const
{
try {
return this->get_override("author")().as<QString>();
} PYCATCH;
}
QString IPluginWrapper::description() const
{
try {
return this->get_override("description")().as<QString>();
} PYCATCH;
}
MOBase::VersionInfo IPluginWrapper::version() const
{
try {
return this->get_override("version")().as<MOBase::VersionInfo>();
} PYCATCH;
}
bool IPluginWrapper::isActive() const
{
try {
return this->get_override("isActive")().as<bool>();
} PYCATCH;
}
QList<MOBase::PluginSetting> IPluginWrapper::settings() const
{
try {
return this->get_override("settings")().as<QList<MOBase::PluginSetting>>();
} PYCATCH;
}
/// end IPlugin Wrapper
/////////////////////////////
/// IPluginTool Wrapper