sentry shield
Some checks failed
CI / checks (push) Failing after 5m39s

This commit is contained in:
Robin Appelman 2025-07-05 15:52:42 +02:00
commit 2580a3604a
4 changed files with 14 additions and 6 deletions

View file

@ -45,6 +45,7 @@ export function Building(props: BuildingProp) {
const teamColor = () => (props.building.team === Team.Red) ? '#a75d50' : '#5b818f';
if (!maxHealth) {
return null;
v
}
const transform = () => `translate(${scaledX()} ${scaledY()}) scale(${1 / props.scale})`;
@ -52,12 +53,16 @@ export function Building(props: BuildingProp) {
const alpha = () => props.building.health / maxHealth();
const imageOpacity = () => props.building.health === 0 ? 0 : (1 + alpha()) / 2;
const filter = () => props.building.shield ? ((props.building.team === Team.Red) ? 'url(#sofGlowRed)' : 'url(#sofGlowBlue)') : '';
try {
const image = () => getBuildingType(props.building.buildingType);
return <g transform={transform()}>
<circle r={16} stroke-width={1.5} stroke="white" fill={teamColor()}
opacity={alpha()}
stroke-dasharray={`${props.building.buildProgress} 100`}
filter={filter()}
/>
<image href={image()} class="player-icon" height={32} width={32} transform={`translate(-16 -16)`}
opacity={imageOpacity()}/>