update:补充乱斗语音

This commit is contained in:
2026-07-03 17:03:51 +08:00
parent 8c6374b2c5
commit 6aa3c6fd6c
5 changed files with 47 additions and 15 deletions
+6 -1
View File
@@ -38,6 +38,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
halfRest: {
type: Boolean,
default: false,
},
onStop: {
type: Function,
default: () => {},
@@ -136,8 +140,9 @@ const updateSound = () => {
async function onReceiveMessage(msg) {
if (Array.isArray(msg)) return;
if (msg.type === MESSAGETYPESV2.BattleStart) {
const audioKey = props.melee && (halfTime.value || props.halfRest) ? "下半场开始" : "比赛开始";
halfTime.value = false;
audioManager.play("比赛开始");
audioManager.play(audioKey);
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
audioManager.play("比赛结束", false);
} else if (msg.type === MESSAGETYPESV2.ShootResult) {