细节优化
This commit is contained in:
@@ -234,10 +234,10 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
.hit {
|
.hit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 3.4%;
|
width: 22rpx;
|
||||||
height: 3.4%;
|
height: 22rpx;
|
||||||
min-width: 3.4%;
|
min-width: 22rpx;
|
||||||
min-height: 3.4%;
|
min-height: 22rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -251,11 +251,12 @@ onMounted(() => {
|
|||||||
/* transform: translate(-50%, -50%); */
|
/* transform: translate(-50%, -50%); */
|
||||||
}
|
}
|
||||||
.hit > text {
|
.hit > text {
|
||||||
transform: scaleX(0.7) translateY(-0.5px);
|
transform: scaleX(0.7);
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
line-height: 22rpx;
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -57,6 +57,24 @@ async function onReceiveMessage(messages = []) {
|
|||||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||||
if (melee.value && msg.userId !== user.value.id) return;
|
if (melee.value && msg.userId !== user.value.id) return;
|
||||||
if (msg.userId === user.value.id) currentShot.value++;
|
if (msg.userId === user.value.id) currentShot.value++;
|
||||||
|
if (msg.battleInfo && msg.userId === user.value.id) {
|
||||||
|
const players = [
|
||||||
|
...(msg.battleInfo.blueTeam || []),
|
||||||
|
...(msg.battleInfo.redTeam || []),
|
||||||
|
];
|
||||||
|
const currentPlayer = players.find((p) => p.id === msg.userId);
|
||||||
|
currentShot.value = 0;
|
||||||
|
try {
|
||||||
|
if (
|
||||||
|
currentPlayer &&
|
||||||
|
currentPlayer.shotHistory &&
|
||||||
|
currentPlayer.shotHistory[msg.battleInfo.currentRound]
|
||||||
|
) {
|
||||||
|
currentShot.value =
|
||||||
|
currentPlayer.shotHistory[msg.battleInfo.currentRound].length;
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
if (!halfTime.value && msg.target) {
|
if (!halfTime.value && msg.target) {
|
||||||
currentSound.value = msg.target.ring
|
currentSound.value = msg.target.ring
|
||||||
? `${msg.target.ring}环`
|
? `${msg.target.ring}环`
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ async function onReceiveMessage(messages = []) {
|
|||||||
roundResults.value[currentRound.value - 1][
|
roundResults.value[currentRound.value - 1][
|
||||||
isRed ? "redArrows" : "blueArrows"
|
isRed ? "redArrows" : "blueArrows"
|
||||||
].push({ ...msg.target });
|
].push({ ...msg.target });
|
||||||
|
if (msg.battleInfo) recoverData(msg.battleInfo);
|
||||||
}
|
}
|
||||||
if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
|
if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
|
||||||
const result = msg.preRoundResult;
|
const result = msg.preRoundResult;
|
||||||
|
|||||||
Reference in New Issue
Block a user