Fix issues with ability bar and evolution screen

This commit is contained in:
Flashfyre 2023-05-17 16:20:09 -04:00
parent 40cdf64271
commit 3fad55d24b
4 changed files with 14 additions and 2 deletions

View File

@ -211,6 +211,8 @@ export default class BattleScene extends Phaser.Scene {
this.loadImage('starter_select_gen_cursor', 'ui');
this.loadImage('starter_select_gen_cursor_highlight', 'ui');
this.loadImage('default_bg', 'arenas');
// Load arena images
Utils.getEnumValues(Biome).map(bt => {
const btKey = Biome[bt].toLowerCase();

View File

@ -44,7 +44,7 @@ export class EvolutionPhase extends BattlePhase {
this.evolutionContainer = (this.scene.ui.getHandler() as EvolutionSceneHandler).evolutionContainer;
this.evolutionBaseBg = this.scene.add.image(0, 0, 'plains_bg');
this.evolutionBaseBg = this.scene.add.image(0, 0, 'default_bg');
this.evolutionBaseBg.setOrigin(0, 0);
this.evolutionContainer.add(this.evolutionBaseBg);

View File

@ -4,6 +4,7 @@ import { TextStyle, addTextObject } from "./text";
const hiddenX = -91;
const shownX = 10;
const baseY = -116;
export default class AbilityBar extends Phaser.GameObjects.Container {
private bg: Phaser.GameObjects.Image;
@ -15,7 +16,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
public shown: boolean;
constructor(scene: BattleScene) {
super(scene, hiddenX, (-scene.game.canvas.height / 6) + 64);
super(scene, hiddenX, baseY);
}
setup(): void {
@ -43,9 +44,12 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
if (this.shown)
return;
(this.scene as BattleScene).fieldUI.bringToTop(this);
if (this.tween)
this.tween.stop();
this.y = baseY + ((this.scene as BattleScene).currentBattle.double ? 14 : 0);
this.tween = this.scene.tweens.add({
targets: this,
x: shownX,

View File

@ -13,6 +13,12 @@ export default class EvolutionSceneHandler extends UiHandler {
this.evolutionContainer = this.scene.add.container(0, -this.scene.game.canvas.height / 6);
this.scene.fieldUI.add(this.evolutionContainer);
}
show(_args: any[]): void {
super.show(_args);
this.scene.fieldUI.bringToTop(this.evolutionContainer);
}
processInput(button: Button) {
this.scene.ui.getMessageHandler().processInput(button);