Merge branch 'main' of https://github.com/pagefaultgames/pokerogue
commit
095667c7c9
|
@ -21,6 +21,7 @@ import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesF
|
|||
import AbilityBar from './ui/ability-bar';
|
||||
import { BlockItemTheftAbAttr, DoubleBattleChanceAbAttr, IncrementMovePriorityAbAttr, applyAbAttrs, initAbilities } from './data/ability';
|
||||
import { Abilities } from "./data/enums/abilities";
|
||||
import { allAbilities } from "./data/ability";
|
||||
import Battle, { BattleType, FixedBattleConfig, fixedBattles } from './battle';
|
||||
import { GameMode, GameModes, gameModes } from './game-mode';
|
||||
import FieldSpritePipeline from './pipelines/field-sprite';
|
||||
|
@ -808,6 +809,7 @@ export default class BattleScene extends SceneBase {
|
|||
const localizable: Localizable[] = [
|
||||
...allSpecies,
|
||||
...allMoves,
|
||||
...allAbilities,
|
||||
...Utils.getEnumValues(ModifierPoolType).map(mpt => getModifierPoolForType(mpt)).map(mp => Object.values(mp).flat().map(mt => mt.modifierType).filter(mt => 'localize' in mt).map(lpb => lpb as unknown as Localizable)).flat()
|
||||
];
|
||||
for (let item of localizable)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -8,6 +8,10 @@ import { move as enMove } from '../locales/en/move';
|
|||
import { move as esMove } from '../locales/es/move';
|
||||
import { move as frMove } from '../locales/fr/move';
|
||||
|
||||
import { ability as enAbility } from '../locales/en/ability';
|
||||
import { ability as esAbility } from '../locales/es/ability';
|
||||
import { ability as frAbility } from '../locales/fr/ability';
|
||||
|
||||
import { pokeball as enPokeball } from '../locales/en/pokeball';
|
||||
import { pokeball as esPokeball } from '../locales/es/pokeball';
|
||||
import { pokeball as frPokeball } from '../locales/fr/pokeball';
|
||||
|
@ -39,6 +43,15 @@ export interface MoveTranslationEntries {
|
|||
[key: string]: MoveTranslationEntry
|
||||
}
|
||||
|
||||
export interface AbilityTranslationEntry {
|
||||
name: string,
|
||||
description: string
|
||||
}
|
||||
|
||||
export interface AbilityTranslationEntries {
|
||||
[key: string]: AbilityTranslationEntry
|
||||
}
|
||||
|
||||
export interface Localizable {
|
||||
localize(): void;
|
||||
}
|
||||
|
@ -74,6 +87,7 @@ export function initI18n(): void {
|
|||
en: {
|
||||
menu: enMenu,
|
||||
move: enMove,
|
||||
ability: enAbility,
|
||||
pokeball: enPokeball,
|
||||
pokemon: enPokemon,
|
||||
pokemonStat: enPokemonStat,
|
||||
|
@ -82,6 +96,7 @@ export function initI18n(): void {
|
|||
es: {
|
||||
menu: esMenu,
|
||||
move: esMove,
|
||||
ability: esAbility,
|
||||
pokeball: esPokeball,
|
||||
pokemon: esPokemon,
|
||||
pokemonStat: esPokemonStat,
|
||||
|
@ -90,6 +105,7 @@ export function initI18n(): void {
|
|||
fr: {
|
||||
menu: frMenu,
|
||||
move: frMove,
|
||||
ability: frAbility,
|
||||
pokeball: frPokeball,
|
||||
pokemon: frPokemon,
|
||||
pokemonStat: frPokemonStat,
|
||||
|
@ -109,6 +125,7 @@ declare module 'i18next' {
|
|||
resources: {
|
||||
menu: typeof enMenu;
|
||||
move: typeof enMove;
|
||||
ability: typeof enAbility;
|
||||
pokeball: typeof enPokeball;
|
||||
pokemon: typeof enPokemon;
|
||||
pokemonStat: typeof enPokemonStat;
|
||||
|
|
|
@ -6,12 +6,14 @@ import { Mode } from "./ui";
|
|||
import UiHandler from "./ui-handler";
|
||||
import * as Utils from "../utils";
|
||||
import { CommandPhase } from "../phases";
|
||||
import { MoveCategory } from "#app/data/move.js";
|
||||
|
||||
export default class FightUiHandler extends UiHandler {
|
||||
private movesContainer: Phaser.GameObjects.Container;
|
||||
private typeIcon: Phaser.GameObjects.Sprite;
|
||||
private ppText: Phaser.GameObjects.Text;
|
||||
private cursorObj: Phaser.GameObjects.Image;
|
||||
private moveCategoryIcon: Phaser.GameObjects.Sprite;
|
||||
|
||||
protected fieldIndex: integer = 0;
|
||||
protected cursor2: integer = 0;
|
||||
|
@ -26,10 +28,15 @@ export default class FightUiHandler extends UiHandler {
|
|||
this.movesContainer = this.scene.add.container(18, -38.7);
|
||||
ui.add(this.movesContainer);
|
||||
|
||||
this.typeIcon = this.scene.add.sprite((this.scene.game.canvas.width / 6) - 33, -31, 'types', 'unknown');
|
||||
this.typeIcon = this.scene.add.sprite((this.scene.game.canvas.width / 6) - 41, -31, 'types', 'unknown');
|
||||
this.typeIcon.setVisible(false);
|
||||
ui.add(this.typeIcon);
|
||||
|
||||
this.moveCategoryIcon = this.scene.add.sprite((this.scene.game.canvas.width / 6) - 19, -31, 'categories', 'physical');
|
||||
this.moveCategoryIcon.setVisible(false);
|
||||
ui.add(this.moveCategoryIcon);
|
||||
|
||||
|
||||
this.ppText = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 18, -15.5, ' / ', TextStyle.WINDOW);
|
||||
this.ppText.setOrigin(1, 0.5);
|
||||
this.ppText.setVisible(false);
|
||||
|
@ -120,16 +127,19 @@ export default class FightUiHandler extends UiHandler {
|
|||
|
||||
if (hasMove) {
|
||||
const pokemonMove = moveset[cursor];
|
||||
this.typeIcon.setTexture('types', Type[pokemonMove.getMove().type].toLowerCase());
|
||||
this.typeIcon.setTexture('types', Type[pokemonMove.getMove().type].toLowerCase()).setScale(0.65);
|
||||
this.moveCategoryIcon.setTexture('categories', MoveCategory[pokemonMove.getMove().category].toLowerCase()).setScale(0.8);
|
||||
|
||||
const maxPP = pokemonMove.getMovePp();
|
||||
const pp = maxPP - pokemonMove.ppUsed;
|
||||
|
||||
|
||||
this.ppText.setText(`${Utils.padInt(pp, 2, ' ')}/${Utils.padInt(maxPP, 2, ' ')}`);
|
||||
}
|
||||
|
||||
this.typeIcon.setVisible(hasMove);
|
||||
this.ppText.setVisible(hasMove);
|
||||
this.moveCategoryIcon.setVisible(hasMove);
|
||||
|
||||
this.cursorObj.setPosition(13 + (cursor % 2 === 1 ? 100 : 0), -31 + (cursor >= 2 ? 15 : 0));
|
||||
|
||||
|
@ -151,6 +161,7 @@ export default class FightUiHandler extends UiHandler {
|
|||
this.clearMoves();
|
||||
this.typeIcon.setVisible(false);
|
||||
this.ppText.setVisible(false);
|
||||
this.moveCategoryIcon.setVisible(false);
|
||||
this.eraseCursor();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue