diff --git a/src/runner/gamefeatureswrappers.cpp b/src/runner/gamefeatureswrappers.cpp index dd70821..b21360c 100644 --- a/src/runner/gamefeatureswrappers.cpp +++ b/src/runner/gamefeatureswrappers.cpp @@ -108,6 +108,17 @@ bool ModDataCheckerWrapper::dataLooksValid(std::shared_ptr ModDataContentWrapper::getAllContents() const { + return basicWrapperFunctionImplementation>(this, "getAllContents"); +} +std::vector ModDataContentWrapper::getContentsFor(std::shared_ptr fileTree) const { + return basicWrapperFunctionImplementation>(this, "getContentsFor", fileTree); +} + +/// end ModDataContent Wrapper +///////////////////////////// /// SaveGameInfo Wrapper @@ -281,6 +292,21 @@ void registerGameFeaturesPythonConverters() .def("dataLooksValid", bpy::pure_virtual(&ModDataChecker::dataLooksValid)) ; + { + bpy::scope scope = bpy::class_("ModDataContent") + .def("getAllContents", bpy::pure_virtual(&ModDataContent::getAllContents)) + .def("getContentsFor", bpy::pure_virtual(&ModDataContent::getContentsFor)) + ; + + bpy::class_("Content", bpy::init>()) + .add_property("id", &ModDataContent::Content::id) + .add_property("name", &ModDataContent::Content::name) + .add_property("icon", &ModDataContent::Content::icon) + .def("isOnlyForFilter", &ModDataContent::Content::isOnlyForFilter) + ; + + } + bpy::class_("SaveGameInfo") .def("getSaveGameInfo", bpy::pure_virtual(&SaveGameInfo::getSaveGameInfo), bpy::return_value_policy()) .def("getMissingAssets", bpy::pure_virtual(&SaveGameInfo::getMissingAssets)) diff --git a/src/runner/gamefeatureswrappers.h b/src/runner/gamefeatureswrappers.h index 23c8ae7..1e21b9f 100644 --- a/src/runner/gamefeatureswrappers.h +++ b/src/runner/gamefeatureswrappers.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,7 @@ using MpGameFeaturesList = boost::mp11::mp_list< GamePlugins, LocalSavegames, ModDataChecker, + ModDataContent, SaveGameInfo, ScriptExtender, UnmanagedMods @@ -83,7 +85,18 @@ public: static constexpr const char* className = "ModDataCheckerWrapper"; using boost::python::wrapper::get_override; - virtual bool dataLooksValid(std::shared_ptr fileTree) const; + virtual bool dataLooksValid(std::shared_ptr fileTree) const override; +}; + +class ModDataContentWrapper : public ModDataContent, public boost::python::wrapper +{ +public: + static constexpr const char* className = "ModDataContentWrapper"; + using boost::python::wrapper::get_override; + + virtual std::vector getAllContents() const override; + virtual std::vector getContentsFor(std::shared_ptr fileTree) const override; + }; class SaveGameInfoWrapper : public SaveGameInfo, public boost::python::wrapper diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 518dc98..27b53cc 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -92,6 +92,7 @@ BOOST_PYTHON_MODULE(mobase) bpy::register_ptr_to_python>(); // Containers: + utils::register_sequence_container>(); utils::register_sequence_container>(); utils::register_sequence_container>(); utils::register_sequence_container>(); @@ -99,6 +100,7 @@ BOOST_PYTHON_MODULE(mobase) utils::register_sequence_container>(); utils::register_sequence_container>(); // Required for QVariant since this is QVariantList. utils::register_sequence_container>>(); + utils::register_sequence_container>(); utils::register_sequence_container>(); utils::register_sequence_container>();