diff --git a/src/ui/run-info-ui-handler.ts b/src/ui/run-info-ui-handler.ts index 25210277edc..7a183a11d29 100644 --- a/src/ui/run-info-ui-handler.ts +++ b/src/ui/run-info-ui-handler.ts @@ -13,8 +13,9 @@ import { BattleType } from "../battle"; import { TrainerVariant } from "../field/trainer"; import { Challenges } from "#enums/challenges"; import { getLuckString, getLuckTextTint } from "../modifier/modifier-type"; -import RoundRectangle from "phaser3-rex-plugins/plugins/roundrectangle.js"; +import RoundRectangle from "phaser3-rex-plugins/plugins/roundrectangle"; import { Type, getTypeRgb } from "../data/type"; +import { TypeColor, TypeShadow } from "#app/enums/color"; import { getNatureStatMultiplier, getNatureName } from "../data/nature"; import { getVariantTint } from "#app/data/variant"; import { PokemonHeldItemModifier, TerastallizeModifier } from "../modifier/modifier"; @@ -373,15 +374,16 @@ export default class RunInfoUiHandler extends UiHandler { break; case GameModes.CHALLENGE: modeText.appendText(`${i18next.t("gameMode:challenge")}`, false); - modeText.appendText(`\t\t${i18next.t("runHistory:challengeRules")}: `); + modeText.appendText(`${i18next.t("runHistory:challengeRules")}: `); + modeText.setWrapMode(1); // wrap by word + modeText.setWrapWidth(500); const rules: string[] = this.challengeParser(); if (rules) { for (let i = 0; i < rules.length; i++) { - const newline = i > 0 && i%2 === 0; if (i > 0) { - modeText.appendText(" + ", newline); + modeText.appendText(" + ", false); } - modeText.appendText(rules[i], newline); + modeText.appendText(rules[i], false); } } break; @@ -470,14 +472,18 @@ export default class RunInfoUiHandler extends UiHandler { rules.push(i18next.t(`runHistory:challengeMonoGen${this.runInfo.challenges[i].value}`)); break; case Challenges.SINGLE_TYPE: - rules.push(i18next.t(`pokemonInfo:Type.${Type[this.runInfo.challenges[i].value-1]}` as const)); + const typeRule = Type[this.runInfo.challenges[i].value-1]; + const typeTextColor = `[color=${TypeColor[typeRule]}]`; + const typeShadowColor = `[shadow=${TypeShadow[typeRule]}]`; + const typeText = typeTextColor + typeShadowColor + i18next.t(`pokemonInfo:Type.${typeRule}`)!+"[/color]"+"[/shadow]"; + rules.push(typeText); break; case Challenges.FRESH_START: rules.push(i18next.t("challenges:freshStart.name")); break; case Challenges.INVERSE_BATTLE: // - rules.push(i18next.t("challenges:inverseBattle.shortName").split("").reverse().join("")); + rules.push(i18next.t("challenges:inverseBattle.shortName")); break; } } @@ -628,7 +634,7 @@ export default class RunInfoUiHandler extends UiHandler { // Pokemon Held Items - not displayed by default // Endless/Endless Spliced have a different scale because Pokemon tend to accumulate more items in these runs. const heldItemsScale = (this.runInfo.gameMode === GameModes.SPLICED_ENDLESS || this.runInfo.gameMode === GameModes.ENDLESS) ? 0.25 : 0.5; - const heldItemsContainer = this.scene.add.container(-82, 6); + const heldItemsContainer = this.scene.add.container(-82, 2); const heldItemsList : PokemonHeldItemModifier[] = []; if (this.runInfo.modifiers.length) { for (const m of this.runInfo.modifiers) { @@ -648,6 +654,9 @@ export default class RunInfoUiHandler extends UiHandler { break; } const itemIcon = item?.getIcon(this.scene, true); + if (item?.stackCount < item?.getMaxHeldItemCount(pokemon) && itemIcon.list[1] instanceof Phaser.GameObjects.BitmapText) { + itemIcon.list[1].clearTint(); + } itemIcon.setScale(heldItemsScale); itemIcon.setPosition((index%19) * 10, row * 10); heldItemsContainer.add(itemIcon);