disguise team
All checks were successful
CI / checks (push) Successful in 56s

This commit is contained in:
Robin Appelman 2025-06-29 14:38:26 +02:00
commit 7af264a85b
4 changed files with 27 additions and 8 deletions

8
package-lock.json generated
View file

@ -6,7 +6,7 @@
"": {
"dependencies": {
"@demostf/edit": "0.2.0",
"@demostf/tf-demos-viewer": "^0.3.0",
"@demostf/tf-demos-viewer": "^0.3.1",
"@lutaok/solid-modal": "^0.1.1",
"@solid-primitives/autofocus": "^0.0.111",
"@solid-primitives/keyboard": "^1.2.8",
@ -23,9 +23,9 @@
"integrity": "sha512-s9wk3QVm+aTpMhIyfdGIHRm5qHp7FQ1dq/Jn0fms+lXsB1xY3wgjfWH+5gwRjjo/Dd3UMNM0o3atjO2uh+CxOQ=="
},
"node_modules/@demostf/tf-demos-viewer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@demostf/tf-demos-viewer/-/tf-demos-viewer-0.3.0.tgz",
"integrity": "sha512-ZhGYc9DCZLW0jX+ltqHYdk1h4TNe8gU8pTkTcfZki+yFPj3Af1dfHW09LLMHwaW6bvihoLkp7hXHuCa3neSMeg=="
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/@demostf/tf-demos-viewer/-/tf-demos-viewer-0.3.1.tgz",
"integrity": "sha512-AhU72a7IcYCMUnjHfRL0kKfOZee1uN0ik8do/TUGX+0zcCuBfwf1HC3OqP0G3b5g2XmGhbXHIQgaGJIDwttWWA=="
},
"node_modules/@lutaok/solid-modal": {
"version": "0.1.1",

View file

@ -1,7 +1,7 @@
{
"dependencies": {
"@demostf/edit": "0.2.0",
"@demostf/tf-demos-viewer": "^0.3.0",
"@demostf/tf-demos-viewer": "^0.3.1",
"@lutaok/solid-modal": "^0.1.1",
"@solid-primitives/autofocus": "^0.0.111",
"@solid-primitives/keyboard": "^1.2.8",

View file

@ -42,7 +42,17 @@ export function MapRender(props: MapRenderProps) {
</pattern>
<pattern id="diagonalHatchBlue" patternUnits="userSpaceOnUse" width="8" height="8"
patternTransform="rotate(45 0 0)">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#5b818f; stroke-width:8"/>
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#5b818f; stroke-width:10"/>
</pattern>
<pattern id="diagonalHatchRedBlue" patternUnits="userSpaceOnUse" width="8" height="8"
patternTransform="rotate(45 0 0)">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#a75d50; stroke-width:12"/>
<line x1="8" y1="0" x2="8" y2="10" style="stroke:#5b818f; stroke-width:4"/>
</pattern>
<pattern id="diagonalHatchBlueRed" patternUnits="userSpaceOnUse" width="8" height="8"
patternTransform="rotate(45 0 0)">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#5b818f; stroke-width:12"/>
<line x1="8" y1="0" x2="8" y2="10" style="stroke:#a75d50; stroke-width:4"/>
</pattern>

View file

@ -63,8 +63,17 @@ export function Player(props: PlayerProp) {
return "none";
}
}
const teamHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRed)` : `url(#diagonalHatchBlue)`
const fill = () => props.player.cloaked ? teamHatch() : teamColor();
const teamHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRed)` : `url(#diagonalHatchBlue)`;
const teamDisguiseHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRedBlue)` : `url(#diagonalHatchBlueRed)`;
const fill = () => {
if (props.player.cloaked) {
return teamHatch();
}
if (props.player.playerClass === Class.Spy && (props.player.class_data as SpyState).disguise_team !== props.player.team && (props.player.class_data as SpyState).disguise_class > 0) {
return teamDisguiseHatch();
}
return teamColor();
};
return (
<g