diff --git a/loader/include/Geode/loader/ModSettingsManager.hpp b/loader/include/Geode/loader/ModSettingsManager.hpp index e20076044..6baa355d8 100644 --- a/loader/include/Geode/loader/ModSettingsManager.hpp +++ b/loader/include/Geode/loader/ModSettingsManager.hpp @@ -47,7 +47,6 @@ namespace geode { */ void save(matjson::Value& json); - // todo in 3.7.0: add this /** * Get the savedata for settings, aka the JSON object that contains all * the settings' saved states that was loaded up from disk and will be @@ -55,7 +54,7 @@ namespace geode { * @warning Modifying this will modify the value of the settings - use * carefully! */ - // matjson::Value& getSaveData(); + matjson::Value& getSaveData(); Result<> registerCustomSettingType(std::string_view type, SettingGenerator generator); // todo in v4: remove this diff --git a/loader/src/loader/Mod.cpp b/loader/src/loader/Mod.cpp index d714e6e33..55b4c9a25 100644 --- a/loader/src/loader/Mod.cpp +++ b/loader/src/loader/Mod.cpp @@ -48,8 +48,9 @@ matjson::Value& Mod::getSaveContainer() { return m_impl->getSaveContainer(); } -// todo in 3.7.0: move Mod::getSavedSettingsData() back here from -// ModSettingsManager.cpp and make it use ModSettingsManager::getSaveData() +matjson::Value& Mod::getSavedSettingsData() { + return m_impl->m_settings->getSaveData(); +} bool Mod::isEnabled() const { return m_impl->isEnabled(); diff --git a/loader/src/loader/ModSettingsManager.cpp b/loader/src/loader/ModSettingsManager.cpp index 7c335feec..83e0face0 100644 --- a/loader/src/loader/ModSettingsManager.cpp +++ b/loader/src/loader/ModSettingsManager.cpp @@ -235,9 +235,9 @@ void ModSettingsManager::save(matjson::Value& json) { // Doing this since `ModSettingsManager` is expected to manage savedata fully json = m_impl->savedata; } -// matjson::Value& ModSettingsManager::getSaveData() { -// return m_impl->savedata; -// } +matjson::Value& ModSettingsManager::getSaveData() { + return m_impl->savedata; +} std::shared_ptr ModSettingsManager::get(std::string_view key) { auto id = std::string(key); @@ -274,9 +274,3 @@ std::optional ModSettingsManager::getLegacyDefinition(std::string_view bool ModSettingsManager::restartRequired() const { return m_impl->restartRequired; } - -// todo in 3.7.0: move Mod::getSavedSettingsData() back to Mod.cpp and make it -// use ModSettingsManager::getSaveData() -matjson::Value& Mod::getSavedSettingsData() { - return m_impl->m_settings->m_impl->savedata; -}