mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Fix issues with ability bar and evolution screen
This commit is contained in:
parent
40cdf64271
commit
3fad55d24b
@ -211,6 +211,8 @@ export default class BattleScene extends Phaser.Scene {
|
|||||||
this.loadImage('starter_select_gen_cursor', 'ui');
|
this.loadImage('starter_select_gen_cursor', 'ui');
|
||||||
this.loadImage('starter_select_gen_cursor_highlight', 'ui');
|
this.loadImage('starter_select_gen_cursor_highlight', 'ui');
|
||||||
|
|
||||||
|
this.loadImage('default_bg', 'arenas');
|
||||||
|
|
||||||
// Load arena images
|
// Load arena images
|
||||||
Utils.getEnumValues(Biome).map(bt => {
|
Utils.getEnumValues(Biome).map(bt => {
|
||||||
const btKey = Biome[bt].toLowerCase();
|
const btKey = Biome[bt].toLowerCase();
|
||||||
|
@ -44,7 +44,7 @@ export class EvolutionPhase extends BattlePhase {
|
|||||||
|
|
||||||
this.evolutionContainer = (this.scene.ui.getHandler() as EvolutionSceneHandler).evolutionContainer;
|
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.evolutionBaseBg.setOrigin(0, 0);
|
||||||
this.evolutionContainer.add(this.evolutionBaseBg);
|
this.evolutionContainer.add(this.evolutionBaseBg);
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import { TextStyle, addTextObject } from "./text";
|
|||||||
|
|
||||||
const hiddenX = -91;
|
const hiddenX = -91;
|
||||||
const shownX = 10;
|
const shownX = 10;
|
||||||
|
const baseY = -116;
|
||||||
|
|
||||||
export default class AbilityBar extends Phaser.GameObjects.Container {
|
export default class AbilityBar extends Phaser.GameObjects.Container {
|
||||||
private bg: Phaser.GameObjects.Image;
|
private bg: Phaser.GameObjects.Image;
|
||||||
@ -15,7 +16,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
|
|||||||
public shown: boolean;
|
public shown: boolean;
|
||||||
|
|
||||||
constructor(scene: BattleScene) {
|
constructor(scene: BattleScene) {
|
||||||
super(scene, hiddenX, (-scene.game.canvas.height / 6) + 64);
|
super(scene, hiddenX, baseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
setup(): void {
|
setup(): void {
|
||||||
@ -43,9 +44,12 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
|
|||||||
if (this.shown)
|
if (this.shown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
(this.scene as BattleScene).fieldUI.bringToTop(this);
|
||||||
|
|
||||||
if (this.tween)
|
if (this.tween)
|
||||||
this.tween.stop();
|
this.tween.stop();
|
||||||
|
|
||||||
|
this.y = baseY + ((this.scene as BattleScene).currentBattle.double ? 14 : 0);
|
||||||
this.tween = this.scene.tweens.add({
|
this.tween = this.scene.tweens.add({
|
||||||
targets: this,
|
targets: this,
|
||||||
x: shownX,
|
x: shownX,
|
||||||
|
@ -14,6 +14,12 @@ export default class EvolutionSceneHandler extends UiHandler {
|
|||||||
this.scene.fieldUI.add(this.evolutionContainer);
|
this.scene.fieldUI.add(this.evolutionContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show(_args: any[]): void {
|
||||||
|
super.show(_args);
|
||||||
|
|
||||||
|
this.scene.fieldUI.bringToTop(this.evolutionContainer);
|
||||||
|
}
|
||||||
|
|
||||||
processInput(button: Button) {
|
processInput(button: Button) {
|
||||||
this.scene.ui.getMessageHandler().processInput(button);
|
this.scene.ui.getMessageHandler().processInput(button);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user