From 113d134b337587bcceeb890b1b7f9c410c491d59 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Thu, 9 Jan 2025 00:57:27 +0100 Subject: [PATCH] UI changes to make dex pages work in legacy style --- public/images/ui/legacy/pokedex_summary_bg.png | Bin 0 -> 5225 bytes src/ui/abstact-option-select-ui-handler.ts | 16 ++++++++++------ src/ui/base-stats-overlay.ts | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 public/images/ui/legacy/pokedex_summary_bg.png diff --git a/public/images/ui/legacy/pokedex_summary_bg.png b/public/images/ui/legacy/pokedex_summary_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..690df1547c049fcdd7fad1f39322964e63910170 GIT binary patch literal 5225 zcmeHKdsGuw8lQw$cv%!8EWTz_*9SVuBpLFO2$%#(H5ef%Sg1~BCOASKBm)W5-BQ%; zs(XC2%C3*C_$)qF_Y}9vVg-?-qFA-H>$~EjRQIf}uE-uAuy+zb==PjdPyLTM=VtEx z?stFp`+nc=-ji8sOq&`W5*q?RP`Ex-n+`#oB+%c_3k1KnZnh5wuVbaAEG8Xy!w#q2 zLKjdlQ{tdt%0pWq$aC3he0RuEnD?wBN?rb!|FkG}=<`Y!jjXG>sFz&({i%>bUBknY zx`wTb^yS;qtJ{W$Z`pEn`gz5GCV{63G${Wl(&*jQ1nYqp-2etq)khy0!E-Wj{~ z$)kp1q-t(`yX9u|W_RP5VtKlpdxl$+yy48U?0jV+KItF)qP=H>DNon*d+(2zeW}hK z(j3G)7jvST^Jp!1eQ@la$3$1G|AJ=teq-Pd_O#F&p%Zpx8zyg@eH)~>nAT{FdX1(h zBap|&U$0iD9yLZSnUS$w7dL2VRN)EZq)R&8@M-+z^EU72&nZGn?u^3d)byO;0T;>_ zB`(hliq6X&krR;oAgD3dk2(XG{oo_6j@-acPaKX%CRb+)X=VU5)rD!wY& zq-c)&c*?@G1o~`wr2Lr#P!cdNf5SoiTjO&{OJ(9q8_ux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_3w=FV?vjw*UYD literal 0 HcmV?d00001 diff --git a/src/ui/abstact-option-select-ui-handler.ts b/src/ui/abstact-option-select-ui-handler.ts index 9542b5d6e55..3faea05be23 100644 --- a/src/ui/abstact-option-select-ui-handler.ts +++ b/src/ui/abstact-option-select-ui-handler.ts @@ -7,6 +7,7 @@ import * as Utils from "../utils"; import { argbFromRgba } from "@material/material-color-utilities"; import { Button } from "#enums/buttons"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; +import { UiTheme } from "#app/enums/ui-theme"; export interface OptionSelectConfig { xOffset?: number; @@ -52,7 +53,9 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { protected unskippedIndices: number[] = []; - protected defaultTextStyle: TextStyle = TextStyle.SETTINGS_VALUE; + protected defaultTextStyle: TextStyle = TextStyle.WINDOW; + + protected uiTheme: UiTheme; constructor(scene: BattleScene, mode: Mode | null) { @@ -67,6 +70,7 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { setup() { const ui = this.getUi(); + this.uiTheme = (this.scene as BattleScene).uiTheme; this.optionSelectContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 1, -48); this.optionSelectContainer.setName(`option-select-${this.mode ? Mode[this.mode] : "UNKNOWN"}`); @@ -80,7 +84,7 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { this.optionSelectIcons = []; - this.scale = getTextStyleOptions(TextStyle.WINDOW, (this.scene as BattleScene).uiTheme).scale; + this.scale = getTextStyleOptions(TextStyle.WINDOW, this.uiTheme).scale; this.setCursor(0); } @@ -123,8 +127,8 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { this.optionSelectText = addBBCodeTextObject( this.scene, 0, 0, options.map(o => o.item - ? `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true)}][color=${getTextColor(o.style ?? TextStyle.SETTINGS_VALUE)}] ${o.label}[/color]` - : `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true)}][color=${getTextColor(o.style ?? TextStyle.SETTINGS_VALUE)}]${o.label}[/color]` + ? `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true, this.uiTheme)}][color=${getTextColor(o.style ?? TextStyle.WINDOW, false, this.uiTheme)}] ${o.label}[/color]` + : `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true, this.uiTheme)}][color=${getTextColor(o.style ?? TextStyle.WINDOW, false, this.uiTheme)}]${o.label}[/color]` ).join("\n"), TextStyle.WINDOW, { maxLines: options.length, lineSpacing: 12 } ); @@ -137,8 +141,8 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler { if (this.config?.options && this.config?.options.length > (this.config?.maxOptions!)) { // TODO: is this bang correct? this.optionSelectText.setText(this.getOptionsWithScroll().map(o => o.item - ? `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true)}][color=${getTextColor(o.style ?? TextStyle.SETTINGS_VALUE)}] ${o.label}[/color]` - : `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true)}][color=${getTextColor(o.style ?? TextStyle.SETTINGS_VALUE)}]${o.label}[/color]` + ? `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true, this.uiTheme)}][color=${getTextColor(o.style ?? TextStyle.WINDOW, false, this.uiTheme)}] ${o.label}[/color]` + : `[shadow=${getTextColor(o.style ?? this.defaultTextStyle, true, this.uiTheme)}][color=${getTextColor(o.style ?? TextStyle.WINDOW, false, this.uiTheme)}]${o.label}[/color]` ).join("\n")); } diff --git a/src/ui/base-stats-overlay.ts b/src/ui/base-stats-overlay.ts index db0bffe8f8d..9bae1da7999 100644 --- a/src/ui/base-stats-overlay.ts +++ b/src/ui/base-stats-overlay.ts @@ -1,5 +1,5 @@ import BattleScene, { InfoToggle } from "../battle-scene"; -import { TextStyle, addTextObject, getTextColor } from "./text"; +import { TextStyle, addTextObject } from "./text"; import { addWindow } from "./ui-theme"; import * as Utils from "../utils"; import i18next from "i18next"; @@ -61,7 +61,7 @@ export default class BaseStatsOverlay extends Phaser.GameObjects.Container imple this.add(label); } - this.statsTotalLabel = addTextObject(scene, BORDER, BORDER + 6 * 15, "A", TextStyle.BATTLE_INFO, { color: getTextColor(TextStyle.MONEY_WINDOW) }); + this.statsTotalLabel = addTextObject(scene, BORDER, BORDER + 6 * 15, "A", TextStyle.MONEY_WINDOW); this.add(this.statsTotalLabel); // hide this component for now