habitica-self-host/website/common/script/content/appearance/index.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-10-08 14:57:10 +00:00
import forOwn from 'lodash/forOwn';
import clone from 'lodash/clone';
import hair from './hair';
2019-10-09 14:51:17 +00:00
import shirts from './shirt';
import skins from './skin';
import sizes from './size';
import backgrounds from './backgrounds';
import chairs from './chair';
2019-10-08 14:57:10 +00:00
const reorderedBgs = {};
2019-10-08 14:57:10 +00:00
forOwn(backgrounds, (value, key) => {
forOwn(value, (bgObject, bgKey) => {
const bg = clone(bgObject);
bg.set = {
text: key,
key,
setPrice: 15,
};
reorderedBgs[bgKey] = bg;
});
});
2019-10-08 14:57:10 +00:00
const appearances = {
2020-05-07 14:15:11 +00:00
hair, NO appearances.hair.{bangs|base|beard|color|flower|mustache}[key].set.setPrice and .key
shirt: shirts, appearances.shirt[key].set.setPrice and .key
size: sizes, NO, does not have cost
skin: skins, OK, appearances.skin[key].set.setPrice and .key
chair: chairs, NO, does not have cost
background: reorderedBgs, OK appearances.backgroud[key].set.setPrice and .key
};
2020-05-07 14:15:11 +00:00
^ check with get(path) after validating name because hair are nested for example
^ if item.set exist -> use item.setPrice
^ what about other items in set?
2019-10-01 15:53:48 +00:00
export default appearances;