From 8748f94363233388f30a53e8bea6b29e8248dd16 Mon Sep 17 00:00:00 2001 From: UltraDaCat <113462733+UltraDaCat@users.noreply.github.com> Date: Sun, 13 Jul 2025 18:27:01 +0200 Subject: [PATCH] Update config.cpp --- src/common/config.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/common/config.cpp b/src/common/config.cpp index 6f8563377..a1b12ee5d 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -32,6 +32,7 @@ std::filesystem::path find_fs_path_or(const basic_value& v, const K& ky, namespace Config { // General +static int volumeSlider = 100; static bool isNeo = false; static bool isDevKit = false; static bool isPSNSignedIn = false; @@ -108,6 +109,9 @@ static std::string trophyKey = ""; // Expected number of items in the config file static constexpr u64 total_entries = 54; +int getVolumeSlider() { + return volumeSlider; +} bool allowHDR() { return isHDRAllowed; } @@ -157,6 +161,10 @@ std::filesystem::path GetSaveDataPath() { return save_data_path; } +void setVolumeSlider(int volumeValue) { + volumeSlider = volumeValue; +} + void setLoadGameSizeEnabled(bool enable) { load_game_size = enable; } @@ -611,6 +619,7 @@ void load(const std::filesystem::path& path) { if (data.contains("General")) { const toml::value& general = data.at("General"); + volumeSlider = toml::find_or(general, "volumeSlider", volumeSlider); isNeo = toml::find_or(general, "isPS4Pro", isNeo); isDevKit = toml::find_or(general, "isDevKit", isDevKit); isPSNSignedIn = toml::find_or(general, "isPSNSignedIn", isPSNSignedIn); @@ -806,6 +815,7 @@ void save(const std::filesystem::path& path) { fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string())); } + data["General"]["volumeSlider"] = volumeSlider; data["General"]["isPS4Pro"] = isNeo; data["General"]["isDevKit"] = isDevKit; data["General"]["isPSNSignedIn"] = isPSNSignedIn; @@ -901,6 +911,7 @@ void save(const std::filesystem::path& path) { void setDefaultValues() { // General + volumeSlider = 100; isNeo = false; isDevKit = false; isPSNSignedIn = false;