From 2cf8a75609ed61aaf4f4d79b9677471c26efb813 Mon Sep 17 00:00:00 2001 From: RedstonewolfX <108761527+RedstonewolfX@users.noreply.github.com> Date: Sat, 13 Jul 2024 17:58:21 -0400 Subject: [PATCH] Push all updates --- src/loading-scene.ts | 89 +++++++++++++++++++++++++++ src/phases.ts | 14 +++-- src/ui/save-slot-select-ui-handler.ts | 10 +++ 3 files changed, 109 insertions(+), 4 deletions(-) diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 15cd295d23c..a684713acfd 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -23,6 +23,60 @@ import { initVouchers } from "./system/voucher"; import { Biome } from "#enums/biome"; import { TrainerType } from "#enums/trainer-type"; +const biomePanelIDs: string[] = [ + "town", + "plains", + "grass", + "tall_grass", + "metropolis", + "forest", + "sea", + "swamp", + "beach", + "lake", + "seabed", + "mountain", + "badlands", + "cave", + "desert", + "ice_cave", + "meadow", + "power_plant", + "volcano", + "graveyard", + "dojo", + "factory", + "ruins", + "wasteland", + "abyss", + "space", + "construction_site", + "jungle", + "fairy_cave", + "temple", + "slum", + "snowy_forest", + "", + "", + "", + "", + "", + "", + "", + "", + "island", + "laboratory", + "", + "", + "", + "", + "", + "", + "", + "", + "end" +] + export class LoadingScene extends SceneBase { readonly LOAD_EVENTS = Phaser.Loader.Events; @@ -53,6 +107,41 @@ export class LoadingScene extends SceneBase { this.loadImage(`window_${w}${getWindowVariantSuffix(wv)}`, "ui/windows"); } } + //this.loadImage(`abyss_panel`, "ui/windows"); + //this.loadImage(`badlands_panel`, "ui/windows"); + //this.loadImage(`beach_panel`, "ui/windows"); + //this.loadImage(`cave_panel`, "ui/windows"); + //this.loadImage(`construction_site_panel`, "ui/windows"); + //this.loadImage(`desert_panel`, "ui/windows"); + //this.loadImage(`dojo_panel`, "ui/windows"); + //this.loadImage(`end_panel`, "ui/windows"); + //this.loadImage(`factory_panel`, "ui/windows"); + //this.loadImage(`fairy_cave_panel`, "ui/windows"); + //this.loadImage(`forest_panel`, "ui/windows"); + //this.loadImage(`grass_panel`, "ui/windows"); + //this.loadImage(`graveyard_panel`, "ui/windows"); + //this.loadImage(`ice_cave_panel`, "ui/windows"); + //this.loadImage(`island_panel`, "ui/windows"); + //this.loadImage(`jungle_panel`, "ui/windows"); + //this.loadImage(`laboratory_panel`, "ui/windows"); + //this.loadImage(`lake_panel`, "ui/windows"); + //this.loadImage(`meadow_panel`, "ui/windows"); + //this.loadImage(`metropolis_panel`, "ui/windows"); + //this.loadImage(`mountain_panel`, "ui/windows"); + //this.loadImage(`plains_panel`, "ui/windows"); + //this.loadImage(`power_plant_panel`, "ui/windows"); + //this.loadImage(`ruins_panel`, "ui/windows"); + //this.loadImage(`sea_panel`, "ui/windows"); + //this.loadImage(`seabed_panel`, "ui/windows"); + //this.loadImage(`slum_panel`, "ui/windows"); + //this.loadImage(`snowy_forest_panel`, "ui/windows"); + //this.loadImage(`space_panel`, "ui/windows"); + //this.loadImage(`swamp_panel`, "ui/windows"); + //this.loadImage(`tall_grass_panel`, "ui/windows"); + //this.loadImage(`temple_panel`, "ui/windows"); + //this.loadImage(`town_panel`, "ui/windows"); + //this.loadImage(`volcano_panel`, "ui/windows"); + //this.loadImage(`wasteland_panel`, "ui/windows"); this.loadAtlas("namebox", "ui"); this.loadImage("pbinfo_player", "ui"); this.loadImage("pbinfo_player_stats", "ui"); diff --git a/src/phases.ts b/src/phases.ts index 840ccf9c318..9c9654206ca 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -341,13 +341,19 @@ export class TitlePhase extends Phase { this.loaded = false; } - setBiomeByType(biome: Biome): void { + setBiomeByType(biome: Biome, override?: boolean): void { + if (!this.scene.menuChangesBiome && !override) + return; this.scene.arenaBg.setTexture(`${getBiomeKey(biome)}_bg`); } - setBiomeByName(biome: string): void { + setBiomeByName(biome: string, override?: boolean): void { + if (!this.scene.menuChangesBiome && !override) + return; this.scene.arenaBg.setTexture(`${getBiomeKey(Utils.getEnumValues(Biome)[Utils.getEnumKeys(Biome).indexOf(biome)])}_bg`); } - setBiomeByFile(sessionData: SessionSaveData): void { + setBiomeByFile(sessionData: SessionSaveData, override?: boolean): void { + if (!this.scene.menuChangesBiome && !override) + return; this.scene.arenaBg.setTexture(`${getBiomeKey(sessionData.arena.biome)}_bg`); } @@ -365,7 +371,7 @@ export class TitlePhase extends Phase { this.scene.gameData.getSession(loggedInUser.lastSessionSlot).then(sessionData => { if (sessionData) { this.lastSessionData = sessionData; - //this.setBiomeByFile(sessionData) + this.setBiomeByFile(sessionData, true) this.setBiomeByType(Biome.END) } this.showOptions(); diff --git a/src/ui/save-slot-select-ui-handler.ts b/src/ui/save-slot-select-ui-handler.ts index 50d7ce00dca..8adfa4a72e7 100644 --- a/src/ui/save-slot-select-ui-handler.ts +++ b/src/ui/save-slot-select-ui-handler.ts @@ -293,6 +293,7 @@ class SessionSlot extends Phaser.GameObjects.Container { public hasData: boolean; public wv: integer; private loadingLabel: Phaser.GameObjects.Text; + public backer: Phaser.GameObjects.Image constructor(scene: BattleScene, slotId: integer, ypos: integer, autoSlot?: integer) { super(scene, 0, ypos * 56); @@ -307,6 +308,15 @@ class SessionSlot extends Phaser.GameObjects.Container { const slotWindow = addWindow(this.scene, 0, 0, 304, 52); this.add(slotWindow); + if (this.slotId == 0) { + //this.backer = this.scene.add.image(0, 0, `sea_panel`) + //this.backer.setOrigin(0.5, 0.5) + //this.backer.setScale(304/909, 52/155) + //this.backer.setPosition(102*1.5 - 1, 26) + //this.backer.setSize(304, 52) + //this.add(this.backer) + } + this.loadingLabel = addTextObject(this.scene, 152, 26, i18next.t("saveSlotSelectUiHandler:loading"), TextStyle.WINDOW); this.loadingLabel.setOrigin(0.5, 0.5); this.add(this.loadingLabel);