fix:修复关闭音乐不能马上生效的问题(尝试使用cursor编程)

This commit is contained in:
ShakeFlower 2026-03-19 15:37:56 +08:00
parent 2469c9ae3c
commit 8d584025b7

View File

@ -8963,7 +8963,24 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
},
bgm: {
getName: () => '音乐:' + (core.musicStatus.bgmStatus ? '开' : '关'),
effect: core.actions._clickSwitchs_sounds_bgm,
effect: function () {
const bc =
core.plugin.audioSystem &&
core.plugin.audioSystem.bgmController;
if (bc) {
const saved = bc.transitionTime;
bc.setTransitionTime(0);
try {
core.actions._clickSwitchs_sounds_bgm();
} finally {
setTimeout(function () {
bc.setTransitionTime(saved);
}, 0);
}
} else {
core.actions._clickSwitchs_sounds_bgm();
}
},
text: '播放背景音乐。',
replay: false,
},