mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
highlight player dot/spec on hover
This commit is contained in:
parent
04ae714282
commit
3644dbda6e
7 changed files with 355 additions and 298 deletions
|
|
@ -16,6 +16,8 @@ export interface MapRenderProps {
|
|||
},
|
||||
world: WorldBoundaries;
|
||||
scale: number;
|
||||
onHover: (userId: number) => void;
|
||||
highlighted: number;
|
||||
}
|
||||
|
||||
const map_root = document.querySelector('[data-maps]').getAttribute('data-maps');
|
||||
|
|
@ -30,7 +32,10 @@ export function MapRender(props: MapRenderProps) {
|
|||
style={{"background-image": background}}>
|
||||
<For each={props.players}>{(player) =>
|
||||
<Show when={player.health}>
|
||||
<PlayerDot player={player} mapBoundary={props.world} targetSize={props.size} scale={props.scale}/>
|
||||
<PlayerDot player={player} mapBoundary={props.world} targetSize={props.size} scale={props.scale}
|
||||
onHover={props.onHover}
|
||||
highlighted={props.highlighted === player.info.userId}
|
||||
/>
|
||||
</Show>
|
||||
}</For>
|
||||
<For each={props.buildings}>{(building) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue