2022-12-01 23:42:39 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-12-03 16:49:18 +01:00
|
|
|
// MassBuilderSaveTool
|
2024-03-08 20:25:32 +01:00
|
|
|
// Copyright (C) 2021-2024 Guillaume Jacquemin
|
2022-12-03 16:49:18 +01:00
|
|
|
//
|
|
|
|
// 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 <https://www.gnu.org/licenses/>.
|
|
|
|
|
2022-12-01 23:42:39 +01:00
|
|
|
#include <Corrade/Utility/Configuration.h>
|
|
|
|
|
|
|
|
using namespace Corrade;
|
|
|
|
|
2023-11-29 12:33:26 +01:00
|
|
|
namespace mbst {
|
|
|
|
|
2022-12-01 23:42:39 +01:00
|
|
|
class Configuration {
|
|
|
|
public:
|
2023-11-29 12:33:26 +01:00
|
|
|
static auto instance() -> Configuration&;
|
2022-12-01 23:42:39 +01:00
|
|
|
|
|
|
|
~Configuration();
|
|
|
|
|
2024-03-09 18:09:27 +01:00
|
|
|
bool valid() const;
|
|
|
|
|
|
|
|
auto lastError() const -> Containers::StringView;
|
|
|
|
|
2022-12-01 23:42:39 +01:00
|
|
|
void save();
|
|
|
|
|
2023-11-29 12:33:26 +01:00
|
|
|
auto swapInterval() const -> int;
|
2022-12-01 23:42:39 +01:00
|
|
|
void setSwapInterval(int interval);
|
|
|
|
|
2023-11-29 12:33:26 +01:00
|
|
|
auto fpsCap() const -> float;
|
2022-12-01 23:42:39 +01:00
|
|
|
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);
|
|
|
|
|
2023-08-31 12:34:34 +02:00
|
|
|
bool isRunningInWine() const;
|
|
|
|
void setRunningInWine(bool wine);
|
|
|
|
|
2024-03-09 18:09:27 +01:00
|
|
|
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;
|
2024-03-30 23:47:04 +01:00
|
|
|
Containers::String temp;
|
2024-03-09 18:09:27 +01:00
|
|
|
};
|
|
|
|
auto directories() const -> Directories const&;
|
|
|
|
|
2022-12-01 23:42:39 +01:00
|
|
|
private:
|
|
|
|
explicit Configuration();
|
|
|
|
|
|
|
|
Utility::Configuration _conf;
|
|
|
|
|
2024-03-09 18:09:27 +01:00
|
|
|
Containers::String _lastError;
|
|
|
|
|
2023-11-29 12:33:26 +01:00
|
|
|
int _swapInterval = 1;
|
2022-12-01 23:42:39 +01:00
|
|
|
float _fpsCap = 60.0f;
|
2023-11-29 12:33:26 +01:00
|
|
|
bool _cheatMode = false;
|
|
|
|
bool _advancedMode = false;
|
|
|
|
bool _checkUpdatesOnStartup = true;
|
|
|
|
bool _skipDisclaimer = false;
|
2023-08-31 12:34:34 +02:00
|
|
|
|
|
|
|
bool _isRunningInWine = false;
|
2024-03-09 18:09:27 +01:00
|
|
|
|
|
|
|
bool _valid = false;
|
|
|
|
|
|
|
|
Directories _directories;
|
2022-12-01 23:42:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Configuration& conf();
|
2023-11-29 12:33:26 +01:00
|
|
|
|
|
|
|
}
|