From 56b24c70b6c7b5ddc1c51b6bdaa20c01d7fa2810 Mon Sep 17 00:00:00 2001 From: Mistmemo <114654503+LeoDoby@users.noreply.github.com> Date: Wed, 1 May 2024 16:50:13 +0200 Subject: [PATCH] fix double battle iv scanner color (#379) * Add color for the IV scanner add a new color SUMMARY_GREEN in text.js, add the green color if the iv of the pokemon is better than the iv on the starter of that pokemon Co-authored-by: EmoUsedHM01 <131687820+emousedhm01@users.noreply.github.com> * fix battle-message-ui-handler.ts formatting * fix missing similicon battle-message-ui-handler.ts * modified so it take a boolean instead of doing lot of else if battle-message-ui-handler.ts * Fix iv scanner only doing color for the right pokemon in double fight --------- Co-authored-by: EmoUsedHM01 <131687820+emousedhm01@users.noreply.github.com> --- src/ui/battle-message-ui-handler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index 7819017d8..5e2cb5651 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -210,7 +210,7 @@ export default class BattleMessageUiHandler extends MessageUiHandler { } else shownStats = stats; for (let s of stats) - levelUpStatsValuesText += `${shownStats.indexOf(s) > -1 ? this.getIvDescriptor(ivs[s], s) : '???'}\n`; + levelUpStatsValuesText += `${shownStats.indexOf(s) > -1 ? this.getIvDescriptor(ivs[s], s, pokemonId) : '???'}\n`; this.levelUpStatsValuesContent.text = levelUpStatsValuesText; this.levelUpStatsIncrContent.setVisible(false); this.levelUpStatsContainer.setVisible(true); @@ -223,8 +223,8 @@ export default class BattleMessageUiHandler extends MessageUiHandler { }); } - getIvDescriptor(value: integer, typeIv: integer): string { - const starterSpecies = this.scene.getEnemyPokemon().species.getRootSpeciesId(true); + getIvDescriptor(value: integer, typeIv: integer, pokemonId: integer): string { + const starterSpecies = this.scene.getPokemonById(pokemonId).species.getRootSpeciesId(true); const starterIvs: number[] = this.scene.gameData.dexData[starterSpecies].ivs; const uiTheme = (this.scene as BattleScene).uiTheme; // Assuming uiTheme is accessible