Fix shiny variant back sprite color mapping not working
parent
df7a6be654
commit
4950dd0e73
|
@ -381,7 +381,7 @@ export abstract class PokemonSpeciesForm {
|
||||||
frameRate: 12,
|
frameRate: 12,
|
||||||
repeat: -1
|
repeat: -1
|
||||||
});
|
});
|
||||||
let spritePath = this.getSpriteAtlasPath(female, formIndex, shiny, variant);
|
let spritePath = this.getSpriteAtlasPath(female, formIndex, shiny, variant).replace('variant/', '').replace(/_[1-3]$/, '');
|
||||||
const useExpSprite = scene.experimentalSprites && scene.hasExpSprite(spriteKey);
|
const useExpSprite = scene.experimentalSprites && scene.hasExpSprite(spriteKey);
|
||||||
if (useExpSprite)
|
if (useExpSprite)
|
||||||
spritePath = `exp/${spritePath}`;
|
spritePath = `exp/${spritePath}`;
|
||||||
|
|
|
@ -309,7 +309,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
if (this.shiny) {
|
if (this.shiny) {
|
||||||
const populateVariantColors = (key: string, back: boolean = false): Promise<void> => {
|
const populateVariantColors = (key: string, back: boolean = false): Promise<void> => {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const battleSpritePath = this.getBattleSpriteAtlasPath(back, ignoreOverride);
|
const battleSpritePath = this.getBattleSpriteAtlasPath(back, ignoreOverride).replace('variant/', '').replace(/_[1-3]$/, '');
|
||||||
let variantSet: VariantSet;
|
let variantSet: VariantSet;
|
||||||
let config = variantData;
|
let config = variantData;
|
||||||
battleSpritePath.split('/').map(p => config ? config = config[p] : null);
|
battleSpritePath.split('/').map(p => config ? config = config[p] : null);
|
||||||
|
@ -326,9 +326,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
if (this.isPlayer())
|
if (this.isPlayer())
|
||||||
Promise.all([ populateVariantColors(this.getBattleSpriteKey()), populateVariantColors(this.getBattleSpriteKey(true)) ]).then(() => updateFusionPaletteAndResolve());
|
Promise.all([ populateVariantColors(this.getBattleSpriteKey(false)), populateVariantColors(this.getBattleSpriteKey(true), true) ]).then(() => updateFusionPaletteAndResolve());
|
||||||
else
|
else
|
||||||
populateVariantColors(this.getBattleSpriteKey()).then(() => updateFusionPaletteAndResolve());
|
populateVariantColors(this.getBattleSpriteKey(false)).then(() => updateFusionPaletteAndResolve());
|
||||||
} else
|
} else
|
||||||
updateFusionPaletteAndResolve();
|
updateFusionPaletteAndResolve();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue