Revert "[QoL] Add red color to the quantity if the item is at it's held limit…" (#2178)

This reverts commit 048993b2c2.
This commit is contained in:
Tempoanon 2024-06-13 11:57:39 -04:00 committed by GitHub
parent 0e794fe2fc
commit 855ceda192
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 19 deletions

View File

@ -1,7 +1,7 @@
import { CommandPhase, SelectModifierPhase } from "../phases";
import BattleScene from "../battle-scene";
import { PlayerPokemon, PokemonMove } from "../field/pokemon";
import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "./text";
import { addTextObject, TextStyle } from "./text";
import { Command } from "./command-ui-handler";
import MessageUiHandler from "./message-ui-handler";
import { Mode } from "./ui";
@ -20,7 +20,6 @@ import {Button} from "../enums/buttons";
import { applyChallenges, ChallengeType } from "#app/data/challenge.js";
import MoveInfoOverlay from "./move-info-overlay";
import i18next from "i18next";
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
const defaultMessage = "Choose a Pokémon.";
@ -801,7 +800,7 @@ export default class PartyUiHandler extends MessageUiHandler {
optionEndIndex = this.options.length;
let widestOptionWidth = 0;
const optionTexts: BBCodeText[] = [];
const optionTexts: Phaser.GameObjects.Text[] = [];
for (let o = optionStartIndex; o < optionEndIndex; o++) {
const option = this.options[this.options.length - (o + 1)];
@ -846,31 +845,20 @@ export default class PartyUiHandler extends MessageUiHandler {
} else {
const itemModifier = itemModifiers[option];
optionName = itemModifier.type.name;
/** For every item that has stack bigger than 1, display the current quantity selection */
if (this.transferQuantitiesMax[option] > 1) {
optionName += ` (${this.transferQuantities[option]})`;
}
}
const yCoord = -6 - 16 * o;
const optionText = addBBCodeTextObject(this.scene, 0, yCoord - 16, optionName, TextStyle.WINDOW, { maxLines: 1 });
const optionText = addTextObject(this.scene, 0, yCoord - 16, optionName, TextStyle.WINDOW);
if (altText) {
optionText.setColor("#40c8f8");
optionText.setShadowColor("#006090");
}
optionText.setOrigin(0, 0);
/** For every item that has stack bigger than 1, display the current quantity selection */
if (this.partyUiMode === PartyUiMode.MODIFIER_TRANSFER && this.transferQuantitiesMax[option] > 1) {
const itemModifier = itemModifiers[option];
let amountText = ` (${this.transferQuantities[option]})`;
/** If the amount held is the maximum, display the count in red */
if (this.transferQuantitiesMax[option] === itemModifier.getMaxHeldItemCount(this.scene.getParty()[0])) {
amountText = `[color=${getTextColor(TextStyle.SUMMARY_RED)}]${amountText}[/color]`;
}
optionText.setText(optionName + amountText);
}
optionText.setText(`[shadow]${optionText.text}[/shadow]`);
optionTexts.push(optionText);
widestOptionWidth = Math.max(optionText.displayWidth, widestOptionWidth);