diff --git a/src/common/config.cpp b/src/common/config.cpp index 51beaac32..9da9b4ae6 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -130,12 +130,10 @@ public: // General static ConfigEntry volumeSlider(100); -static ConfigEntry trophyNotificationDuration(6.0); static ConfigEntry logFilter(""); static ConfigEntry logType("sync"); static ConfigEntry userName("shadPS4"); static ConfigEntry isShowSplash(false); -static ConfigEntry isSideTrophy("right"); static ConfigEntry isConnectedToNetwork(false); static bool enableDiscordRPC = false; static std::filesystem::path sys_modules_path = {}; @@ -328,10 +326,6 @@ std::string getPadSpkOutputDevice() { return padSpkOutputDevice.get(); } -double getTrophyNotificationDuration() { - return trophyNotificationDuration.get(); -} - u32 getWindowWidth() { return windowWidth.get(); } @@ -388,10 +382,6 @@ bool showSplash() { return isShowSplash.get(); } -string sideTrophy() { - return isSideTrophy.get(); -} - bool nullGpu() { return isNullGpu.get(); } @@ -523,10 +513,6 @@ void setShowSplash(bool enable, bool is_game_specific) { isShowSplash.set(enable, is_game_specific); } -void setSideTrophy(string side, bool is_game_specific) { - isSideTrophy.set(side, is_game_specific); -} - void setNullGpu(bool enable, bool is_game_specific) { isNullGpu.set(enable, is_game_specific); } @@ -616,10 +602,6 @@ void setPadSpkOutputDevice(std::string device, bool is_game_specific) { padSpkOutputDevice.set(device, is_game_specific); } -void setTrophyNotificationDuration(double newTrophyNotificationDuration, bool is_game_specific) { - trophyNotificationDuration.set(newTrophyNotificationDuration, is_game_specific); -} - void setLanguage(u32 language, bool is_game_specific) { m_language.set(language, is_game_specific); } @@ -806,14 +788,12 @@ void load(const std::filesystem::path& path, bool is_game_specific) { const toml::value& general = data.at("General"); volumeSlider.setFromToml(general, "volumeSlider", is_game_specific); - trophyNotificationDuration.setFromToml(general, "trophyNotificationDuration", - is_game_specific); enableDiscordRPC = toml::find_or(general, "enableDiscordRPC", enableDiscordRPC); logFilter.setFromToml(general, "logFilter", is_game_specific); logType.setFromToml(general, "logType", is_game_specific); userName.setFromToml(general, "userName", is_game_specific); isShowSplash.setFromToml(general, "showSplash", is_game_specific); - isSideTrophy.setFromToml(general, "sideTrophy", is_game_specific); + isConnectedToNetwork.setFromToml(general, "isConnectedToNetwork", is_game_specific); defaultControllerID.setFromToml(general, "defaultControllerID", is_game_specific); @@ -989,13 +969,10 @@ void save(const std::filesystem::path& path, bool is_game_specific) { } // Entries saved by the game-specific settings GUI volumeSlider.setTomlValue(data, "General", "volumeSlider", is_game_specific); - trophyNotificationDuration.setTomlValue(data, "General", "trophyNotificationDuration", - is_game_specific); logFilter.setTomlValue(data, "General", "logFilter", is_game_specific); logType.setTomlValue(data, "General", "logType", is_game_specific); userName.setTomlValue(data, "General", "userName", is_game_specific); isShowSplash.setTomlValue(data, "General", "showSplash", is_game_specific); - isSideTrophy.setTomlValue(data, "General", "sideTrophy", is_game_specific); isConnectedToNetwork.setTomlValue(data, "General", "isConnectedToNetwork", is_game_specific); cursorState.setTomlValue(data, "Input", "cursorState", is_game_specific); @@ -1117,12 +1094,11 @@ void setDefaultValues(bool is_game_specific) { // Entries with game-specific settings that are in both the game-specific and global GUI // GS - General volumeSlider.set(100, is_game_specific); - trophyNotificationDuration.set(6.0, is_game_specific); logFilter.set("", is_game_specific); logType.set("sync", is_game_specific); userName.set("shadPS4", is_game_specific); isShowSplash.set(false, is_game_specific); - isSideTrophy.set("right", is_game_specific); + // GS - Input cursorState.set(HideCursorState::Idle, is_game_specific); diff --git a/src/common/config.h b/src/common/config.h index b3e861da4..6ce56056a 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -57,8 +57,6 @@ bool collectShadersForDebug(); void setCollectShaderForDebug(bool enable, bool is_game_specific = false); bool showSplash(); void setShowSplash(bool enable, bool is_game_specific = false); -std::string sideTrophy(); -void setSideTrophy(std::string side, bool is_game_specific = false); bool nullGpu(); void setNullGpu(bool enable, bool is_game_specific = false); bool copyGPUCmdBuffers(); @@ -97,9 +95,6 @@ std::string getLogType(); void setLogType(const std::string& type, bool is_game_specific = false); std::string getLogFilter(); void setLogFilter(const std::string& type, bool is_game_specific = false); -double getTrophyNotificationDuration(); -void setTrophyNotificationDuration(double newTrophyNotificationDuration, - bool is_game_specific = false); int getCursorHideTimeout(); std::string getMainOutputDevice(); void setMainOutputDevice(std::string device, bool is_game_specific = false); diff --git a/src/core/emulator_settings.h b/src/core/emulator_settings.h index 8295f9e73..2092909df 100644 --- a/src/core/emulator_settings.h +++ b/src/core/emulator_settings.h @@ -91,7 +91,7 @@ struct GeneralSettings { Setting log_filter{""}; Setting log_type{"sync"}; Setting show_splash{false}; - Setting side_trophy{"right"}; + Setting trophy_notification_side{"right"}; Setting connected_to_network{false}; Setting discord_rpc_enabled{false}; @@ -111,7 +111,8 @@ struct GeneralSettings { make_override("log_filter", &GeneralSettings::log_filter), make_override("log_type", &GeneralSettings::log_type), make_override("show_splash", &GeneralSettings::show_splash), - make_override("side_trophy", &GeneralSettings::side_trophy), + make_override("trophy_notification_side", + &GeneralSettings::trophy_notification_side), make_override("connected_to_network", &GeneralSettings::connected_to_network)}; } @@ -120,7 +121,8 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GeneralSettings, install_dirs, addon_install_ sys_modules_dir, volume_slider, neo_mode, dev_kit_mode, extra_dmem_in_mbytes, psn_signed_in, trophy_popup_disabled, trophy_notification_duration, log_filter, log_type, show_splash, - side_trophy, connected_to_network, discord_rpc_enabled) + trophy_notification_side, connected_to_network, + discord_rpc_enabled) // ------------------------------- // Debug settings @@ -322,6 +324,8 @@ public: SETTING_FORWARD(m_general, ExtraDmemInMBytes, extra_dmem_in_mbytes) SETTING_FORWARD_BOOL(m_general, PSNSignedIn, psn_signed_in) SETTING_FORWARD_BOOL(m_general, TrophyPopupDisabled, trophy_popup_disabled) + SETTING_FORWARD(m_general, TrophyNotificationDuration, trophy_notification_duration) + SETTING_FORWARD(m_general, GetTrophyNotificationSide, trophy_notification_side) SETTING_FORWARD(m_general, AddonInstallDir, addon_install_dir) // Debug settings diff --git a/src/core/libraries/np/trophy_ui.cpp b/src/core/libraries/np/trophy_ui.cpp index ab9d821b8..44153302d 100644 --- a/src/core/libraries/np/trophy_ui.cpp +++ b/src/core/libraries/np/trophy_ui.cpp @@ -32,9 +32,9 @@ TrophyUI::TrophyUI(const std::filesystem::path& trophyIconPath, const std::strin const std::string_view& rarity) : trophy_name(trophyName), trophy_type(rarity) { - side = Config::sideTrophy(); + side = EmulatorSettings::GetInstance()->GetTrophyNotificationSide(); - trophy_timer = Config::getTrophyNotificationDuration(); + trophy_timer = EmulatorSettings::GetInstance()->GetTrophyNotificationDuration(); if (std::filesystem::exists(trophyIconPath)) { trophy_icon = RefCountedTexture::DecodePngFile(trophyIconPath);