Some minor bug fixes

pull/1/head
Flashfyre 2023-04-12 21:44:12 -04:00
parent 6397a10998
commit 53d62056d2
3 changed files with 7 additions and 5 deletions

View File

@ -28,7 +28,7 @@ export class SelectStarterPhase extends BattlePhase {
start() { start() {
super.start(); super.start();
this.scene.sound.play('menu'); this.scene.sound.play('menu', { loop: true });
this.scene.ui.setMode(Mode.STARTER_SELECT, (starterSpecies: PokemonSpecies[]) => { this.scene.ui.setMode(Mode.STARTER_SELECT, (starterSpecies: PokemonSpecies[]) => {
const party = this.scene.getParty(); const party = this.scene.getParty();
@ -747,7 +747,7 @@ export class StatChangePhase extends PokemonPhase {
pokemon.enableMask(); pokemon.enableMask();
const pokemonMaskSprite = pokemon.maskSprite; const pokemonMaskSprite = pokemon.maskSprite;
const statSprite = this.scene.add.tileSprite((this.player ? 106 : 236) * 6, ((this.player ? 148 : 84) + (this.levels >= 1 ? 160 : 0)) * 6, 128, 288, 'battle_stats', this.stats.length > 1 ? 'mix' : BattleStat[this.stats[0]].toLowerCase()); const statSprite = this.scene.add.tileSprite((this.player ? 106 : 236) * 6, ((this.player ? 148 : 84) + (this.levels >= 1 ? 160 : 0)) * 6, 156, 316, 'battle_stats', this.stats.length > 1 ? 'mix' : BattleStat[this.stats[0]].toLowerCase());
statSprite.setAlpha(0); statSprite.setAlpha(0);
statSprite.setScale(6); statSprite.setScale(6);
statSprite.setOrigin(0.5, 1); statSprite.setOrigin(0.5, 1);

View File

@ -51,6 +51,8 @@ export default class FightUiHandler extends UiHandler {
if (button === Button.ACTION) { if (button === Button.ACTION) {
if (((this.scene as BattleScene).getCurrentPhase() as CommandPhase).handleCommand(Command.FIGHT, this.cursor)) if (((this.scene as BattleScene).getCurrentPhase() as CommandPhase).handleCommand(Command.FIGHT, this.cursor))
success = true; success = true;
else
ui.playError();
} else { } else {
ui.setMode(Mode.COMMAND); ui.setMode(Mode.COMMAND);
success = true; success = true;

View File

@ -56,9 +56,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.pokemonNumberText.setOrigin(0, 0); this.pokemonNumberText.setOrigin(0, 0);
this.starterSelectContainer.add(this.pokemonNumberText); this.starterSelectContainer.add(this.pokemonNumberText);
this.pokemonSprite = this.scene.add.sprite(53, 63, `pkmn__sub`);
this.starterSelectContainer.add(this.pokemonSprite);
this.pokemonNameText = addTextObject(this.scene, 6, 112, '', TextStyle.SUMMARY); this.pokemonNameText = addTextObject(this.scene, 6, 112, '', TextStyle.SUMMARY);
this.pokemonNameText.setOrigin(0, 0); this.pokemonNameText.setOrigin(0, 0);
this.starterSelectContainer.add(this.pokemonNameText); this.starterSelectContainer.add(this.pokemonNameText);
@ -133,6 +130,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
return icon; return icon;
}); });
this.pokemonSprite = this.scene.add.sprite(53, 63, `pkmn__sub`);
this.starterSelectContainer.add(this.pokemonSprite);
this.starterSelectMessageBoxContainer = this.scene.add.container(0, this.scene.game.canvas.height / 6); this.starterSelectMessageBoxContainer = this.scene.add.container(0, this.scene.game.canvas.height / 6);
this.starterSelectMessageBoxContainer.setVisible(false); this.starterSelectMessageBoxContainer.setVisible(false);
this.starterSelectContainer.add(this.starterSelectMessageBoxContainer); this.starterSelectContainer.add(this.starterSelectMessageBoxContainer);