mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
This commit is contained in:
parent
812f3cdd0e
commit
d33a8df45d
5 changed files with 99 additions and 17 deletions
|
|
@ -5,6 +5,8 @@ import {findMapAlias} from './MapBoundries';
|
|||
import {PlayerState, Header, WorldBoundaries, BuildingState, ProjectileState, CartState} from "./Data/Parser";
|
||||
import {Show} from "solid-js";
|
||||
import {Projectile} from "./Render/Cart";
|
||||
import {HealBeam} from "./Render/HealBeam";
|
||||
import {medics} from "./Render/PlayerSpec";
|
||||
|
||||
export interface MapRenderProps {
|
||||
header: Header;
|
||||
|
|
@ -28,6 +30,7 @@ export function MapRender(props: MapRenderProps) {
|
|||
const mapAlias = findMapAlias(props.header.map);
|
||||
const image = `${map_root}images/${mapAlias}.webp`;
|
||||
const background = `url(${image})`;
|
||||
const medicPlayers = () => medics(props.players);
|
||||
|
||||
return (
|
||||
<svg class="map-background" width={props.size.width} height={props.size.height}
|
||||
|
|
@ -65,10 +68,18 @@ export function MapRender(props: MapRenderProps) {
|
|||
</filter>
|
||||
</defs>
|
||||
|
||||
<For each={medicPlayers()}>{(player) =>
|
||||
<Show when={player.health}>
|
||||
<HealBeam player={player} mapBoundary={props.world} targetSize={props.size} scale={props.scale}
|
||||
players={props.players}
|
||||
/>
|
||||
</Show>
|
||||
}</For>
|
||||
<For each={props.players}>{(player) =>
|
||||
<Show when={player.health}>
|
||||
<PlayerDot player={player} mapBoundary={props.world} targetSize={props.size} scale={props.scale}
|
||||
onHover={props.onHover}
|
||||
players={props.players}
|
||||
highlighted={props.highlighted === player.info.userId}
|
||||
/>
|
||||
</Show>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue