Hide nicknames in battle tooltip (#2508)
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
This commit is contained in:
cooshaug 2025-09-17 23:42:45 +01:00 committed by GitHub
parent 2598694835
commit c779bd581d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -830,8 +830,10 @@ export class BattleTooltips {
genderBuf = ` <img src="${Dex.fxPrefix}gender-${gender.toLowerCase()}.png" alt="${gender}" width="7" height="10" class="pixelated" /> `;
}
let name = BattleLog.escapeHTML(pokemon.name);
if (pokemon.speciesForme !== pokemon.name) {
const ignoreNicks = this.battle.ignoreNicks || this.battle.ignoreOpponent;
const nickname = ignoreNicks ? Dex.species.get(pokemon.speciesForme).baseSpecies : pokemon.name;
let name = BattleLog.escapeHTML(nickname);
if (pokemon.speciesForme !== nickname) {
name += ` <small>(${BattleLog.escapeHTML(pokemon.speciesForme)})</small>`;
}