mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-04 02:34:13 +02:00
some basic viewer
This commit is contained in:
parent
2dee28d022
commit
5910b2f35a
45 changed files with 1089 additions and 1436 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import {BuildingState, WorldBoundaries, BuildingType, Team} from "@demostf/parser-worker";
|
||||
import {BuildingState, WorldBoundaries, BuildingType, Team} from "../Data/Parser";
|
||||
import {Show} from "solid-js";
|
||||
|
||||
export interface BuildingProp {
|
||||
building: BuildingState;
|
||||
|
|
@ -54,17 +55,15 @@ export function Building({building, mapBoundary, targetSize, scale}: BuildingPro
|
|||
const alpha = building.health / maxHealth;
|
||||
try {
|
||||
const image = getIcon(building);
|
||||
|
||||
const angle = (building.angle) ?
|
||||
<polygon points="-6,14 0, 16 6,14 0,24" fill="white"
|
||||
transform={`rotate(${270 - building.angle})`}/> : '';
|
||||
|
||||
return <g transform={`translate(${scaledX} ${scaledY}) scale(${1 / scale})`}
|
||||
opacity={alpha}>
|
||||
{angle}
|
||||
<image href={image} class={"player-icon"} height={32}
|
||||
width={32}
|
||||
transform={`translate(-16 -16)`}/>
|
||||
<image href={image} className={"player-icon"} height={32}
|
||||
width={32}
|
||||
transform={`translate(-16 -16)`}/>
|
||||
<Show when={building.angle}>
|
||||
<polygon points="-6,14 0, 16 6,14 0,24" fill="white"
|
||||
transform={`rotate(${270 - building.angle})`}/>
|
||||
</Show>
|
||||
</g>
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue