Show if scopped
This commit is contained in:
parent
bd8de00f10
commit
61ea504f28
@ -77,6 +77,7 @@ const weaponIdMap = {
|
|||||||
49: "C4",
|
49: "C4",
|
||||||
0: "KNIFE"
|
0: "KNIFE"
|
||||||
};
|
};
|
||||||
|
|
||||||
// networking
|
// networking
|
||||||
websocket = null
|
websocket = null
|
||||||
if (location.protocol == 'https:') {
|
if (location.protocol == 'https:') {
|
||||||
@ -184,7 +185,7 @@ function drawPlayerBomb(pos, playerType) {
|
|||||||
ctx.fillText("[C4]", pos.x, textY);
|
ctx.fillText("[C4]", pos.x, textY);
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawPlayerName(pos, playerName, playerType, hasAwp, hasBomb) {
|
function drawPlayerName(pos, playerName, playerType, hasAwp, hasBomb, isScoped) {
|
||||||
if (!map) return;
|
if (!map) return;
|
||||||
|
|
||||||
if (zoomSet) {
|
if (zoomSet) {
|
||||||
@ -195,7 +196,6 @@ function drawPlayerName(pos, playerName, playerType, hasAwp, hasBomb) {
|
|||||||
textSize = 12;
|
textSize = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always position at the top
|
|
||||||
const textY = pos.y + 20;
|
const textY = pos.y + 20;
|
||||||
|
|
||||||
let displayName = playerName;
|
let displayName = playerName;
|
||||||
@ -208,8 +208,8 @@ function drawPlayerName(pos, playerName, playerType, hasAwp, hasBomb) {
|
|||||||
ctx.fillStyle = enemyColor;
|
ctx.fillStyle = enemyColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasBomb) {
|
if (isScoped) {
|
||||||
displayName += " [C4]";
|
displayName += " [SCOPED]";
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.font = `${textSize}px Arial`;
|
ctx.font = `${textSize}px Arial`;
|
||||||
@ -338,7 +338,8 @@ function render() {
|
|||||||
data.Player.playerName,
|
data.Player.playerName,
|
||||||
data.Player.playerType,
|
data.Player.playerType,
|
||||||
data.Player.hasAwp,
|
data.Player.hasAwp,
|
||||||
data.Player.hasBomb
|
data.Player.hasBomb,
|
||||||
|
data.Player.isScoped
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,10 +357,6 @@ function render() {
|
|||||||
data.Player.playerType
|
data.Player.playerType
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawNames && data.Player.playerName) {
|
|
||||||
drawPlayerName(data.Player.pos, data.Player.playerName, data.Player.playerType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user