Skip to content

Commit

Permalink
Added notifications SFX settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouca committed Jul 28, 2024
1 parent 8eff53c commit 5be0f11
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## <cj>v1.3.7</c> <cb>(---)</c>
* <cg>Added</c> Notifications SFX settings

## <cj>v1.3.6</c> <cb>(2024-07-28)</c>
* <cg>Added</c> <cp>Shadow</c> gauntlet design
* <cy>Changed</c> <cb>Time</c> and <co>Spike</c> gauntlet designs
Expand Down
18 changes: 18 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,24 @@
"type": "bool",
"default": true
},
"sfx-link": {
"name": "Link Game SFX to Notification",
"description": "Link the game's SFX to the GDUtils notification SFX.",
"type": "bool",
"default": true
},
"sfx-volume": {
"name": "SFX Volume",
"description": "The volume of the notification sound effect.\n\n<cr>Can only be applied if 'Link Game SFX to Notification' is disabled.</c>",
"type": "float",
"default": 1,
"min": 0.0,
"max": 1,
"control": {
"slider-step": 0.0001,
"arrows": false
}
},
"customDifficultyFaces": {
"name": "Custom Difficulty Faces",
"description": "Enable custom difficulty faces for Legendary/Mythic",
Expand Down
8 changes: 7 additions & 1 deletion src/Notifications/EventsPush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,13 @@ bool EventsPush::init(sio::message::ptr const& data) {
nullptr
));

auto volume = GameManager::get()->m_sfxVolume;
float volume = 0.0f;
if (Mod::get()->getSettingValue<bool>("sfx-link")) {
volume = GameManager::get()->m_sfxVolume;
} else {
volume = Mod::get()->getSettingValue<double>("sfx-volume");
}

if (Mod::get()->getSettingValue<bool>("sfx") && type != 3 && type != 4) FMODAudioEngine::sharedEngine()->playEffect("crystal01.ogg", 1, 1, volume);
if (Mod::get()->getSettingValue<bool>("sfx") && (type == 3 || type == 4)) FMODAudioEngine::sharedEngine()->playEffect("reward01.ogg", 1, 1, volume);

Expand Down

0 comments on commit 5be0f11

Please sign in to comment.