diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 71b39328f6..0d754f71e5 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -17,7 +17,7 @@ #include -#include +#include #include #include @@ -168,7 +168,7 @@ namespace MWGui mCurrentCharacter = mgr->getCurrentCharacter(); - const std::string& directory = Settings::Manager::getString("character", "Saves"); + const std::string& directory = Settings::saves().mCharacter; size_t selectedIndex = MyGUI::ITEM_NONE; @@ -427,7 +427,7 @@ namespace MWGui mCurrentSlot->mProfile.mInGameTime.mMonth) << " " << hour << " " << (pm ? "#{Calendar:pm}" : "#{Calendar:am}"); - if (Settings::Manager::getBool("timeplayed", "Saves")) + if (Settings::saves().mTimeplayed) { text << "\n" << "#{OMWEngine:TimePlayed}: " << formatTimeplayed(mCurrentSlot->mProfile.mTimePlayed); diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index ab17031168..8f2c720d3e 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -186,7 +186,7 @@ namespace MWGui void WaitDialog::startWaiting(int hoursToWait) { - if (Settings::Manager::getBool("autosave", "Saves")) // autosaves when enabled + if (Settings::saves().mAutosave) // autosaves when enabled MWBase::Environment::get().getStateManager()->quickSave("Autosave"); MWBase::World* world = MWBase::Environment::get().getWorld(); diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index 50fd123b4f..6b09b37964 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include @@ -314,8 +314,7 @@ void MWState::StateManager::saveGame(std::string_view description, const Slot* s if (filestream.fail()) throw std::runtime_error("Write operation failed (file stream)"); - Settings::Manager::setString( - "character", "Saves", Files::pathToUnicodeString(slot->mPath.parent_path().filename())); + Settings::saves().mCharacter.set(Files::pathToUnicodeString(slot->mPath.parent_path().filename())); const auto finish = std::chrono::steady_clock::now(); @@ -354,12 +353,8 @@ void MWState::StateManager::quickSave(std::string name) return; } - int maxSaves = Settings::Manager::getInt("max quicksaves", "Saves"); - if (maxSaves < 1) - maxSaves = 1; - Character* currentCharacter = getCurrentCharacter(); // Get current character - QuickSaveManager saveFinder = QuickSaveManager(name, maxSaves); + QuickSaveManager saveFinder(name, Settings::saves().mMaxQuicksaves); if (currentCharacter) { @@ -542,8 +537,7 @@ void MWState::StateManager::loadGame(const Character* character, const std::file mState = State_Running; if (character) - Settings::Manager::setString( - "character", "Saves", Files::pathToUnicodeString(character->getPath().filename())); + Settings::saves().mCharacter.set(Files::pathToUnicodeString(character->getPath().filename())); MWBase::Environment::get().getWindowManager()->setNewGame(false); MWBase::Environment::get().getWorld()->saveLoaded();