[Bugfix] Fix a bug during bgm-bar initialization (#2822)

* Prevent sizing error

* Make reboot not necessary for show BGM

* Makes the BGM Bar active by default

  + It had originally been decided that this would not be active by default because it was to be displayed outside the pause menu, but since its behavior has changed between this decision and its integration, the default deactivation is no longer necessary
This commit is contained in:
Dakurei 2024-07-11 16:55:44 +02:00 committed by GitHub
parent d69bedd5d7
commit e9b13be614
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View File

@ -493,9 +493,8 @@ export const Setting: Array<Setting> = [
key: SettingKeys.Show_BGM_Bar,
label: i18next.t("settings:showBgmBar"),
options: OFF_ON,
default: 0,
type: SettingType.DISPLAY,
requireReload: true
default: 1,
type: SettingType.DISPLAY
},
{
key: SettingKeys.Master_Volume,

View File

@ -45,9 +45,6 @@ export default class BgmBar extends Phaser.GameObjects.Container {
*/
setBgmToBgmBar(bgmName: string): void {
this.musicText.setText(`${i18next.t("bgmName:music")}${this.getRealBgmName(bgmName)}`);
if (!(this.scene as BattleScene).showBgmBar) {
return;
}
this.musicText.width = this.bg.width - 20;
this.musicText.setWordWrapWidth(this.defaultWidth * 4);

View File

@ -375,6 +375,7 @@ export default class AbstractSettingsUiHandler extends UiHandler {
super.clear();
this.settingsContainer.setVisible(false);
this.eraseCursor();
this.getUi().bgmBar.toggleBgmBar(this.scene.showBgmBar);
if (this.reloadRequired) {
this.reloadRequired = false;
this.scene.reset(true, false, true);