Disable trophy pop-up with config setting (#1834)

This commit is contained in:
rainmakerv2 2024-12-22 21:46:45 +08:00 committed by GitHub
parent 5eebb04de9
commit 433d9459e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 16 deletions

View file

@ -34,6 +34,7 @@ namespace Config {
static bool isNeo = false;
static bool isFullscreen = false;
static bool playBGM = false;
static bool isTrophyPopupDisabled = false;
static int BGMvolume = 50;
static bool enableDiscordRPC = false;
static u32 screenWidth = 1280;
@ -98,6 +99,10 @@ bool isFullscreenMode() {
return isFullscreen;
}
bool getisTrophyPopupDisabled() {
return isTrophyPopupDisabled;
}
bool getPlayBGM() {
return playBGM;
}
@ -294,6 +299,10 @@ void setFullscreenMode(bool enable) {
isFullscreen = enable;
}
void setisTrophyPopupDisabled(bool disable) {
isTrophyPopupDisabled = disable;
}
void setPlayBGM(bool enable) {
playBGM = enable;
}
@ -549,6 +558,7 @@ void load(const std::filesystem::path& path) {
isNeo = toml::find_or<bool>(general, "isPS4Pro", false);
isFullscreen = toml::find_or<bool>(general, "Fullscreen", false);
playBGM = toml::find_or<bool>(general, "playBGM", false);
isTrophyPopupDisabled = toml::find_or<bool>(general, "isTrophyPopupDisabled", false);
BGMvolume = toml::find_or<int>(general, "BGMvolume", 50);
enableDiscordRPC = toml::find_or<bool>(general, "enableDiscordRPC", true);
logFilter = toml::find_or<std::string>(general, "logFilter", "");
@ -667,6 +677,7 @@ void save(const std::filesystem::path& path) {
data["General"]["isPS4Pro"] = isNeo;
data["General"]["Fullscreen"] = isFullscreen;
data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled;
data["General"]["playBGM"] = playBGM;
data["General"]["BGMvolume"] = BGMvolume;
data["General"]["enableDiscordRPC"] = enableDiscordRPC;
@ -763,6 +774,7 @@ void saveMainWindow(const std::filesystem::path& path) {
void setDefaultValues() {
isNeo = false;
isFullscreen = false;
isTrophyPopupDisabled = false;
playBGM = false;
BGMvolume = 50;
enableDiscordRPC = true;

View file

@ -19,6 +19,7 @@ bool isNeoMode();
bool isFullscreenMode();
bool getPlayBGM();
int getBGMvolume();
bool getisTrophyPopupDisabled();
bool getEnableDiscordRPC();
bool getSeparateUpdateEnabled();
bool getCompatibilityEnabled();
@ -62,6 +63,7 @@ void setGpuId(s32 selectedGpuId);
void setScreenWidth(u32 width);
void setScreenHeight(u32 height);
void setFullscreenMode(bool enable);
void setisTrophyPopupDisabled(bool disable);
void setPlayBGM(bool enable);
void setBGMvolume(int volume);
void setEnableDiscordRPC(bool enable);