diff --git a/src/runner/gamefeatureswrappers.cpp b/src/runner/gamefeatureswrappers.cpp index b21360c..3fb3b47 100644 --- a/src/runner/gamefeatureswrappers.cpp +++ b/src/runner/gamefeatureswrappers.cpp @@ -102,8 +102,12 @@ bool LocalSavegamesWrapper::prepareProfile(MOBase::IProfile * profile) ///////////////////////////// /// ModDataChecker Wrapper -bool ModDataCheckerWrapper::dataLooksValid(std::shared_ptr fileTree) const { - return basicWrapperFunctionImplementation(this, "dataLooksValid", fileTree); +ModDataChecker::CheckReturn ModDataCheckerWrapper::dataLooksValid(std::shared_ptr fileTree) const { + return basicWrapperFunctionImplementation(this, "dataLooksValid", fileTree); +} + +std::shared_ptr ModDataCheckerWrapper::fix(std::shared_ptr fileTree) const { + return basicWrapperFunctionImplementationWithDefault>(this, [](auto&&... args) { return nullptr; }, "fix", fileTree); } /// end ModDataChecker Wrapper @@ -288,9 +292,22 @@ void registerGameFeaturesPythonConverters() .def("prepareProfile", bpy::pure_virtual(&LocalSavegames::prepareProfile)) ; - bpy::class_("ModDataChecker") + auto modDataCheckerClass = bpy::class_("ModDataChecker"); + { + bpy::scope scope = modDataCheckerClass; + + bpy::enum_("CheckReturn") + .value("INVALID", ModDataChecker::CheckReturn::INVALID) + .value("FIXABLE", ModDataChecker::CheckReturn::FIXABLE) + .value("VALID", ModDataChecker::CheckReturn::VALID) + .export_values() + ; + + modDataCheckerClass + .def("dataLooksValid", bpy::pure_virtual(&ModDataChecker::dataLooksValid)) .def("dataLooksValid", bpy::pure_virtual(&ModDataChecker::dataLooksValid)) ; + } { bpy::scope scope = bpy::class_("ModDataContent") diff --git a/src/runner/gamefeatureswrappers.h b/src/runner/gamefeatureswrappers.h index 1e21b9f..542c712 100644 --- a/src/runner/gamefeatureswrappers.h +++ b/src/runner/gamefeatureswrappers.h @@ -85,7 +85,8 @@ public: static constexpr const char* className = "ModDataCheckerWrapper"; using boost::python::wrapper::get_override; - virtual bool dataLooksValid(std::shared_ptr fileTree) const override; + virtual CheckReturn dataLooksValid(std::shared_ptr fileTree) const override; + virtual std::shared_ptr fix(std::shared_ptr fileTree) const override; }; class ModDataContentWrapper : public ModDataContent, public boost::python::wrapper