细节优化

This commit is contained in:
kron
2025-11-06 16:08:02 +08:00
parent cf95e8c046
commit 5cefd8b36d
3 changed files with 25 additions and 5 deletions

View File

@@ -234,10 +234,10 @@ onMounted(() => {
}
.hit {
position: absolute;
width: 3.4%;
height: 3.4%;
min-width: 3.4%;
min-height: 3.4%;
width: 22rpx;
height: 22rpx;
min-width: 22rpx;
min-height: 22rpx;
border-radius: 50%;
border: 1px solid #fff;
z-index: 1;
@@ -251,11 +251,12 @@ onMounted(() => {
/* transform: translate(-50%, -50%); */
}
.hit > text {
transform: scaleX(0.7) translateY(-0.5px);
transform: scaleX(0.7);
display: block;
font-weight: bold;
width: 100%;
text-align: center;
line-height: 22rpx;
}
.header {
width: 100%;

View File

@@ -57,6 +57,24 @@ async function onReceiveMessage(messages = []) {
if (msg.constructor === MESSAGETYPES.ShootResult) {
if (melee.value && msg.userId !== user.value.id) return;
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) {
currentSound.value = msg.target.ring
? `${msg.target.ring}`