Show Default Pokemon icon for missing shiny icon (#802)
parent
9e453c5b0f
commit
e195c6d799
|
@ -646,7 +646,16 @@ export default class BattleScene extends SceneBase {
|
|||
const container = this.add.container(x, y);
|
||||
|
||||
const icon = this.add.sprite(0, 0, pokemon.getIconAtlasKey(ignoreOverride));
|
||||
icon.setFrame(pokemon.getIconId(true));
|
||||
icon.setFrame(pokemon.getIconId(true));
|
||||
// Temporary fix to show pokemon's default icon if variant icon doesn't exist
|
||||
if (icon.frame.name != pokemon.getIconId(true)) {
|
||||
console.log(`${pokemon.name}'s variant icon does not exist. Replacing with default.`)
|
||||
const temp = pokemon.shiny;
|
||||
pokemon.shiny = false;
|
||||
icon.setTexture(pokemon.getIconAtlasKey(ignoreOverride));
|
||||
icon.setFrame(pokemon.getIconId(true));
|
||||
pokemon.shiny = temp;
|
||||
}
|
||||
icon.setOrigin(0.5, 0);
|
||||
|
||||
container.add(icon);
|
||||
|
|
|
@ -2492,6 +2492,13 @@ export class PlayerPokemon extends Pokemon {
|
|||
constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex: integer, formIndex: integer, gender: Gender, shiny: boolean, variant: Variant, ivs: integer[], nature: Nature, dataSource: Pokemon | PokemonData) {
|
||||
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource);
|
||||
|
||||
if (Overrides.SHINY_OVERRIDE) {
|
||||
this.shiny = true;
|
||||
this.initShinySparkle();
|
||||
if (Overrides.VARIANT_OVERRIDE)
|
||||
this.variant = Overrides.VARIANT_OVERRIDE;
|
||||
}
|
||||
|
||||
if (!dataSource)
|
||||
this.generateAndPopulateMoveset();
|
||||
this.generateCompatibleTms();
|
||||
|
|
|
@ -39,6 +39,8 @@ export const STARTING_LEVEL_OVERRIDE: integer = 0;
|
|||
export const ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||
export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||
export const MOVESET_OVERRIDE: Array<Moves> = [];
|
||||
export const SHINY_OVERRIDE: boolean = false;
|
||||
export const VARIANT_OVERRIDE: Variant = 0;
|
||||
|
||||
/**
|
||||
* OPPONENT / ENEMY OVERRIDES
|
||||
|
|
|
@ -1518,7 +1518,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
|
||||
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite)
|
||||
.setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant));
|
||||
|
||||
// Temporary fix to show pokemon's default icon if variant icon doesn't exist
|
||||
if ((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).frame.name != species.getIconId(female, formIndex, shiny, variant)) {
|
||||
console.log(`${species.name}'s variant icon does not exist. Replacing with default.`);
|
||||
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setTexture(species.getIconAtlasKey(formIndex, false, variant));
|
||||
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setFrame(species.getIconId(female, formIndex, false, variant));
|
||||
}
|
||||
this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
|
||||
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE);
|
||||
this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1;
|
||||
|
|
Loading…
Reference in New Issue