mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Undo all changes
This commit is contained in:
parent
adb2f90d96
commit
1b22cafee3
@ -54,7 +54,6 @@ import {InputsController} from "./inputs-controller";
|
||||
import {UiInputs} from "./ui-inputs";
|
||||
import { NewArenaEvent } from "./events/battle-scene";
|
||||
import ArenaFlyout from "./ui/arena-flyout";
|
||||
import TeamBar from "./ui/trainer-team-bar";
|
||||
import { EaseType } from "#enums/ease-type";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattleSpec } from "#enums/battle-spec";
|
||||
@ -221,7 +220,6 @@ export default class BattleScene extends SceneBase {
|
||||
private modifierBar: ModifierBar;
|
||||
private enemyModifierBar: ModifierBar;
|
||||
public arenaFlyout: ArenaFlyout;
|
||||
public trainerBar: TeamBar;
|
||||
|
||||
private fieldOverlay: Phaser.GameObjects.Rectangle;
|
||||
private shopOverlay: Phaser.GameObjects.Rectangle;
|
||||
@ -472,9 +470,6 @@ export default class BattleScene extends SceneBase {
|
||||
this.luckLabelText.setVisible(false);
|
||||
this.fieldUI.add(this.luckLabelText);
|
||||
|
||||
this.trainerBar = new TeamBar(this);
|
||||
this.fieldUI.add(this.trainerBar);
|
||||
this.fieldUI.moveBelow<Phaser.GameObjects.GameObject>(this.trainerBar, this.fieldOverlay);
|
||||
this.arenaFlyout = new ArenaFlyout(this);
|
||||
this.fieldUI.add(this.arenaFlyout);
|
||||
this.fieldUI.moveBelow<Phaser.GameObjects.GameObject>(this.arenaFlyout, this.fieldOverlay);
|
||||
@ -1400,11 +1395,6 @@ export default class BattleScene extends SceneBase {
|
||||
this.fieldUI.moveBelow<any>(gameObject, this.fieldOverlay);
|
||||
}
|
||||
processInfoButton(pressed: boolean): void {
|
||||
if (pressed) {
|
||||
this.trainerBar.tempToggleFlyout(false)
|
||||
} else {
|
||||
this.trainerBar.revertFlyout()
|
||||
}
|
||||
this.arenaFlyout.toggleFlyout(pressed);
|
||||
}
|
||||
|
||||
|
@ -1,72 +0,0 @@
|
||||
import BattleScene from "../battle-scene";
|
||||
import {addTextObject, TextStyle} from "./text";
|
||||
import i18next from "i18next";
|
||||
import * as Utils from "#app/utils";
|
||||
import { EnemyPokemon } from "#app/field/pokemon.js";
|
||||
|
||||
export default class TeamBar extends Phaser.GameObjects.Container {
|
||||
// Public vars
|
||||
public party: EnemyPokemon[];
|
||||
public gamescene: BattleScene;
|
||||
|
||||
// Private vars
|
||||
private bg: Phaser.GameObjects.NineSlice;
|
||||
private teamIcons: Array<Phaser.GameObjects.Sprite[]> = [];
|
||||
private tween: Phaser.Tweens.Tween;
|
||||
private components: any[] = [];
|
||||
private shown: boolean = false;
|
||||
private overridden: boolean = false;
|
||||
|
||||
// Constructor
|
||||
constructor(scene: Phaser.Scene) {
|
||||
super(scene, -200, -107);
|
||||
this.gamescene = scene as BattleScene;
|
||||
this.components = [this]
|
||||
this.bg = this.scene.add.nineslice(-5, -5, "ability_bar_left", null, 200, 70, 10, 10);
|
||||
this.bg.setOrigin(0, 0);
|
||||
this.add(this.bg);
|
||||
}
|
||||
|
||||
/*
|
||||
Show or hide the BGM bar.
|
||||
@param {boolean} visible Whether to show or hide the BGM bar.
|
||||
*/
|
||||
public toggleFlyout(visible: boolean): void {
|
||||
//console.log("Update team bar", visible)
|
||||
if (this.overridden) return; // Don't toggle the state if it has been overridden
|
||||
this.shown = visible
|
||||
this.scene.tweens.add({
|
||||
targets: this,
|
||||
x: visible ? -100 : -200,
|
||||
duration: 500,
|
||||
ease: "Sine.easeInOut",
|
||||
onUpdate: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
public tempToggleFlyout(visible: boolean): void {
|
||||
this.overridden = true
|
||||
//console.log("Update team bar", visible)
|
||||
this.scene.tweens.add({
|
||||
targets: this,
|
||||
x: visible ? -100 : -200,
|
||||
duration: 500,
|
||||
ease: "Sine.easeInOut",
|
||||
onUpdate: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
public revertFlyout(): void {
|
||||
var visible = this.shown
|
||||
this.overridden = false
|
||||
//console.log("Update team bar", visible)
|
||||
this.scene.tweens.add({
|
||||
targets: this,
|
||||
x: visible ? -100 : -200,
|
||||
duration: 500,
|
||||
ease: "Sine.easeInOut",
|
||||
onUpdate: () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user