feat: selfEntity back on

This commit is contained in:
cha0s 2019-04-24 17:01:11 -05:00
parent 5b32d32a5e
commit 429a0efb68
2 changed files with 5 additions and 5 deletions

View File

@ -76,7 +76,7 @@ const DebugUi = ({
>
<Connection Parser={Parser} socket={socket} />
<Timers app={app} />
{/* <SelfEntity app={app} /> */}
<SelfEntity app={app} />
</div>
</div>;
};

View File

@ -44,12 +44,12 @@ const decorate = compose(
const SelfEntityComponent = ({app}) => {
const selfEntity = useSelfEntity(app);
const position = usePropertyChange(selfEntity, 'position', [0, 0]);
const roundedPosition = Vector.round(position);
const x = usePropertyChange(selfEntity, 'x', 0, (x) => Math.round(x));
const y = usePropertyChange(selfEntity, 'y', 0, (y) => Math.round(y));
return <div className="self-entity unselectable">
<div className="location">
<div className="x">{roundedPosition[0]}</div>
<div className="y">{roundedPosition[1]}</div>
<div className="x">{x}</div>
<div className="y">{y}</div>
</div>
</div>;
}