spy info, medigun name
All checks were successful
CI / checks (push) Successful in 59s

This commit is contained in:
Robin Appelman 2025-06-28 19:20:37 +02:00
commit bdc35d0907
16 changed files with 143 additions and 27 deletions

View file

@ -1,4 +1,4 @@
import {PlayerState, WorldBoundaries, Team} from "../Data/Parser";
import {Class, PlayerState, SpyState, Team, WorldBoundaries} from "../Data/Parser";
export interface PlayerProp {
player: PlayerState;
@ -52,6 +52,9 @@ export function Player(props: PlayerProp) {
const transform = () => `translate(${scaledX()} ${scaledY()}) scale(${1 / props.scale})`;
const rotate = () => `rotate(${270 - props.player.angle})`;
const filter = () => props.player.ubered ? ((props.player.team === Team.Red) ? 'url(#sofGlowRed)' : 'url(#sofGlowBlue)') : '';
const circleStrokeStyle = () => props.player.playerClass === Class.Spy ? `${(props.player.class_data as SpyState).cloak} 100` : "none";
const teamHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRed)` : `url(#diagonalHatchBlue)`
const fill = () => props.player.cloaked ? teamHatch() : teamColor();
return <g
onmouseover={() => props.onHover(props.player.info.userId)}
@ -61,7 +64,8 @@ export function Player(props: PlayerProp) {
opacity={imageOpacity()}
transform={rotate()}/>
<circle r={16} stroke-width={props.highlighted ? 4 : 1.5} stroke="white"
fill={teamColor()}
stroke-dasharray={circleStrokeStyle()}
fill={fill()}
opacity={alpha()}
filter={filter()}
/>