Improve handling of variant data overrides for mixed animated mode
parent
55f68c0ce6
commit
854de76467
|
@ -531,10 +531,23 @@ export default class BattleScene extends SceneBase {
|
||||||
.then(v => {
|
.then(v => {
|
||||||
Object.keys(v).forEach(k => variantData[k] = v[k]);
|
Object.keys(v).forEach(k => variantData[k] = v[k]);
|
||||||
if (this.experimentalSprites) {
|
if (this.experimentalSprites) {
|
||||||
const expTree = variantData['exp'];
|
const expVariantData = variantData['exp'];
|
||||||
Object.keys(expTree).forEach(ek => {
|
const traverseVariantData = (keys: string[]) => {
|
||||||
variantData[ek] = expTree[ek];
|
let variantTree = variantData;
|
||||||
});
|
let expTree = expVariantData;
|
||||||
|
keys.map((k: string, i: integer) => {
|
||||||
|
if (i < keys.length - 1) {
|
||||||
|
variantTree = variantTree[k];
|
||||||
|
expTree = expTree[k];
|
||||||
|
} else if (variantTree.hasOwnProperty(k) && expTree.hasOwnProperty(k)) {
|
||||||
|
if ([ 'back', 'female' ].includes(k))
|
||||||
|
traverseVariantData(keys.concat(k));
|
||||||
|
else
|
||||||
|
variantTree[k] = expTree[k];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.keys(expVariantData).forEach(ek => traverseVariantData([ ek ]));
|
||||||
}
|
}
|
||||||
Promise.resolve();
|
Promise.resolve();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue