refactor: Defaults

This commit is contained in:
cha0s 2021-01-27 22:32:52 -06:00
parent f70818ed69
commit 991bec522f
2 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,7 @@
"deepmerge": "^4.2.2",
"immutable": "^4.0.0-rc.12",
"kefir": "^3.8.8",
"lodash.get": "^4.4.2",
"matter-js": "0.14.2",
"poly-decomp": "0.3.0",
"proton-engine": "^4.2.1"

View File

@ -3,6 +3,7 @@ import {Ticker} from '@avocado/timing';
import {Trait} from '@avocado/traits';
import {compose} from '@latus/core';
import merge from 'deepmerge';
import get from 'lodash.get';
import K from 'kefir';
import Proton from '../proton';
@ -93,6 +94,7 @@ export default (latus) => class Emitter extends decorate(Trait) {
async emitParticleJson(json) {
const {Entity} = latus.get('%resources');
const isListed = get(json, 'traits.Emitted.params.listed', true);
return this.entity.emitParticleEntity(
await Entity.load(
merge(
@ -100,6 +102,7 @@ export default (latus) => class Emitter extends decorate(Trait) {
traits: {
Positioned: {},
Visible: {},
...(isListed ? {Listed: {}} : {}),
},
},
json,