diff --git a/loader/include/Geode/loader/SettingV3.hpp b/loader/include/Geode/loader/SettingV3.hpp index c25afc0d..f2ef2c55 100644 --- a/loader/include/Geode/loader/SettingV3.hpp +++ b/loader/include/Geode/loader/SettingV3.hpp @@ -60,6 +60,7 @@ namespace geode { protected: Result<> parseShared(JsonExpectedValue& json); + Result<> isValidShared() const; public: std::string getName() const; diff --git a/loader/src/loader/SettingV3.cpp b/loader/src/loader/SettingV3.cpp index ab6b95fb..13071058 100644 --- a/loader/src/loader/SettingV3.cpp +++ b/loader/src/loader/SettingV3.cpp @@ -47,6 +47,7 @@ Result> SettingV3::parseBuiltin(std::string const& mo GEODE_UNWRAP(ret->parse(modID, json)); return root.ok(ret); } + std::optional SettingV3::convertToLegacy() const { return std::nullopt; } @@ -77,6 +78,11 @@ Result<> geode::detail::GeodeSettingBaseV3::parseShared(JsonExpectedValue& json) json.needs("enable-if").into(m_impl->enableIf); return Ok(); } +Result<> geode::detail::GeodeSettingBaseV3::isValidShared() const { + // In the future if something like `enable-if` preventing + // programmatic modification of settings it should be added here + return Ok(); +} class TitleSettingV3::Impl final { public: @@ -152,7 +158,11 @@ bool BoolSettingV3::getValue() const { void BoolSettingV3::setValue(bool value) { m_impl->value = value; } -Result<> BoolSettingV3::isValid(bool value) const {} +Result<> BoolSettingV3::isValid(bool value) const { + GEODE_UNWRAP(this->isValidShared()); + return Ok(); +} + bool BoolSettingV3::getDefaultValue() const { return m_impl->defaultValue; }