mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-25 00:39:27 +02:00
Without exceed length with pokemon re-name in start-ui-handler.ts
This commit is contained in:
parent
f23a1b5f61
commit
d1ab218044
@ -1583,6 +1583,10 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
const name = decodeURIComponent(escape(atob(starterAttributes.nickname)));
|
||||
if (name.length > 0) {
|
||||
this.pokemonNameText.setText(name);
|
||||
while (this.pokemonNameText.displayWidth > 90) {
|
||||
const displayName = `${this.pokemonNameText.text.slice(0, this.pokemonNameText.text.endsWith(".") ? -2 : -1).trimEnd()}.`;
|
||||
this.pokemonNameText.setText(displayName);
|
||||
}
|
||||
} else {
|
||||
this.pokemonNameText.setText(this.lastSpecies.name);
|
||||
}
|
||||
@ -2663,6 +2667,10 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
if (starterAttributes?.nickname) {
|
||||
const name = decodeURIComponent(escape(atob(starterAttributes.nickname)));
|
||||
this.pokemonNameText.setText(name);
|
||||
while (this.pokemonNameText.displayWidth > 90) {
|
||||
const displayName = `${this.pokemonNameText.text.slice(0, this.pokemonNameText.text.endsWith(".") ? -2 : -1).trimEnd()}.`;
|
||||
this.pokemonNameText.setText(displayName);
|
||||
}
|
||||
} else {
|
||||
this.pokemonNameText.setText(species.name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user