mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-16 14:48:07 +01:00
[QoL] Add setting to control volume of UI sound efffects (#3354)
* Added settings option to toggle UI sound effects * Added text to other locales * Localizations except es and it * New language locales * Added italian translation Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> * Refactored on top of PR #3527 * Rebased and updated setting name * Added comments for the included sound effects --------- Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com>
This commit is contained in:
parent
392bb1803c
commit
f688ed7329
@ -126,6 +126,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
public bgmVolume: number = 1;
|
public bgmVolume: number = 1;
|
||||||
public fieldVolume: number = 1;
|
public fieldVolume: number = 1;
|
||||||
public seVolume: number = 1;
|
public seVolume: number = 1;
|
||||||
|
public uiVolume: number = 1;
|
||||||
public gameSpeed: integer = 1;
|
public gameSpeed: integer = 1;
|
||||||
public damageNumbersMode: integer = 0;
|
public damageNumbersMode: integer = 0;
|
||||||
public reroll: boolean = false;
|
public reroll: boolean = false;
|
||||||
@ -1799,11 +1800,15 @@ export default class BattleScene extends SceneBase {
|
|||||||
config["volume"] *= 0.5;
|
config["volume"] *= 0.5;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "se":
|
|
||||||
case "ui":
|
case "ui":
|
||||||
|
//As of, right now this applies to the "select", "menu_open", "error" sound effects
|
||||||
|
config["volume"] = this.masterVolume * this.uiVolume;
|
||||||
|
break;
|
||||||
|
case "se":
|
||||||
default:
|
default:
|
||||||
config["volume"] = this.masterVolume * this.seVolume;
|
config["volume"] = this.masterVolume * this.seVolume;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
this.sound.play(key, config);
|
this.sound.play(key, config);
|
||||||
return this.sound.get(key) as AnySound;
|
return this.sound.get(key) as AnySound;
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
"bgmVolume": "BGM Volume",
|
"bgmVolume": "BGM Volume",
|
||||||
"fieldVolume": "Field Volume",
|
"fieldVolume": "Field Volume",
|
||||||
"seVolume": "SE Volume",
|
"seVolume": "SE Volume",
|
||||||
|
"uiVolume": "UI Volume",
|
||||||
"musicPreference": "Music Preference",
|
"musicPreference": "Music Preference",
|
||||||
"mixed": "Mixed",
|
"mixed": "Mixed",
|
||||||
"gamepadPleasePlug": "Please Plug in a Gamepad or Press a Button",
|
"gamepadPleasePlug": "Please Plug in a Gamepad or Press a Button",
|
||||||
|
@ -119,6 +119,7 @@ export const SettingKeys = {
|
|||||||
BGM_Volume: "BGM_VOLUME",
|
BGM_Volume: "BGM_VOLUME",
|
||||||
Field_Volume: "FIELD_VOLUME",
|
Field_Volume: "FIELD_VOLUME",
|
||||||
SE_Volume: "SE_VOLUME",
|
SE_Volume: "SE_VOLUME",
|
||||||
|
UI_Volume: "UI_SOUND_EFFECTS",
|
||||||
Music_Preference: "MUSIC_PREFERENCE",
|
Music_Preference: "MUSIC_PREFERENCE",
|
||||||
Show_BGM_Bar: "SHOW_BGM_BAR",
|
Show_BGM_Bar: "SHOW_BGM_BAR",
|
||||||
Move_Touch_Controls: "MOVE_TOUCH_CONTROLS",
|
Move_Touch_Controls: "MOVE_TOUCH_CONTROLS",
|
||||||
@ -556,6 +557,13 @@ export const Setting: Array<Setting> = [
|
|||||||
default: 10,
|
default: 10,
|
||||||
type: SettingType.AUDIO
|
type: SettingType.AUDIO
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: SettingKeys.UI_Volume,
|
||||||
|
label: i18next.t("settings:uiVolume"),
|
||||||
|
options: VOLUME_OPTIONS,
|
||||||
|
default: 10,
|
||||||
|
type: SettingType.AUDIO
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: SettingKeys.Music_Preference,
|
key: SettingKeys.Music_Preference,
|
||||||
label: i18next.t("settings:musicPreference"),
|
label: i18next.t("settings:musicPreference"),
|
||||||
@ -670,6 +678,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
|
|||||||
scene.seVolume = value ? parseInt(Setting[index].options[value].value) * 0.01 : 0;
|
scene.seVolume = value ? parseInt(Setting[index].options[value].value) * 0.01 : 0;
|
||||||
scene.updateSoundVolume();
|
scene.updateSoundVolume();
|
||||||
break;
|
break;
|
||||||
|
case SettingKeys.UI_Volume:
|
||||||
|
scene.uiVolume = value ? parseInt(Setting[index].options[value].value) * 0.01 : 0;
|
||||||
|
break;
|
||||||
case SettingKeys.Music_Preference:
|
case SettingKeys.Music_Preference:
|
||||||
scene.musicPreference = value;
|
scene.musicPreference = value;
|
||||||
break;
|
break;
|
||||||
|
@ -15,6 +15,6 @@ export default class SettingsAudioUiHandler extends AbstractSettingsUiHandler {
|
|||||||
super(scene, SettingType.AUDIO, mode);
|
super(scene, SettingType.AUDIO, mode);
|
||||||
this.title = "Audio";
|
this.title = "Audio";
|
||||||
this.localStorageKey = "settings";
|
this.localStorageKey = "settings";
|
||||||
this.rowsToDisplay = 5;
|
this.rowsToDisplay = 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user