From 85f9a9fd074c71b87e30bacea0abd7158b99426c Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 21 Jun 2023 17:40:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9F=B3=E4=B9=90=E6=92=AD?= =?UTF-8?q?=E6=94=BEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/libs/control.js | 6 +++--- src/core/audio/bgm.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/libs/control.js b/public/libs/control.js index 97a9e66..51bd104 100644 --- a/public/libs/control.js +++ b/public/libs/control.js @@ -3585,19 +3585,19 @@ control.prototype.playBgm = function (bgm, startTime) { ////// 暂停背景音乐的播放 ////// control.prototype.pauseBgm = function () { - if (main.mode != 'play') return; + if (main.mode !== 'play') return; ancTe.bgm.pause(); }; ////// 恢复背景音乐的播放 ////// control.prototype.resumeBgm = function (resumeTime) { - if (main.mode != 'play') return; + if (main.mode !== 'play') return; ancTe.bgm.resume(); }; ////// 更改背景音乐的播放 ////// control.prototype.triggerBgm = function () { - if (main.mode != 'play') return; + if (main.mode !== 'play') return; core.musicStatus.bgmStatus = !core.musicStatus.bgmStatus; if (core.musicStatus.bgmStatus) this.resumeBgm(); diff --git a/src/core/audio/bgm.ts b/src/core/audio/bgm.ts index 3ff50c3..89aab92 100644 --- a/src/core/audio/bgm.ts +++ b/src/core/audio/bgm.ts @@ -63,6 +63,7 @@ export class BgmController extends ResourceController { if (has(this.playing) || !this.lastBgm) return; const bgm = this.get(this.lastBgm); bgm.play(); + this.playing = this.lastBgm; } get(id: BgmIds) {