diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 52fe60f..ae22889 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -3,10 +3,12 @@ #pragma warning( disable : 4100 ) #pragma warning( disable : 4996 ) +#include "iplugingame.h" #include #include "uibasewrappers.h" #include "pythonpluginwrapper.h" #include "proxypluginwrappers.h" + #include #include #include @@ -706,7 +708,7 @@ BOOST_PYTHON_MODULE(mobase) bpy::class_("GameInfo") .def("type", bpy::pure_virtual(&IGameInfo::type)) .def("path", bpy::pure_virtual(&IGameInfo::path)) - .def("binaryName", bpy::pure_virtual(&IGameInfo::binaryName)) +// .def("binaryName", bpy::pure_virtual(&IGameInfo::binaryName)) ; bpy::class_("IOrganizer") @@ -735,6 +737,7 @@ BOOST_PYTHON_MODULE(mobase) .def("onFinishedRun", bpy::pure_virtual(&IOrganizer::onFinishedRun)) .def("onModInstalled", bpy::pure_virtual(&IOrganizer::onModInstalled)) .def("refreshModList", bpy::pure_virtual(&IOrganizer::refreshModList)) + .def("managedGame", bpy::pure_virtual(&IOrganizer::managedGame), bpy::return_value_policy()) ; bpy::class_("ModRepositoryBridge") diff --git a/src/runner/uibasewrappers.h b/src/runner/uibasewrappers.h index 7c0edd2..7c820cc 100644 --- a/src/runner/uibasewrappers.h +++ b/src/runner/uibasewrappers.h @@ -21,7 +21,7 @@ #include "error.h" #include "gilock.h" - +namespace MOBase { class IPluginGame; } extern MOBase::IOrganizer *s_Organizer; @@ -208,7 +208,7 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapperget_override("downloadsPath")(); } virtual QString overwritePath() const { return this->get_override("overwritePath")(); } virtual MOBase::VersionInfo appVersion() const { return this->get_override("appVersion")(); } - virtual MOBase::IModInterface *getMod(const QString &name) { return this->get_override("getMod")(name); } + virtual MOBase::IModInterface *getMod(const QString &name) const { return this->get_override("getMod")(name); } virtual MOBase::IModInterface *createMod(MOBase::GuessedValue &name) { return this->get_override("createMod")(name); } virtual bool removeMod(MOBase::IModInterface *mod) { return this->get_override("removeMod")(mod); } virtual void modDataChanged(MOBase::IModInterface *mod) { this->get_override("modDataChanged")(mod); } @@ -218,9 +218,9 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapperget_override("setPersistent")(pluginName, key, value, sync); } virtual QString pluginDataPath() const { return this->get_override("pluginDataPath")(); } virtual MOBase::IModInterface *installMod(const QString &fileName, const QString &nameSuggestion = QString()) { return this->get_override("installMod")(fileName, nameSuggestion); } - virtual MOBase::IDownloadManager *downloadManager() { return this->get_override("downloadManager")(); } - virtual MOBase::IPluginList *pluginList() { return this->get_override("pluginList")(); } - virtual MOBase::IModList *modList() { return this->get_override("modList")(); } + virtual MOBase::IDownloadManager *downloadManager() const { return this->get_override("downloadManager")(); } + virtual MOBase::IPluginList *pluginList() const { return this->get_override("pluginList")(); } + virtual MOBase::IModList *modList() const { return this->get_override("modList")(); } virtual QString resolvePath(const QString &fileName) const { return this->get_override("resolvePath")(fileName); } virtual QStringList listDirectories(const QString &directoryName) const { return this->get_override("listDirectories")(directoryName); } virtual QStringList findFiles(const QString &path, const std::function &filter) const { return this->get_override("findFiles")(path, filter); } @@ -232,6 +232,7 @@ struct IOrganizerWrapper: MOBase::IOrganizer, boost::python::wrapper &func) { return this->get_override("onAboutToRun")(func); } virtual bool onFinishedRun(const std::function &func) { return this->get_override("onFinishedRun")(func); } virtual bool onModInstalled(const std::function &func) { return this->get_override("onModInstalled")(func); } + virtual MOBase::IPluginGame *managedGame() const { return this->get_override("managedGame")(); } }; struct IDownloadManagerWrapper: MOBase::IDownloadManager, boost::python::wrapper @@ -261,7 +262,7 @@ struct IGameInfoWrapper: MOBase::IGameInfo, boost::python::wrapperget_override("type")(); } virtual QString path() const { return this->get_override("path")(); } - virtual QString binaryName() const { return this->get_override("binaryName")(); } +// virtual QString binaryName() const { return this->get_override("binaryName")(); } }; struct IModInterfaceWrapper: MOBase::IModInterface, boost::python::wrapper