refactor: targeting ghost

This commit is contained in:
cha0s 2024-08-01 00:40:06 -05:00
parent 30caab6c9e
commit 93cb69e99a
2 changed files with 7 additions and 4 deletions

View File

@ -71,16 +71,16 @@ export default function Ecs({camera, monopolizers, particleWorker, scale}) {
y={position.y}
/>
)}
<Entities
monopolizers={monopolizers}
particleWorker={particleWorker}
/>
{projected?.length > 0 && layers[0] && (
<TargetingGhost
projected={projected}
tileLayer={layers[0]}
/>
)}
<Entities
monopolizers={monopolizers}
particleWorker={particleWorker}
/>
</Container>
)
}

View File

@ -4,6 +4,8 @@ import {PixiComponent} from '@pixi/react';
import {useRadians} from '@/react/context/radians.js';
import {deferredLighting} from './lights.js';
const tileSize = {x: 16, y: 16};
const TargetingGhostInternal = PixiComponent('TargetingGhost', {
@ -25,6 +27,7 @@ const TargetingGhostInternal = PixiComponent('TargetingGhost', {
const container = new Container();
container.alpha = 0.4;
container.addChild(target, targetInner);
container.parentGroup = deferredLighting.diffuseGroup;
return container;
},
applyProps: (container, oldProps, {x, y, radians}) => {