refactor: selfEntity
This commit is contained in:
parent
20837ea2f0
commit
f106371fca
|
@ -28,7 +28,7 @@ const MenuComponent = ({app}) => {
|
|||
opened ? 'open' : '',
|
||||
)}>
|
||||
<Inventory selfEntity={selfEntity} />
|
||||
<QuickStatus app={app} />
|
||||
<QuickStatus selfEntity={selfEntity} />
|
||||
<WorldTime worldTime={app.worldTime} />
|
||||
<Hotbar selfEntity={selfEntity} />
|
||||
</div>
|
||||
|
|
|
@ -11,8 +11,7 @@ const decorate = compose(
|
|||
contempo(require('./quick-status.raw.scss').default),
|
||||
);
|
||||
|
||||
const QuickStatusComponent = ({app}) => {
|
||||
const selfEntity = usePropertyChange(app, 'selfEntity');
|
||||
const QuickStatusComponent = ({selfEntity}) => {
|
||||
const life = usePropertyChange(selfEntity, 'life', 0);
|
||||
const maxLife = usePropertyChange(selfEntity, 'maxLife', 0);
|
||||
const width = life / maxLife;
|
||||
|
|
Loading…
Reference in New Issue
Block a user