[Bug] Fixed pre-set volume oversight (#3963)

Co-authored-by: frutescens <info@laptop>
This commit is contained in:
Mumble 2024-09-01 21:26:35 -07:00 committed by GitHub
parent f54846f735
commit 1e432fc74b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -1791,6 +1791,7 @@ export default class BattleScene extends SceneBase {
config = config ?? {};
try {
const keyDetails = key.split("/");
config["volume"] = config["volume"] ?? 1;
switch (keyDetails[0]) {
case "level_up_fanfare":
case "item_fanfare":
@ -1800,11 +1801,11 @@ export default class BattleScene extends SceneBase {
case "evolution_fanfare":
// These sounds are loaded in as BGM, but played as sound effects
// When these sounds are updated in updateVolume(), they are treated as BGM however because they are placed in the BGM Cache through being called by playSoundWithoutBGM()
config["volume"] = this.masterVolume * this.bgmVolume;
config["volume"] *= (this.masterVolume * this.bgmVolume);
break;
case "battle_anims":
case "cry":
config["volume"] = this.masterVolume * this.fieldVolume;
config["volume"] *= (this.masterVolume * this.fieldVolume);
//PRSFX sound files are unusually loud
if (keyDetails[1].startsWith("PRSFX- ")) {
config["volume"] *= 0.5;
@ -1812,10 +1813,10 @@ export default class BattleScene extends SceneBase {
break;
case "ui":
//As of, right now this applies to the "select", "menu_open", "error" sound effects
config["volume"] = this.masterVolume * this.uiVolume;
config["volume"] *= (this.masterVolume * this.uiVolume);
break;
case "se":
config["volume"] = this.masterVolume * this.seVolume;
config["volume"] *= (this.masterVolume * this.seVolume);
break;
}
this.sound.play(key, config);