细节完善

This commit is contained in:
kron
2025-08-15 11:23:23 +08:00
parent 2a9a373743
commit b46bc7aaa5
9 changed files with 121 additions and 80 deletions

View File

@@ -27,7 +27,6 @@ watch(
if (newVal.includes("蓝队")) key = "请蓝方射击";
if (key && sound.value) {
if (currentRoundEnded.value) {
currentRound.value += 1;
currentRoundEnded.value = false;
if (currentRound.value === 1) audioManager.play("第一轮");
if (currentRound.value === 2) audioManager.play("第二轮");
@@ -63,14 +62,17 @@ async function onReceiveMessage(messages = []) {
} else if (msg.constructor === MESSAGETYPES.WaitForAllReady) {
battleId.value = msg.id;
} else if (msg.constructor === MESSAGETYPES.AllReady) {
currentRoundEnded.value = true;
audioManager.play("比赛开始");
} else if (msg.constructor === MESSAGETYPES.MeleeAllReady) {
melee.value = true;
halfTime.value = false;
audioManager.play("比赛开始");
} else if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
currentRound.value += 1;
currentRoundEnded.value = true;
if (msg.preRoundResult && msg.preRoundResult.currentRound) {
currentRound.value = msg.preRoundResult.currentRound + 1;
currentRoundEnded.value = true;
}
} else if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
halfTime.value = true;
audioManager.play("中场休息");
@@ -113,7 +115,7 @@ onUnmounted(() => {
<view class="container">
<text>{{ tips }}</text>
<!-- <text> ({{ currentRound }}/{{ totalRound }}) </text> -->
<button hover-class="none" @click="updateSound">
<button v-if="!!tips" hover-class="none" @click="updateSound">
<image
:src="`../static/sound${sound ? '' : '-off'}-yellow.png`"
mode="widthFix"