Update following ModDataChecker change.

This commit is contained in:
Mikaël Capelle
2020-06-13 23:51:52 +02:00
parent 2efc6d4af6
commit 6ee58c6bf9
2 changed files with 22 additions and 4 deletions
+20 -3
View File
@@ -102,8 +102,12 @@ bool LocalSavegamesWrapper::prepareProfile(MOBase::IProfile * profile)
/////////////////////////////
/// ModDataChecker Wrapper
bool ModDataCheckerWrapper::dataLooksValid(std::shared_ptr<const MOBase::IFileTree> fileTree) const {
return basicWrapperFunctionImplementation<bool>(this, "dataLooksValid", fileTree);
ModDataChecker::CheckReturn ModDataCheckerWrapper::dataLooksValid(std::shared_ptr<const MOBase::IFileTree> fileTree) const {
return basicWrapperFunctionImplementation<CheckReturn>(this, "dataLooksValid", fileTree);
}
std::shared_ptr<MOBase::IFileTree> ModDataCheckerWrapper::fix(std::shared_ptr<MOBase::IFileTree> fileTree) const {
return basicWrapperFunctionImplementationWithDefault<std::shared_ptr<MOBase::IFileTree>>(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_<ModDataCheckerWrapper, boost::noncopyable>("ModDataChecker")
auto modDataCheckerClass = bpy::class_<ModDataCheckerWrapper, boost::noncopyable>("ModDataChecker");
{
bpy::scope scope = modDataCheckerClass;
bpy::enum_<ModDataChecker::CheckReturn>("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_<ModDataContentWrapper, boost::noncopyable>("ModDataContent")
+2 -1
View File
@@ -85,7 +85,8 @@ public:
static constexpr const char* className = "ModDataCheckerWrapper";
using boost::python::wrapper<ModDataChecker>::get_override;
virtual bool dataLooksValid(std::shared_ptr<const MOBase::IFileTree> fileTree) const override;
virtual CheckReturn dataLooksValid(std::shared_ptr<const MOBase::IFileTree> fileTree) const override;
virtual std::shared_ptr<MOBase::IFileTree> fix(std::shared_ptr<MOBase::IFileTree> fileTree) const override;
};
class ModDataContentWrapper : public ModDataContent, public boost::python::wrapper<ModDataContent>