Use settings values for Saves settings

macos_ci_fix
elsid 1 year ago
parent f5ddf55cdc
commit 1038a68fbf
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -17,7 +17,7 @@
#include <components/misc/strings/lower.hpp>
#include <components/settings/settings.hpp>
#include <components/settings/values.hpp>
#include <components/files/conversion.hpp>
#include <components/files/memorystream.hpp>
@ -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);

@ -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();

@ -14,7 +14,7 @@
#include <components/loadinglistener/loadinglistener.hpp>
#include <components/files/conversion.hpp>
#include <components/settings/settings.hpp>
#include <components/settings/values.hpp>
#include <osg/Image>
@ -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();

Loading…
Cancel
Save