#pragma once // MassBuilderSaveTool // Copyright (C) 2021-2024 Guillaume Jacquemin // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #include using namespace Corrade; namespace mbst { class Configuration { public: static auto instance() -> Configuration&; ~Configuration(); bool valid() const; auto lastError() const -> Containers::StringView; void save(); auto swapInterval() const -> int; void setSwapInterval(int interval); auto fpsCap() const -> float; void setFpsCap(float cap); bool cheatMode() const; void setCheatMode(bool enabled); bool advancedMode() const; void setAdvancedMode(bool enabled); bool checkUpdatesOnStartup() const; void setCheckUpdatesOnStartup(bool mode); bool skipDisclaimer() const; void setSkipDisclaimer(bool mode); bool isRunningInWine() const; void setRunningInWine(bool wine); struct Directories { Containers::String gameSaves; Containers::String gameConfig; Containers::String gameScreenshots; Containers::String backups; Containers::String staging; Containers::String armours; Containers::String weapons; Containers::String styles; Containers::String temp; }; auto directories() const -> Directories const&; private: explicit Configuration(); Utility::Configuration _conf; Containers::String _lastError; int _swapInterval = 1; float _fpsCap = 60.0f; bool _cheatMode = false; bool _advancedMode = false; bool _checkUpdatesOnStartup = true; bool _skipDisclaimer = false; bool _isRunningInWine = false; bool _valid = false; Directories _directories; }; Configuration& conf(); }