From e9b13be614df9bc09bf31a7dd72198e518e4cc88 Mon Sep 17 00:00:00 2001 From: Dakurei Date: Thu, 11 Jul 2024 16:55:44 +0200 Subject: [PATCH] [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 --- src/system/settings/settings.ts | 5 ++--- src/ui/bgm-bar.ts | 3 --- src/ui/settings/abstract-settings-ui-handler.ts | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index b09de095259..25abd74541e 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -493,9 +493,8 @@ export const Setting: Array = [ 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, diff --git a/src/ui/bgm-bar.ts b/src/ui/bgm-bar.ts index f4366ef9c65..db19988a975 100644 --- a/src/ui/bgm-bar.ts +++ b/src/ui/bgm-bar.ts @@ -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); diff --git a/src/ui/settings/abstract-settings-ui-handler.ts b/src/ui/settings/abstract-settings-ui-handler.ts index 6763c8d3d85..3ffd32cf842 100644 --- a/src/ui/settings/abstract-settings-ui-handler.ts +++ b/src/ui/settings/abstract-settings-ui-handler.ts @@ -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);