细节完善
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user