Skip to content

Commit

Permalink
so it turns out we doin 3.7.0 already
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Sep 15, 2024
1 parent 8f88913 commit 84122dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
3 changes: 1 addition & 2 deletions loader/include/Geode/loader/ModSettingsManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ 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
* saved to disk
* @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
Expand Down
5 changes: 3 additions & 2 deletions loader/src/loader/Mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 3 additions & 9 deletions loader/src/loader/ModSettingsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<SettingV3> ModSettingsManager::get(std::string_view key) {
auto id = std::string(key);
Expand Down Expand Up @@ -274,9 +274,3 @@ std::optional<Setting> 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;
}

0 comments on commit 84122dc

Please sign in to comment.