mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-06 07:29:30 +02:00
Merge branch 'beta' into add-change-password
This commit is contained in:
commit
62ac2f6042
@ -25,3 +25,4 @@ ignore:
|
||||
- .github
|
||||
- .git
|
||||
- public
|
||||
- dist
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 362b2c4fcc20b31a7be6c2dab537055fbaeb247f
|
||||
Subproject commit e2fbba17ea7a96068970ea98a8a84ed3e25b6f07
|
@ -8,20 +8,14 @@ import type { Variant } from "#sprites/variant";
|
||||
* Data pertaining to a Pokemon's Illusion.
|
||||
*/
|
||||
export interface IllusionData {
|
||||
basePokemon: {
|
||||
/** The actual name of the Pokemon */
|
||||
name: string;
|
||||
/** The actual nickname of the Pokemon */
|
||||
nickname: string;
|
||||
/** Whether the base pokemon is shiny or not */
|
||||
shiny: boolean;
|
||||
/** The shiny variant of the base pokemon */
|
||||
variant: Variant;
|
||||
/** Whether the fusion species of the base pokemon is shiny or not */
|
||||
fusionShiny: boolean;
|
||||
/** The variant of the fusion species of the base pokemon */
|
||||
fusionVariant: Variant;
|
||||
};
|
||||
/** The name of pokemon featured in the illusion */
|
||||
name: string;
|
||||
/** The nickname of the pokemon featured in the illusion */
|
||||
nickname: string;
|
||||
/** Whether the pokemon featured in the illusion is shiny or not */
|
||||
shiny: boolean;
|
||||
/** The variant of the pokemon featured in the illusion */
|
||||
variant: Variant;
|
||||
/** The species of the illusion */
|
||||
species: SpeciesId;
|
||||
/** The formIndex of the illusion */
|
||||
@ -34,6 +28,10 @@ export interface IllusionData {
|
||||
fusionSpecies?: PokemonSpecies;
|
||||
/** The fusionFormIndex of the illusion */
|
||||
fusionFormIndex?: number;
|
||||
/** Whether the fusion species of the pokemon featured in the illusion is shiny or not */
|
||||
fusionShiny?: boolean;
|
||||
/** The variant of the fusion species of the pokemon featured in the illusion */
|
||||
fusionVariant?: Variant;
|
||||
/** The fusionGender of the illusion if it's a fusion */
|
||||
fusionGender?: Gender;
|
||||
/** The level of the illusion (not used currently) */
|
||||
|
10
src/@types/ui.ts
Normal file
10
src/@types/ui.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import type Phaser from "phaser";
|
||||
import type InputText from "phaser3-rex-plugins/plugins/gameobjects/dom/inputtext/InputText";
|
||||
|
||||
export interface TextStyleOptions {
|
||||
scale: number;
|
||||
styleOptions: Phaser.Types.GameObjects.Text.TextStyle | InputText.IConfig;
|
||||
shadowColor: string;
|
||||
shadowXpos: number;
|
||||
shadowYpos: number;
|
||||
}
|
@ -67,6 +67,7 @@ import { PokemonType } from "#enums/pokemon-type";
|
||||
import { ShopCursorTarget } from "#enums/shop-cursor-target";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { TrainerSlot } from "#enums/trainer-slot";
|
||||
import { TrainerType } from "#enums/trainer-type";
|
||||
import { TrainerVariant } from "#enums/trainer-variant";
|
||||
@ -132,7 +133,7 @@ import { CharSprite } from "#ui/char-sprite";
|
||||
import { PartyExpBar } from "#ui/party-exp-bar";
|
||||
import { PokeballTray } from "#ui/pokeball-tray";
|
||||
import { PokemonInfoContainer } from "#ui/pokemon-info-container";
|
||||
import { addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { addTextObject, getTextColor } from "#ui/text";
|
||||
import { UI } from "#ui/ui";
|
||||
import { addUiThemeOverrides } from "#ui/ui-theme";
|
||||
import {
|
||||
@ -236,6 +237,7 @@ export class BattleScene extends SceneBase {
|
||||
public enableTouchControls = false;
|
||||
public enableVibration = false;
|
||||
public showBgmBar = true;
|
||||
public hideUsername = false;
|
||||
/** Determines the selected battle style. */
|
||||
public battleStyle: BattleStyle = BattleStyle.SWITCH;
|
||||
/**
|
||||
|
@ -15,6 +15,7 @@ import { SpeciesFormChangeAbilityTrigger, SpeciesFormChangeWeatherTrigger } from
|
||||
import { Gender } from "#data/gender";
|
||||
import { getPokeballName } from "#data/pokeball";
|
||||
import { pokemonFormChanges } from "#data/pokemon-forms";
|
||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "#data/status-effect";
|
||||
import { TerrainType } from "#data/terrain";
|
||||
import type { Weather } from "#data/weather";
|
||||
@ -6001,8 +6002,13 @@ export class IllusionPreSummonAbAttr extends PreSummonAbAttr {
|
||||
const party: Pokemon[] = (pokemon.isPlayer() ? globalScene.getPlayerParty() : globalScene.getEnemyParty()).filter(
|
||||
p => p.isAllowedInBattle(),
|
||||
);
|
||||
const lastPokemon: Pokemon = party.filter(p => p !== pokemon).at(-1) || pokemon;
|
||||
pokemon.setIllusion(lastPokemon);
|
||||
let illusionPokemon: Pokemon | PokemonSpecies;
|
||||
if (pokemon.hasTrainer()) {
|
||||
illusionPokemon = party.filter(p => p !== pokemon).at(-1) || pokemon;
|
||||
} else {
|
||||
illusionPokemon = globalScene.arena.randomSpecies(globalScene.currentBattle.waveIndex, pokemon.level);
|
||||
}
|
||||
pokemon.setIllusion(illusionPokemon);
|
||||
}
|
||||
|
||||
/** @returns Whether the illusion can be applied. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { TextStyle } from "#ui/text";
|
||||
import type { TextStyle } from "#enums/text-style";
|
||||
|
||||
export class TextDisplay {
|
||||
speaker?: string;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { TextStyle } from "#enums/text-style";
|
||||
import { UiTheme } from "#enums/ui-theme";
|
||||
import type { TextStyle } from "#ui/text";
|
||||
import { getTextWithColors } from "#ui/text";
|
||||
import { isNullOrUndefined } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { Nature } from "#enums/nature";
|
||||
import { EFFECTIVE_STATS, getShortenedStatKey, Stat } from "#enums/stat";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiTheme } from "#enums/ui-theme";
|
||||
import { getBBCodeFrag, TextStyle } from "#ui/text";
|
||||
import { getBBCodeFrag } from "#ui/text";
|
||||
import { toReadableString } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
59
src/enums/text-style.ts
Normal file
59
src/enums/text-style.ts
Normal file
@ -0,0 +1,59 @@
|
||||
export const TextStyle = Object.freeze({
|
||||
MESSAGE: 1,
|
||||
WINDOW: 2,
|
||||
WINDOW_ALT: 3,
|
||||
WINDOW_BATTLE_COMMAND: 4,
|
||||
BATTLE_INFO: 5,
|
||||
PARTY: 6,
|
||||
PARTY_RED: 7,
|
||||
PARTY_CANCEL_BUTTON: 8,
|
||||
INSTRUCTIONS_TEXT: 9,
|
||||
MOVE_LABEL: 10,
|
||||
SUMMARY: 11,
|
||||
SUMMARY_DEX_NUM: 12,
|
||||
SUMMARY_DEX_NUM_GOLD: 13,
|
||||
SUMMARY_ALT: 14,
|
||||
SUMMARY_HEADER: 15,
|
||||
SUMMARY_RED: 16,
|
||||
SUMMARY_BLUE: 17,
|
||||
SUMMARY_PINK: 18,
|
||||
SUMMARY_GOLD: 19,
|
||||
SUMMARY_GRAY: 20,
|
||||
SUMMARY_GREEN: 21,
|
||||
SUMMARY_STATS: 22,
|
||||
SUMMARY_STATS_BLUE: 23,
|
||||
SUMMARY_STATS_PINK: 24,
|
||||
SUMMARY_STATS_GOLD: 25,
|
||||
LUCK_VALUE: 26,
|
||||
STATS_HEXAGON: 27,
|
||||
GROWTH_RATE_TYPE: 28,
|
||||
MONEY: 29, // Money default styling (pale yellow)
|
||||
MONEY_WINDOW: 30, // Money displayed in Windows (needs different colors based on theme)
|
||||
HEADER_LABEL: 31,
|
||||
STATS_LABEL: 32,
|
||||
STATS_VALUE: 33,
|
||||
SETTINGS_VALUE: 34,
|
||||
SETTINGS_LABEL: 35,
|
||||
SETTINGS_LABEL_NAVBAR: 36,
|
||||
SETTINGS_SELECTED: 37,
|
||||
SETTINGS_LOCKED: 38,
|
||||
EGG_LIST: 39,
|
||||
EGG_SUMMARY_NAME: 40,
|
||||
EGG_SUMMARY_DEX: 41,
|
||||
STARTER_VALUE_LIMIT: 42,
|
||||
TOOLTIP_TITLE: 43,
|
||||
TOOLTIP_CONTENT: 44,
|
||||
FILTER_BAR_MAIN: 45,
|
||||
MOVE_INFO_CONTENT: 46,
|
||||
MOVE_PP_FULL: 47,
|
||||
MOVE_PP_HALF_FULL: 48,
|
||||
MOVE_PP_NEAR_EMPTY: 49,
|
||||
MOVE_PP_EMPTY: 50,
|
||||
SMALLER_WINDOW_ALT: 51,
|
||||
BGM_BAR: 52,
|
||||
PERFECT_IV: 53,
|
||||
ME_OPTION_DEFAULT: 54, // Default style for choices in ME
|
||||
ME_OPTION_SPECIAL: 55, // Style for choices with special requirements in ME
|
||||
SHADOW_TEXT: 56 // to obscure unavailable options
|
||||
})
|
||||
export type TextStyle = typeof TextStyle[keyof typeof TextStyle];
|
@ -1,9 +1,10 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { BattlerIndex } from "#enums/battler-index";
|
||||
import { HitResult } from "#enums/hit-result";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { Pokemon } from "#field/pokemon";
|
||||
import type { DamageResult } from "#types/damage-result";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { fixedInt, formatStat } from "#utils/common";
|
||||
|
||||
type TextAndShadowArr = [string | null, string | null];
|
||||
|
@ -5,10 +5,11 @@ import { coerceArray, fixedInt, randInt } from "#utils/common";
|
||||
export class PokemonSpriteSparkleHandler {
|
||||
private sprites: Set<Phaser.GameObjects.Sprite>;
|
||||
|
||||
private counterTween?: Phaser.Tweens.Tween;
|
||||
|
||||
setup(): void {
|
||||
this.sprites = new Set();
|
||||
|
||||
globalScene.tweens.addCounter({
|
||||
this.counterTween = globalScene.tweens.addCounter({
|
||||
duration: fixedInt(200),
|
||||
from: 0,
|
||||
to: 1,
|
||||
@ -78,4 +79,12 @@ export class PokemonSpriteSparkleHandler {
|
||||
this.sprites.delete(s);
|
||||
}
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
this.removeAll();
|
||||
if (this.counterTween) {
|
||||
this.counterTween.destroy();
|
||||
this.counterTween = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -442,10 +442,9 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @returns The name to render for this {@linkcode Pokemon}.
|
||||
*/
|
||||
getNameToRender(useIllusion = true) {
|
||||
const name: string =
|
||||
!useIllusion && this.summonData.illusion ? this.summonData.illusion.basePokemon.name : this.name;
|
||||
const nickname: string =
|
||||
!useIllusion && this.summonData.illusion ? this.summonData.illusion.basePokemon.nickname : this.nickname;
|
||||
const illusion = this.summonData.illusion;
|
||||
const name = useIllusion ? (illusion?.name ?? this.name) : this.name;
|
||||
const nickname: string = useIllusion ? (illusion?.nickname ?? this.nickname) : this.nickname;
|
||||
try {
|
||||
if (nickname) {
|
||||
return decodeURIComponent(escape(atob(nickname))); // TODO: Remove `atob` and `escape`... eventually...
|
||||
@ -463,7 +462,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @returns The {@linkcode PokeballType} that will be shown when this Pokemon is sent out into battle.
|
||||
*/
|
||||
getPokeball(useIllusion = false): PokeballType {
|
||||
return useIllusion && this.summonData.illusion ? this.summonData.illusion.pokeball : this.pokeball;
|
||||
return useIllusion ? (this.summonData.illusion?.pokeball ?? this.pokeball) : this.pokeball;
|
||||
}
|
||||
|
||||
init(): void {
|
||||
@ -609,24 +608,33 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an illusion of the last pokemon in the party, as other wild pokemon in the area.
|
||||
* Set this pokemon's illusion to the data of the given pokemon.
|
||||
*
|
||||
* @remarks
|
||||
* When setting the illusion of a wild pokemon, a {@linkcode PokemonSpecies} is generally passed.
|
||||
* When setting the illusion of a pokemon in this way, the fields required by illusion data
|
||||
* but missing from `PokemonSpecies` are set as follows
|
||||
* - `pokeball` and `nickname` are both inherited from this pokemon
|
||||
* - `shiny` will always be set if this pokemon OR its fusion is shiny
|
||||
* - `variant` will always be 0
|
||||
* - Fields related to fusion will be set to `undefined` or `0` as appropriate
|
||||
* - The gender is set to be the same as this pokemon, if it is compatible with the provided pokemon.
|
||||
* - If the provided pokemon can only ever exist as one gender, it is always that gender
|
||||
* - If this pokemon is genderless but the provided pokemon isn't, then a gender roll is done based on this
|
||||
* pokemon's ID
|
||||
*/
|
||||
setIllusion(pokemon: Pokemon): boolean {
|
||||
if (this.summonData.illusion) {
|
||||
this.breakIllusion();
|
||||
}
|
||||
if (this.hasTrainer()) {
|
||||
setIllusion(pokemon: Pokemon | PokemonSpecies): boolean {
|
||||
this.breakIllusion();
|
||||
if (pokemon instanceof Pokemon) {
|
||||
const speciesId = pokemon.species.speciesId;
|
||||
|
||||
this.summonData.illusion = {
|
||||
basePokemon: {
|
||||
name: this.name,
|
||||
nickname: this.nickname,
|
||||
shiny: this.shiny,
|
||||
variant: this.variant,
|
||||
fusionShiny: this.fusionShiny,
|
||||
fusionVariant: this.fusionVariant,
|
||||
},
|
||||
name: pokemon.name,
|
||||
nickname: pokemon.nickname,
|
||||
shiny: pokemon.shiny,
|
||||
variant: pokemon.variant,
|
||||
fusionShiny: pokemon.fusionShiny,
|
||||
fusionVariant: pokemon.fusionVariant,
|
||||
species: speciesId,
|
||||
formIndex: pokemon.formIndex,
|
||||
gender: pokemon.gender,
|
||||
@ -636,54 +644,61 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
fusionGender: pokemon.fusionGender,
|
||||
};
|
||||
|
||||
this.name = pokemon.name;
|
||||
this.nickname = pokemon.nickname;
|
||||
this.shiny = pokemon.shiny;
|
||||
this.variant = pokemon.variant;
|
||||
this.fusionVariant = pokemon.fusionVariant;
|
||||
this.fusionShiny = pokemon.fusionShiny;
|
||||
if (this.shiny) {
|
||||
if (pokemon.shiny || pokemon.fusionShiny) {
|
||||
this.initShinySparkle();
|
||||
}
|
||||
this.loadAssets(false, true).then(() => this.playAnim());
|
||||
this.updateInfo();
|
||||
} else {
|
||||
const randomIllusion: PokemonSpecies = globalScene.arena.randomSpecies(
|
||||
globalScene.currentBattle.waveIndex,
|
||||
this.level,
|
||||
);
|
||||
|
||||
// Correct the gender in case the illusioned species has a gender incompatible with this pokemon
|
||||
let gender = this.gender;
|
||||
switch (pokemon.malePercent) {
|
||||
case null:
|
||||
gender = Gender.GENDERLESS;
|
||||
break;
|
||||
case 0:
|
||||
gender = Gender.FEMALE;
|
||||
break;
|
||||
case 100:
|
||||
gender = Gender.MALE;
|
||||
break;
|
||||
default:
|
||||
gender = (this.id % 256) * 0.390625 < pokemon.malePercent ? Gender.MALE : Gender.FEMALE;
|
||||
}
|
||||
/*
|
||||
TODO: Allow setting `variant` to something other than 0, which would require first loading the
|
||||
assets for the provided species, as its entry would otherwise not
|
||||
be guaranteed to exist in the `variantData` map. But this would prevent `summonData` from being populated
|
||||
until the assets are loaded, which would cause issues as this method cannot be easily promisified.
|
||||
*/
|
||||
this.summonData.illusion = {
|
||||
basePokemon: {
|
||||
name: this.name,
|
||||
nickname: this.nickname,
|
||||
shiny: this.shiny,
|
||||
variant: this.variant,
|
||||
fusionShiny: this.fusionShiny,
|
||||
fusionVariant: this.fusionVariant,
|
||||
},
|
||||
species: randomIllusion.speciesId,
|
||||
formIndex: randomIllusion.formIndex,
|
||||
gender: this.gender,
|
||||
fusionShiny: false,
|
||||
fusionVariant: 0,
|
||||
shiny: this.shiny || this.fusionShiny,
|
||||
variant: 0,
|
||||
nickname: this.nickname,
|
||||
name: pokemon.name,
|
||||
species: pokemon.speciesId,
|
||||
formIndex: pokemon.formIndex,
|
||||
gender,
|
||||
pokeball: this.pokeball,
|
||||
};
|
||||
|
||||
this.name = randomIllusion.name;
|
||||
this.loadAssets(false, true).then(() => this.playAnim());
|
||||
if (this.shiny || this.fusionShiny) {
|
||||
this.initShinySparkle();
|
||||
}
|
||||
}
|
||||
this.loadAssets(false, true).then(() => this.playAnim());
|
||||
this.updateInfo();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Break the illusion of this pokemon, if it has an active illusion.
|
||||
* @returns Whether an illusion was broken.
|
||||
*/
|
||||
breakIllusion(): boolean {
|
||||
if (!this.summonData.illusion) {
|
||||
return false;
|
||||
}
|
||||
this.name = this.summonData.illusion.basePokemon.name;
|
||||
this.nickname = this.summonData.illusion.basePokemon.nickname;
|
||||
this.shiny = this.summonData.illusion.basePokemon.shiny;
|
||||
this.variant = this.summonData.illusion.basePokemon.variant;
|
||||
this.fusionVariant = this.summonData.illusion.basePokemon.fusionVariant;
|
||||
this.fusionShiny = this.summonData.illusion.basePokemon.fusionShiny;
|
||||
this.summonData.illusion = null;
|
||||
if (this.isOnField()) {
|
||||
globalScene.playSound("PRSFX- Transform");
|
||||
@ -718,8 +733,12 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
// Assets for moves
|
||||
loadPromises.push(loadMoveAnimations(this.getMoveset().map(m => m.getMove().id)));
|
||||
|
||||
/** alias for `this.summonData.illusion`; bangs on this are safe when guarded with `useIllusion` being true */
|
||||
const illusion = this.summonData.illusion;
|
||||
useIllusion = useIllusion && !!illusion;
|
||||
|
||||
// Load the assets for the species form
|
||||
const formIndex = useIllusion && this.summonData.illusion ? this.summonData.illusion.formIndex : this.formIndex;
|
||||
const formIndex = useIllusion ? illusion!.formIndex : this.formIndex;
|
||||
loadPromises.push(
|
||||
this.getSpeciesForm(false, useIllusion).loadAssets(
|
||||
this.getGender(useIllusion) === Gender.FEMALE,
|
||||
@ -736,16 +755,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
);
|
||||
}
|
||||
if (this.getFusionSpeciesForm()) {
|
||||
const fusionFormIndex =
|
||||
useIllusion && this.summonData.illusion ? this.summonData.illusion.fusionFormIndex : this.fusionFormIndex;
|
||||
const fusionShiny =
|
||||
!useIllusion && this.summonData.illusion?.basePokemon
|
||||
? this.summonData.illusion.basePokemon.fusionShiny
|
||||
: this.fusionShiny;
|
||||
const fusionVariant =
|
||||
!useIllusion && this.summonData.illusion?.basePokemon
|
||||
? this.summonData.illusion.basePokemon.fusionVariant
|
||||
: this.fusionVariant;
|
||||
const { fusionFormIndex, fusionShiny, fusionVariant } = useIllusion ? illusion! : this;
|
||||
loadPromises.push(
|
||||
this.getFusionSpeciesForm(false, useIllusion).loadAssets(
|
||||
this.getFusionGender(false, useIllusion) === Gender.FEMALE,
|
||||
@ -933,8 +943,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
return this.getSpeciesForm(ignoreOverride, false).getSpriteKey(
|
||||
this.getGender(ignoreOverride) === Gender.FEMALE,
|
||||
this.formIndex,
|
||||
this.summonData.illusion?.basePokemon.shiny ?? this.shiny,
|
||||
this.summonData.illusion?.basePokemon.variant ?? this.variant,
|
||||
this.isShiny(false),
|
||||
this.getVariant(false),
|
||||
);
|
||||
}
|
||||
|
||||
@ -977,11 +987,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
getIconAtlasKey(ignoreOverride = false, useIllusion = true): string {
|
||||
// TODO: confirm the correct behavior here (is it intentional that the check fails if `illusion.formIndex` is `0`?)
|
||||
const formIndex =
|
||||
useIllusion && this.summonData.illusion?.formIndex ? this.summonData.illusion.formIndex : this.formIndex;
|
||||
const variant =
|
||||
!useIllusion && this.summonData.illusion ? this.summonData.illusion.basePokemon.variant : this.variant;
|
||||
const illusion = this.summonData.illusion;
|
||||
const { formIndex, variant } = useIllusion && illusion ? illusion : this;
|
||||
return this.getSpeciesForm(ignoreOverride, useIllusion).getIconAtlasKey(
|
||||
formIndex,
|
||||
this.isBaseShiny(useIllusion),
|
||||
@ -990,15 +997,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
getFusionIconAtlasKey(ignoreOverride = false, useIllusion = true): string {
|
||||
// TODO: confirm the correct behavior here (is it intentional that the check fails if `illusion.fusionFormIndex` is `0`?)
|
||||
const fusionFormIndex =
|
||||
useIllusion && this.summonData.illusion?.fusionFormIndex
|
||||
? this.summonData.illusion.fusionFormIndex
|
||||
: this.fusionFormIndex;
|
||||
const fusionVariant =
|
||||
!useIllusion && this.summonData.illusion
|
||||
? this.summonData.illusion.basePokemon.fusionVariant
|
||||
: this.fusionVariant;
|
||||
const illusion = this.summonData.illusion;
|
||||
const { fusionFormIndex, fusionVariant } = useIllusion && illusion ? illusion : this;
|
||||
return this.getFusionSpeciesForm(ignoreOverride, useIllusion).getIconAtlasKey(
|
||||
fusionFormIndex,
|
||||
this.isFusionShiny(),
|
||||
@ -1006,11 +1006,9 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
);
|
||||
}
|
||||
|
||||
getIconId(ignoreOverride?: boolean, useIllusion = true): string {
|
||||
const formIndex =
|
||||
useIllusion && this.summonData.illusion?.formIndex ? this.summonData.illusion?.formIndex : this.formIndex;
|
||||
const variant =
|
||||
!useIllusion && !!this.summonData.illusion ? this.summonData.illusion?.basePokemon.variant : this.variant;
|
||||
getIconId(ignoreOverride?: boolean, useIllusion = false): string {
|
||||
const illusion = this.summonData.illusion;
|
||||
const { formIndex, variant } = useIllusion && illusion ? illusion : this;
|
||||
return this.getSpeciesForm(ignoreOverride, useIllusion).getIconId(
|
||||
this.getGender(ignoreOverride, useIllusion) === Gender.FEMALE,
|
||||
formIndex,
|
||||
@ -1020,14 +1018,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
getFusionIconId(ignoreOverride?: boolean, useIllusion = true): string {
|
||||
const fusionFormIndex =
|
||||
useIllusion && this.summonData.illusion?.fusionFormIndex
|
||||
? this.summonData.illusion?.fusionFormIndex
|
||||
: this.fusionFormIndex;
|
||||
const fusionVariant =
|
||||
!useIllusion && !!this.summonData.illusion
|
||||
? this.summonData.illusion?.basePokemon.fusionVariant
|
||||
: this.fusionVariant;
|
||||
const illusion = this.summonData.illusion;
|
||||
const { fusionFormIndex, fusionVariant } = useIllusion && illusion ? illusion : this;
|
||||
return this.getFusionSpeciesForm(ignoreOverride, useIllusion).getIconId(
|
||||
this.getFusionGender(ignoreOverride, useIllusion) === Gender.FEMALE,
|
||||
fusionFormIndex,
|
||||
@ -1702,29 +1694,18 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @returns Whether this Pokemon is shiny
|
||||
*/
|
||||
isShiny(useIllusion = false): boolean {
|
||||
if (!useIllusion && this.summonData.illusion) {
|
||||
return (
|
||||
this.summonData.illusion.basePokemon?.shiny ||
|
||||
(this.summonData.illusion.fusionSpecies && this.summonData.illusion.basePokemon?.fusionShiny) ||
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
return this.shiny || (this.isFusion(useIllusion) && this.fusionShiny);
|
||||
return this.isBaseShiny(useIllusion) || this.isFusionShiny(useIllusion);
|
||||
}
|
||||
|
||||
isBaseShiny(useIllusion = false) {
|
||||
if (!useIllusion && this.summonData.illusion) {
|
||||
return !!this.summonData.illusion.basePokemon?.shiny;
|
||||
}
|
||||
return this.shiny;
|
||||
return useIllusion ? (this.summonData.illusion?.shiny ?? this.shiny) : this.shiny;
|
||||
}
|
||||
|
||||
isFusionShiny(useIllusion = false) {
|
||||
if (!useIllusion && this.summonData.illusion) {
|
||||
return !!this.summonData.illusion.basePokemon?.fusionShiny;
|
||||
if (!this.isFusion(useIllusion)) {
|
||||
return false;
|
||||
}
|
||||
return this.isFusion(useIllusion) && this.fusionShiny;
|
||||
return useIllusion ? (this.summonData.illusion?.fusionShiny ?? this.fusionShiny) : this.fusionShiny;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1733,39 +1714,48 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @returns Whether this pokemon's base and fusion counterparts are both shiny.
|
||||
*/
|
||||
isDoubleShiny(useIllusion = false): boolean {
|
||||
if (!useIllusion && this.summonData.illusion?.basePokemon) {
|
||||
return (
|
||||
this.isFusion(false) &&
|
||||
this.summonData.illusion.basePokemon.shiny &&
|
||||
this.summonData.illusion.basePokemon.fusionShiny
|
||||
);
|
||||
}
|
||||
|
||||
return this.isFusion(useIllusion) && this.shiny && this.fusionShiny;
|
||||
return this.isFusion(useIllusion) && this.isBaseShiny(useIllusion) && this.isFusionShiny(useIllusion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return this Pokemon's {@linkcode Variant | shiny variant}.
|
||||
* If a fusion, returns the maximum of the two variants.
|
||||
* Only meaningful if this pokemon is actually shiny.
|
||||
* @param useIllusion - Whether to consider this pokemon's illusion if present; default `false`
|
||||
* @returns The shiny variant of this Pokemon.
|
||||
*/
|
||||
getVariant(useIllusion = false): Variant {
|
||||
if (!useIllusion && this.summonData.illusion) {
|
||||
return !this.isFusion(false)
|
||||
? this.summonData.illusion.basePokemon!.variant
|
||||
: (Math.max(this.variant, this.fusionVariant) as Variant);
|
||||
const illusion = this.summonData.illusion;
|
||||
const baseVariant = useIllusion ? (illusion?.variant ?? this.variant) : this.variant;
|
||||
if (!this.isFusion(useIllusion)) {
|
||||
return baseVariant;
|
||||
}
|
||||
|
||||
return !this.isFusion(true) ? this.variant : (Math.max(this.variant, this.fusionVariant) as Variant);
|
||||
const fusionVariant = useIllusion ? (illusion?.fusionVariant ?? this.fusionVariant) : this.fusionVariant;
|
||||
return Math.max(baseVariant, fusionVariant) as Variant;
|
||||
}
|
||||
|
||||
// TODO: Clarify how this differs from `getVariant`
|
||||
getBaseVariant(doubleShiny: boolean): Variant {
|
||||
if (doubleShiny) {
|
||||
return this.summonData.illusion?.basePokemon?.variant ?? this.variant;
|
||||
/**
|
||||
* Return the base pokemon's variant. Equivalent to {@linkcode getVariant} if this pokemon is not a fusion.
|
||||
* @returns The shiny variant of this Pokemon's base species.
|
||||
*/
|
||||
getBaseVariant(useIllusion = false): Variant {
|
||||
const illusion = this.summonData.illusion;
|
||||
return useIllusion && illusion ? (illusion.variant ?? this.variant) : this.variant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the fused pokemon's variant.
|
||||
*
|
||||
* @remarks
|
||||
* Always returns `0` if the pokemon is not a fusion.
|
||||
* @returns The shiny variant of this pokemon's fusion species.
|
||||
*/
|
||||
getFusionVariant(useIllusion = false): Variant {
|
||||
if (!this.isFusion(useIllusion)) {
|
||||
return 0;
|
||||
}
|
||||
return this.getVariant();
|
||||
const illusion = this.summonData.illusion;
|
||||
return illusion ? (illusion.fusionVariant ?? this.fusionVariant) : this.fusionVariant;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1782,7 +1772,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @returns Whether this Pokemon is currently fused with another species.
|
||||
*/
|
||||
isFusion(useIllusion = false): boolean {
|
||||
return useIllusion && this.summonData.illusion ? !!this.summonData.illusion.fusionSpecies : !!this.fusionSpecies;
|
||||
return useIllusion ? !!this.summonData.illusion?.fusionSpecies : !!this.fusionSpecies;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1792,9 +1782,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @see {@linkcode getNameToRender} - gets this Pokemon's display name.
|
||||
*/
|
||||
getName(useIllusion = false): string {
|
||||
return !useIllusion && this.summonData.illusion?.basePokemon
|
||||
? this.summonData.illusion.basePokemon.name
|
||||
: this.name;
|
||||
return useIllusion ? (this.summonData.illusion?.name ?? this.name) : this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,6 +23,7 @@ import type { PokemonType } from "#enums/pokemon-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { BATTLE_STATS, type PermanentStat, Stat, TEMP_BATTLE_STATS, type TempBattleStat } from "#enums/stat";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { PlayerPokemon, Pokemon } from "#field/pokemon";
|
||||
import type {
|
||||
DoubleBattleChanceBoosterModifierType,
|
||||
@ -40,7 +41,7 @@ import type {
|
||||
} from "#modifiers/modifier-type";
|
||||
import type { VoucherType } from "#system/voucher";
|
||||
import type { ModifierInstanceMap, ModifierString } from "#types/modifier-types";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { BooleanHolder, hslToHex, isNullOrUndefined, NumberHolder, randSeedFloat, toDmgValue } from "#utils/common";
|
||||
import { getModifierType } from "#utils/modifier-utils";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Phase } from "#app/phase";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class EndCardPhase extends Phase {
|
||||
|
@ -135,7 +135,7 @@ export class EvolutionPhase extends Phase {
|
||||
|
||||
sprite
|
||||
.setPipelineData("ignoreTimeTint", true)
|
||||
.setPipelineData("spriteKey", pokemon.getSpriteKey())
|
||||
.setPipelineData("spriteKey", spriteKey)
|
||||
.setPipelineData("shiny", pokemon.shiny)
|
||||
.setPipelineData("variant", pokemon.variant);
|
||||
|
||||
|
@ -2,9 +2,10 @@ import { globalScene } from "#app/global-scene";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import type { BattlerIndex } from "#enums/battler-index";
|
||||
import { PERMANENT_STATS, Stat } from "#enums/stat";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { PokemonPhase } from "#phases/pokemon-phase";
|
||||
import { getTextColor, TextStyle } from "#ui/text";
|
||||
import { getTextColor } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class ScanIvsPhase extends PokemonPhase {
|
||||
|
@ -88,12 +88,12 @@ export class PokemonData {
|
||||
this.id = source.id;
|
||||
this.player = sourcePokemon?.isPlayer() ?? source.player;
|
||||
this.species = sourcePokemon?.species.speciesId ?? source.species;
|
||||
this.nickname = sourcePokemon?.summonData.illusion?.basePokemon.nickname ?? source.nickname;
|
||||
this.nickname = source.nickname;
|
||||
this.formIndex = Math.max(Math.min(source.formIndex, getPokemonSpecies(this.species).forms.length - 1), 0);
|
||||
this.abilityIndex = source.abilityIndex;
|
||||
this.passive = source.passive;
|
||||
this.shiny = sourcePokemon?.summonData.illusion?.basePokemon.shiny ?? source.shiny;
|
||||
this.variant = sourcePokemon?.summonData.illusion?.basePokemon.variant ?? source.variant;
|
||||
this.shiny = source.shiny;
|
||||
this.variant = source.variant;
|
||||
this.pokeball = source.pokeball ?? PokeballType.POKEBALL;
|
||||
this.level = source.level;
|
||||
this.exp = source.exp;
|
||||
@ -134,8 +134,8 @@ export class PokemonData {
|
||||
this.fusionSpecies = sourcePokemon?.fusionSpecies?.speciesId ?? source.fusionSpecies;
|
||||
this.fusionFormIndex = source.fusionFormIndex;
|
||||
this.fusionAbilityIndex = source.fusionAbilityIndex;
|
||||
this.fusionShiny = sourcePokemon?.summonData.illusion?.basePokemon.fusionShiny ?? source.fusionShiny;
|
||||
this.fusionVariant = sourcePokemon?.summonData.illusion?.basePokemon.fusionVariant ?? source.fusionVariant;
|
||||
this.fusionShiny = source.fusionShiny;
|
||||
this.fusionVariant = source.fusionVariant;
|
||||
this.fusionGender = source.fusionGender;
|
||||
this.fusionLuck = source.fusionLuck ?? (source.fusionShiny ? source.fusionVariant + 1 : 0);
|
||||
this.fusionTeraType = (source.fusionTeraType ?? 0) as PokemonType;
|
||||
|
@ -171,6 +171,7 @@ export const SettingKeys = {
|
||||
UI_Volume: "UI_SOUND_EFFECTS",
|
||||
Battle_Music: "BATTLE_MUSIC",
|
||||
Show_BGM_Bar: "SHOW_BGM_BAR",
|
||||
Hide_Username: "HIDE_USERNAME",
|
||||
Move_Touch_Controls: "MOVE_TOUCH_CONTROLS",
|
||||
Shop_Overlay_Opacity: "SHOP_OVERLAY_OPACITY",
|
||||
};
|
||||
@ -625,6 +626,13 @@ export const Setting: Array<Setting> = [
|
||||
default: 1,
|
||||
type: SettingType.DISPLAY,
|
||||
},
|
||||
{
|
||||
key: SettingKeys.Hide_Username,
|
||||
label: i18next.t("settings:hideUsername"),
|
||||
options: OFF_ON,
|
||||
default: 0,
|
||||
type: SettingType.DISPLAY,
|
||||
},
|
||||
{
|
||||
key: SettingKeys.Master_Volume,
|
||||
label: i18next.t("settings:masterVolume"),
|
||||
@ -792,6 +800,9 @@ export function setSetting(setting: string, value: number): boolean {
|
||||
case SettingKeys.Show_BGM_Bar:
|
||||
globalScene.showBgmBar = Setting[index].options[value].value === "On";
|
||||
break;
|
||||
case SettingKeys.Hide_Username:
|
||||
globalScene.hideUsername = Setting[index].options[value].value === "On";
|
||||
break;
|
||||
case SettingKeys.Candy_Upgrade_Notification:
|
||||
if (globalScene.candyUpgradeNotification === value) {
|
||||
break;
|
||||
|
@ -5,8 +5,9 @@ import { Challenges } from "#enums/challenges";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { WeatherType } from "#enums/weather-type";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import type { nil } from "#utils/common";
|
||||
import { isNullOrUndefined } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
const barWidth = 118;
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { addBBCodeTextObject, getTextColor, getTextStyleOptions, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, getTextColor, getTextStyleOptions } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt, rgbHexToRgba } from "#utils/common";
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { PlayerGender } from "#enums/player-gender";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { Achv, getAchievementDescription } from "#system/achv";
|
||||
import { Voucher } from "#system/voucher";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
|
||||
export class AchvBar extends Phaser.GameObjects.Container {
|
||||
private defaultWidth: number;
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import type { Achv } from "#system/achv";
|
||||
import { achvs, getAchievementDescription } from "#system/achv";
|
||||
@ -9,7 +10,7 @@ import type { Voucher } from "#system/voucher";
|
||||
import { getVoucherTypeIcon, getVoucherTypeName, vouchers } from "#system/voucher";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { ScrollBar } from "#ui/scroll-bar";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { pokerogueApi } from "#api/pokerogue-api";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { InputFieldConfig } from "#ui/form-modal-ui-handler";
|
||||
import { FormModalUiHandler } from "#ui/form-modal-ui-handler";
|
||||
import type { ModalConfig } from "#ui/modal-ui-handler";
|
||||
import { TextStyle } from "#ui/text";
|
||||
import { formatText } from "#utils/common";
|
||||
|
||||
type AdminUiHandlerService = "discord" | "google";
|
||||
|
@ -3,6 +3,7 @@ import { ArenaTrapTag } from "#data/arena-tag";
|
||||
import { TerrainType } from "#data/terrain";
|
||||
import { ArenaTagSide } from "#enums/arena-tag-side";
|
||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { WeatherType } from "#enums/weather-type";
|
||||
import type { ArenaEvent } from "#events/arena";
|
||||
import {
|
||||
@ -14,7 +15,7 @@ import {
|
||||
} from "#events/arena";
|
||||
import type { TurnEndEvent } from "#events/battle-scene";
|
||||
import { BattleSceneEventType } from "#events/battle-scene";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { TimeOfDayWidget } from "#ui/time-of-day-widget";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import { fixedInt, formatText, toCamelCaseString } from "#utils/common";
|
||||
|
@ -2,9 +2,10 @@ import { globalScene } from "#app/global-scene";
|
||||
import { getPokeballName } from "#data/pokeball";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { Command } from "#enums/command";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { CommandPhase } from "#phases/command-phase";
|
||||
import { addTextObject, getTextStyleOptions, TextStyle } from "#ui/text";
|
||||
import { addTextObject, getTextStyleOptions } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { InfoToggle } from "#app/battle-scene";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -2,12 +2,13 @@ import { globalScene } from "#app/global-scene";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { MoveId } from "#enums/move-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiTheme } from "#enums/ui-theme";
|
||||
import type { BerryUsedEvent, MoveUsedEvent } from "#events/battle-scene";
|
||||
import { BattleSceneEventType } from "#events/battle-scene";
|
||||
import type { EnemyPokemon, Pokemon } from "#field/pokemon";
|
||||
import type { Move } from "#moves/move";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { fixedInt } from "#utils/common";
|
||||
|
||||
/** Container for info about a {@linkcode Move} */
|
||||
|
@ -4,9 +4,10 @@ import { getTypeRgb } from "#data/type";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { Stat } from "#enums/stat";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { Pokemon } from "#field/pokemon";
|
||||
import { getVariantTint } from "#sprites/variant";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { fixedInt, getLocalizedSpriteKey, getShinyDescriptor } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Stat } from "#enums/stat";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { EnemyPokemon } from "#field/pokemon";
|
||||
import { BattleFlyout } from "#ui/battle-flyout";
|
||||
import type { BattleInfoParamList } from "#ui/battle-info";
|
||||
import { BattleInfo } from "#ui/battle-info";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
import type { GameObjects } from "phaser";
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { getStatKey, PERMANENT_STATS } from "#enums/stat";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
import type BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { formatText } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { starterColors } from "#app/global-vars/starter-colors";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { rgbHexToRgba } from "#utils/common";
|
||||
import { argbFromRgba } from "@material/material-color-utilities";
|
||||
|
||||
|
@ -3,8 +3,9 @@ import type { Challenge } from "#data/challenge";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
import { Color, ShadowColor } from "#enums/color";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { getLocalizedSpriteKey } from "#utils/common";
|
||||
|
@ -5,11 +5,12 @@ import { Button } from "#enums/buttons";
|
||||
import { Command } from "#enums/command";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { TerastallizeAccessModifier } from "#modifiers/modifier";
|
||||
import type { CommandPhase } from "#phases/command-phase";
|
||||
import { PartyUiHandler, PartyUiMode } from "#ui/party-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { pokerogueApi } from "#api/pokerogue-api";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import { executeIf } from "#utils/common";
|
||||
import { getEnumKeys } from "#utils/enums";
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { ScrollBar } from "#ui/scroll-bar";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { EggCountChangedEvent } from "#events/egg";
|
||||
import { EggEventType } from "#events/egg";
|
||||
import type { EggHatchSceneHandler } from "#ui/egg-hatch-scene-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
|
||||
/**
|
||||
|
@ -6,10 +6,11 @@ import { Egg, getLegendaryGachaSpeciesForTimestamp } from "#data/egg";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { EggTier } from "#enums/egg-type";
|
||||
import { GachaType } from "#enums/gacha-types";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { getVoucherTypeIcon, VoucherType } from "#system/voucher";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { addTextObject, getEggTierTextTint, getTextStyleOptions, TextStyle } from "#ui/text";
|
||||
import { addTextObject, getEggTierTextTint, getTextStyleOptions } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt, randSeedShuffle } from "#utils/common";
|
||||
import { getEnumValues } from "#utils/enums";
|
||||
@ -74,7 +75,7 @@ export class EggGachaUiHandler extends MessageUiHandler {
|
||||
const gachaInfoContainer = globalScene.add.container(160, 46);
|
||||
|
||||
const currentLanguage = i18next.resolvedLanguage ?? "en";
|
||||
let gachaTextStyle = TextStyle.WINDOW_ALT;
|
||||
let gachaTextStyle: TextStyle = TextStyle.WINDOW_ALT;
|
||||
let gachaX = 4;
|
||||
let gachaY = 0;
|
||||
let pokemonIconX = -20;
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler";
|
||||
import { ScrollBar } from "#ui/scroll-bar";
|
||||
import { ScrollableGridUiHandler } from "#ui/scrollable-grid-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
|
||||
export class EvolutionSceneHandler extends MessageUiHandler {
|
||||
public evolutionContainer: Phaser.GameObjects.Container;
|
||||
|
@ -7,12 +7,13 @@ import { Command } from "#enums/command";
|
||||
import { MoveCategory } from "#enums/move-category";
|
||||
import { MoveUseMode } from "#enums/move-use-mode";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { EnemyPokemon, Pokemon } from "#field/pokemon";
|
||||
import type { PokemonMove } from "#moves/pokemon-move";
|
||||
import type { CommandPhase } from "#phases/command-phase";
|
||||
import { MoveInfoOverlay } from "#ui/move-info-overlay";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { fixedInt, getLocalizedSpriteKey, padInt } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
@ -284,7 +285,7 @@ export class FightUiHandler extends UiHandler implements InfoToggle {
|
||||
|
||||
const ppColorStyle = FightUiHandler.ppRatioToColor(pp / maxPP);
|
||||
|
||||
//** Changes the text color and shadow according to the determined TextStyle */
|
||||
// Changes the text color and shadow according to the determined TextStyle
|
||||
this.ppText.setColor(this.getTextColor(ppColorStyle, false)).setShadowColor(this.getTextColor(ppColorStyle, true));
|
||||
this.moveInfoOverlay.show(pokemonMove.getMove());
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { DropDownColumn } from "#enums/drop-down-column";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiTheme } from "#enums/ui-theme";
|
||||
import type { DropDown } from "#ui/dropdown";
|
||||
import { DropDownType } from "#ui/dropdown";
|
||||
import type { StarterContainer } from "#ui/starter-container";
|
||||
import { addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { addTextObject, getTextColor } from "#ui/text";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
|
||||
export class FilterBar extends Phaser.GameObjects.Container {
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { UiTheme } from "#enums/ui-theme";
|
||||
import type { AwaitableUiHandler } from "#ui/awaitable-ui-handler";
|
||||
import type { StarterContainer } from "#ui/starter-container";
|
||||
import { addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { addTextObject, getTextColor } from "#ui/text";
|
||||
import type { UI } from "#ui/ui";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import type { ModalConfig } from "#ui/modal-ui-handler";
|
||||
import { ModalUiHandler } from "#ui/modal-ui-handler";
|
||||
import { addTextInputObject, addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextInputObject, addTextObject } from "#ui/text";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import { fixedInt } from "#utils/common";
|
||||
import type InputText from "phaser3-rex-plugins/plugins/inputtext";
|
||||
|
@ -2,9 +2,10 @@ import { globalScene } from "#app/global-scene";
|
||||
import { speciesStarterCosts } from "#balance/starters";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { DexAttr } from "#enums/dex-attr";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiTheme } from "#enums/ui-theme";
|
||||
import type { GameData } from "#system/game-data";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { formatFancyLargeNumber, getPlayTimeString, toReadableString } from "#utils/common";
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import { ModalUiHandler } from "#ui/modal-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class LoadingModalUiHandler extends ModalUiHandler {
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { pokerogueApi } from "#api/pokerogue-api";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler";
|
||||
import type { InputFieldConfig } from "#ui/form-modal-ui-handler";
|
||||
import { FormModalUiHandler } from "#ui/form-modal-ui-handler";
|
||||
import type { ModalConfig } from "#ui/modal-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -5,13 +5,14 @@ import { bypassLogin } from "#app/global-vars/bypass-login";
|
||||
import { handleTutorial, Tutorial } from "#app/tutorial";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { GameDataType } from "#enums/game-data-type";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { OptionSelectConfig, OptionSelectItem } from "#ui/abstact-option-select-ui-handler";
|
||||
import { AdminMode, getAdminModeName } from "#ui/admin-ui-handler";
|
||||
import type { AwaitableUiHandler } from "#ui/awaitable-ui-handler";
|
||||
import { BgmBar } from "#ui/bgm-bar";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { addTextObject, getTextStyleOptions, TextStyle } from "#ui/text";
|
||||
import { addTextObject, getTextStyleOptions } from "#ui/text";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import { fixedInt, isLocal, sessionIdKey } from "#utils/common";
|
||||
import { getCookie } from "#utils/cookies";
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
|
||||
|
@ -6,13 +6,14 @@ import { getPokeballAtlasKey } from "#data/pokeball";
|
||||
import { Button } from "#enums/buttons";
|
||||
import type { PokeballType } from "#enums/pokeball";
|
||||
import { ShopCursorTarget } from "#enums/shop-cursor-target";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { HealShopCostModifier, LockModifierTiersModifier, PokemonHeldItemModifier } from "#modifiers/modifier";
|
||||
import type { ModifierTypeOption } from "#modifiers/modifier-type";
|
||||
import { getPlayerShopModifierTypeOptionsForWave, TmModifierType } from "#modifiers/modifier-type";
|
||||
import { AwaitableUiHandler } from "#ui/awaitable-ui-handler";
|
||||
import { MoveInfoOverlay } from "#ui/move-info-overlay";
|
||||
import { addTextObject, getModifierTierTextTint, getTextColor, getTextStyleOptions, TextStyle } from "#ui/text";
|
||||
import { addTextObject, getModifierTierTextTint, getTextColor, getTextStyleOptions } from "#ui/text";
|
||||
import { formatMoney, NumberHolder } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
import Phaser from "phaser";
|
||||
|
@ -2,8 +2,9 @@ import type { InfoToggle } from "#app/battle-scene";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { MoveCategory } from "#enums/move-category";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { Move } from "#moves/move";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt, getLocalizedSpriteKey } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -3,13 +3,14 @@ import { getPokeballAtlasKey } from "#data/pokeball";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { getEncounterText } from "#mystery-encounters/encounter-dialogue-utils";
|
||||
import type { OptionSelectSettings } from "#mystery-encounters/encounter-phase-utils";
|
||||
import type { MysteryEncounterOption } from "#mystery-encounters/mystery-encounter-option";
|
||||
import type { MysteryEncounterPhase } from "#phases/mystery-encounter-phases";
|
||||
import { PartyUiMode } from "#ui/party-ui-handler";
|
||||
import { addBBCodeTextObject, getBBCodeFrag, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, getBBCodeFrag } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow, WindowVariant } from "#ui/ui-theme";
|
||||
import { fixedInt, isNullOrUndefined } from "#utils/common";
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { Pokemon } from "#field/pokemon";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class PartyExpBar extends Phaser.GameObjects.Container {
|
||||
|
@ -13,6 +13,7 @@ import { MoveId } from "#enums/move-id";
|
||||
import { MoveResult } from "#enums/move-result";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { PlayerPokemon, Pokemon } from "#field/pokemon";
|
||||
import type { PokemonFormChangeItemModifier, PokemonHeldItemModifier } from "#modifiers/modifier";
|
||||
@ -23,7 +24,7 @@ import type { TurnMove } from "#types/turn-move";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { MoveInfoOverlay } from "#ui/move-info-overlay";
|
||||
import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { BooleanHolder, getLocalizedSpriteKey, randInt, toReadableString } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
@ -1791,17 +1792,16 @@ class PartySlot extends Phaser.GameObjects.Container {
|
||||
const shinyStar = globalScene.add.image(0, 0, `shiny_star_small${doubleShiny ? "_1" : ""}`);
|
||||
shinyStar.setOrigin(0, 0);
|
||||
shinyStar.setPositionRelative(this.slotName, -9, 3);
|
||||
shinyStar.setTint(getVariantTint(this.pokemon.getBaseVariant(doubleShiny)));
|
||||
shinyStar.setTint(getVariantTint(this.pokemon.getBaseVariant()));
|
||||
|
||||
slotInfoContainer.add(shinyStar);
|
||||
|
||||
if (doubleShiny) {
|
||||
const fusionShinyStar = globalScene.add.image(0, 0, "shiny_star_small_2");
|
||||
fusionShinyStar.setOrigin(0, 0);
|
||||
fusionShinyStar.setPosition(shinyStar.x, shinyStar.y);
|
||||
fusionShinyStar.setTint(
|
||||
getVariantTint(this.pokemon.summonData.illusion?.basePokemon.fusionVariant ?? this.pokemon.fusionVariant),
|
||||
);
|
||||
const fusionShinyStar = globalScene.add
|
||||
.image(0, 0, "shiny_star_small_2")
|
||||
.setOrigin(0)
|
||||
.setPosition(shinyStar.x, shinyStar.y)
|
||||
.setTint(getVariantTint(this.pokemon.fusionVariant));
|
||||
|
||||
slotInfoContainer.add(fusionShinyStar);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { InfoToggle } from "#app/battle-scene";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt } from "#utils/common";
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { Variant } from "#sprites/variant";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { isNullOrUndefined } from "#utils/common";
|
||||
|
||||
interface SpeciesDetails {
|
||||
|
@ -38,6 +38,7 @@ import type { Nature } from "#enums/nature";
|
||||
import { Passive as PassiveAttr } from "#enums/passive";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { TimeOfDay } from "#enums/time-of-day";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { Variant } from "#sprites/variant";
|
||||
@ -51,7 +52,7 @@ import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { MoveInfoOverlay } from "#ui/move-info-overlay";
|
||||
import { PokedexInfoOverlay } from "#ui/pokedex-info-overlay";
|
||||
import { StatsContainer } from "#ui/stats-container";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor, getTextStyleOptions, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor, getTextStyleOptions } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import {
|
||||
BooleanHolder,
|
||||
|
@ -26,6 +26,7 @@ import type { Nature } from "#enums/nature";
|
||||
import { Passive as PassiveAttr } from "#enums/passive";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { Variant } from "#sprites/variant";
|
||||
import { getVariantIcon, getVariantTint } from "#sprites/variant";
|
||||
@ -40,7 +41,7 @@ import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { PokedexMonContainer } from "#ui/pokedex-mon-container";
|
||||
import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-anim-handler";
|
||||
import { ScrollBar } from "#ui/scroll-bar";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { BooleanHolder, fixedInt, getLocalizedSpriteKey, padInt, randIntRange, rgbHexToRgba } from "#utils/common";
|
||||
import type { StarterPreferences } from "#utils/data";
|
||||
|
@ -8,9 +8,10 @@ import { Gender } from "#data/gender";
|
||||
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { PlayerPokemon } from "#field/pokemon";
|
||||
import { PokemonInfoContainer } from "#ui/pokemon-info-container";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { padInt, rgbHexToRgba } from "#utils/common";
|
||||
import { argbFromRgba } from "@material/material-color-utilities";
|
||||
|
||||
|
@ -3,13 +3,14 @@ import { Gender, getGenderColor, getGenderSymbol } from "#data/gender";
|
||||
import { getNatureName } from "#data/nature";
|
||||
import { DexAttr } from "#enums/dex-attr";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { Pokemon } from "#field/pokemon";
|
||||
import { getVariantTint } from "#sprites/variant";
|
||||
import type { StarterDataEntry } from "#system/game-data";
|
||||
import type { DexEntry } from "#types/dex-data";
|
||||
import { ConfirmUiHandler } from "#ui/confirm-ui-handler";
|
||||
import { StatsContainer } from "#ui/stats-container";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt, getShinyDescriptor } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { pokerogueApi } from "#api/pokerogue-api";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { InputFieldConfig } from "#ui/form-modal-ui-handler";
|
||||
import { FormModalUiHandler } from "#ui/form-modal-ui-handler";
|
||||
import type { ModalConfig } from "#ui/modal-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
interface LanguageSetting {
|
||||
|
@ -3,13 +3,14 @@ import { BattleType } from "#enums/battle-type";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { GameModes } from "#enums/game-modes";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { TrainerVariant } from "#enums/trainer-variant";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { RunEntry } from "#system/game-data";
|
||||
import type { PokemonData } from "#system/pokemon-data";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { RunDisplayMode } from "#ui/run-info-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt, formatLargeNumber } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -12,6 +12,7 @@ import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { TrainerVariant } from "#enums/trainer-variant";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
// biome-ignore lint/performance/noNamespaceImport: See `src/system/game-data.ts`
|
||||
@ -21,7 +22,7 @@ import { getVariantTint } from "#sprites/variant";
|
||||
import type { SessionSaveData } from "#system/game-data";
|
||||
import type { PokemonData } from "#system/pokemon-data";
|
||||
import { SettingKeyboard } from "#system/settings-keyboard";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { formatFancyLargeNumber, formatLargeNumber, formatMoney, getPlayTimeString } from "#utils/common";
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { GameMode } from "#app/game-mode";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
// biome-ignore lint/performance/noNamespaceImport: See `src/system/game-data.ts`
|
||||
import * as Modifier from "#modifiers/modifier";
|
||||
@ -8,7 +9,7 @@ import type { SessionSaveData } from "#system/game-data";
|
||||
import type { PokemonData } from "#system/pokemon-data";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { RunDisplayMode } from "#ui/run-info-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import { fixedInt, formatLargeNumber, getPlayTimeString, isNullOrUndefined } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import type { ModalConfig } from "#ui/modal-ui-handler";
|
||||
import { ModalUiHandler } from "#ui/modal-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
|
||||
export class SessionReloadModalUiHandler extends ModalUiHandler {
|
||||
constructor(mode: UiMode | null = null) {
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import { NavigationManager } from "#ui/navigation-menu";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
@ -2,11 +2,12 @@ import { globalScene } from "#app/global-scene";
|
||||
import type { InterfaceConfig } from "#app/inputs-controller";
|
||||
import { Button } from "#enums/buttons";
|
||||
import type { Device } from "#enums/devices";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import { getIconWithSettingName } from "#inputs/config-handler";
|
||||
import { NavigationManager, NavigationMenu } from "#ui/navigation-menu";
|
||||
import { ScrollBar } from "#ui/scroll-bar";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { SettingType } from "#system/settings";
|
||||
import { Setting, SettingKeys } from "#system/settings";
|
||||
@ -7,7 +8,7 @@ import type { InputsIcons } from "#ui/abstract-control-settings-ui-handler";
|
||||
import { MessageUiHandler } from "#ui/message-ui-handler";
|
||||
import { NavigationManager, NavigationMenu } from "#ui/navigation-menu";
|
||||
import { ScrollBar } from "#ui/scroll-bar";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Device } from "#enums/devices";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import { getIconWithSettingName, getKeyWithKeycode } from "#inputs/config-handler";
|
||||
import { AbstractBindingUiHandler } from "#ui/abstract-binding-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class GamepadBindingUiHandler extends AbstractBindingUiHandler {
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Device } from "#enums/devices";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import { getKeyWithKeycode } from "#inputs/config-handler";
|
||||
import { AbstractBindingUiHandler } from "#ui/abstract-binding-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class KeyboardBindingUiHandler extends AbstractBindingUiHandler {
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { Button } from "#enums/buttons";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { InputsIcons } from "#ui/abstract-control-settings-ui-handler";
|
||||
import { addTextObject, setTextStyle, TextStyle } from "#ui/text";
|
||||
import { addTextObject, setTextStyle } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { InterfaceConfig } from "#app/inputs-controller";
|
||||
import { Device } from "#enums/devices";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import pad_dualshock from "#inputs/pad-dualshock";
|
||||
import pad_unlicensedSNES from "#inputs/pad-unlicensed-snes";
|
||||
@ -13,7 +14,7 @@ import {
|
||||
settingGamepadOptions,
|
||||
} from "#system/settings-gamepad";
|
||||
import { AbstractControlSettingsUiHandler } from "#ui/abstract-control-settings-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { truncateString } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { InterfaceConfig } from "#app/inputs-controller";
|
||||
import { Device } from "#enums/devices";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import cfg_keyboard_qwerty from "#inputs/cfg-keyboard-qwerty";
|
||||
import { deleteBind } from "#inputs/config-handler";
|
||||
@ -13,7 +14,7 @@ import {
|
||||
} from "#system/settings-keyboard";
|
||||
import { AbstractControlSettingsUiHandler } from "#ui/abstract-control-settings-ui-handler";
|
||||
import { NavigationManager } from "#ui/navigation-menu";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { reverseValueToKeySetting, truncateString } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addTextObject } from "#ui/text";
|
||||
|
||||
export class StarterContainer extends Phaser.GameObjects.Container {
|
||||
public species: PokemonSpecies;
|
||||
|
@ -39,6 +39,7 @@ import type { Nature } from "#enums/nature";
|
||||
import { Passive as PassiveAttr } from "#enums/passive";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { CandyUpgradeNotificationChangedEvent } from "#events/battle-scene";
|
||||
import { BattleSceneEventType } from "#events/battle-scene";
|
||||
@ -57,7 +58,7 @@ import { PokemonIconAnimHandler, PokemonIconAnimMode } from "#ui/pokemon-icon-an
|
||||
import { ScrollBar } from "#ui/scroll-bar";
|
||||
import { StarterContainer } from "#ui/starter-container";
|
||||
import { StatsContainer } from "#ui/stats-container";
|
||||
import { addBBCodeTextObject, addTextObject, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, addTextObject } from "#ui/text";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
import {
|
||||
BooleanHolder,
|
||||
@ -1476,7 +1477,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
|
||||
loop: -1,
|
||||
// Make the initial bounce a little randomly delayed
|
||||
delay: randIntRange(0, 50) * 5,
|
||||
loopDelay: 1000,
|
||||
loopDelay: fixedInt(1000),
|
||||
tweens: [
|
||||
{
|
||||
targets: icon,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { getStatKey, PERMANENT_STATS } from "#enums/stat";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor, TextStyle } from "#ui/text";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { addBBCodeTextObject, addTextObject, getTextColor } from "#ui/text";
|
||||
import i18next from "i18next";
|
||||
import type BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText";
|
||||
|
||||
|
@ -16,6 +16,7 @@ import { PlayerGender } from "#enums/player-gender";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { getStatKey, PERMANENT_STATS, Stat } from "#enums/stat";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import type { PlayerPokemon } from "#field/pokemon";
|
||||
import { modifierSortFunc, PokemonHeldItemModifier } from "#modifiers/modifier";
|
||||
@ -24,7 +25,7 @@ import type { PokemonMove } from "#moves/pokemon-move";
|
||||
import type { Variant } from "#sprites/variant";
|
||||
import { getVariantTint } from "#sprites/variant";
|
||||
import { achvs } from "#system/achv";
|
||||
import { addBBCodeTextObject, addTextObject, getBBCodeFrag, TextStyle } from "#ui/text";
|
||||
import { addBBCodeTextObject, addTextObject, getBBCodeFrag } from "#ui/text";
|
||||
import { UiHandler } from "#ui/ui-handler";
|
||||
import {
|
||||
fixedInt,
|
||||
@ -354,18 +355,13 @@ export class SummaryUiHandler extends UiHandler {
|
||||
} catch (err: unknown) {
|
||||
console.error(`Failed to play animation for ${spriteKey}`, err);
|
||||
}
|
||||
this.pokemonSprite.setPipelineData("teraColor", getTypeRgb(this.pokemon.getTeraType()));
|
||||
this.pokemonSprite.setPipelineData("isTerastallized", this.pokemon.isTerastallized);
|
||||
this.pokemonSprite.setPipelineData("ignoreTimeTint", true);
|
||||
this.pokemonSprite.setPipelineData("spriteKey", this.pokemon.getSpriteKey());
|
||||
this.pokemonSprite.setPipelineData(
|
||||
"shiny",
|
||||
this.pokemon.summonData.illusion?.basePokemon.shiny ?? this.pokemon.shiny,
|
||||
);
|
||||
this.pokemonSprite.setPipelineData(
|
||||
"variant",
|
||||
this.pokemon.summonData.illusion?.basePokemon.variant ?? this.pokemon.variant,
|
||||
);
|
||||
this.pokemonSprite
|
||||
.setPipelineData("teraColor", getTypeRgb(this.pokemon.getTeraType()))
|
||||
.setPipelineData("isTerastallized", this.pokemon.isTerastallized)
|
||||
.setPipelineData("ignoreTimeTint", true)
|
||||
.setPipelineData("spriteKey", this.pokemon.getSpriteKey())
|
||||
.setPipelineData("shiny", this.pokemon.shiny)
|
||||
.setPipelineData("variant", this.pokemon.variant);
|
||||
["spriteColors", "fusionSpriteColors"].map(k => {
|
||||
delete this.pokemonSprite.pipelineData[`${k}Base`];
|
||||
if (this.pokemon?.summonData.speciesForm) {
|
||||
@ -463,9 +459,7 @@ export class SummaryUiHandler extends UiHandler {
|
||||
this.fusionShinyIcon.setPosition(this.shinyIcon.x, this.shinyIcon.y);
|
||||
this.fusionShinyIcon.setVisible(doubleShiny);
|
||||
if (isFusion) {
|
||||
this.fusionShinyIcon.setTint(
|
||||
getVariantTint(this.pokemon.summonData.illusion?.basePokemon.fusionVariant ?? this.pokemon.fusionVariant),
|
||||
);
|
||||
this.fusionShinyIcon.setTint(getVariantTint(this.pokemon.fusionVariant));
|
||||
}
|
||||
|
||||
this.pokeball.setFrame(getPokeballAtlasKey(this.pokemon.pokeball));
|
||||
@ -810,24 +804,34 @@ export class SummaryUiHandler extends UiHandler {
|
||||
case Page.PROFILE: {
|
||||
const profileContainer = globalScene.add.container(0, -pageBg.height);
|
||||
pageContainer.add(profileContainer);
|
||||
const otColor =
|
||||
globalScene.gameData.gender === PlayerGender.FEMALE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE;
|
||||
const usernameReplacement =
|
||||
globalScene.gameData.gender === PlayerGender.FEMALE
|
||||
? i18next.t("trainerNames:player_f")
|
||||
: i18next.t("trainerNames:player_m");
|
||||
|
||||
// TODO: should add field for original trainer name to Pokemon object, to support gift/traded Pokemon from MEs
|
||||
const trainerText = addBBCodeTextObject(
|
||||
7,
|
||||
12,
|
||||
`${i18next.t("pokemonSummary:ot")}/${getBBCodeFrag(loggedInUser?.username || i18next.t("pokemonSummary:unknown"), globalScene.gameData.gender === PlayerGender.FEMALE ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE)}`,
|
||||
`${i18next.t("pokemonSummary:ot")}/${getBBCodeFrag(
|
||||
!globalScene.hideUsername
|
||||
? loggedInUser?.username || i18next.t("pokemonSummary:unknown")
|
||||
: usernameReplacement,
|
||||
otColor,
|
||||
)}`,
|
||||
TextStyle.SUMMARY_ALT,
|
||||
);
|
||||
trainerText.setOrigin(0, 0);
|
||||
).setOrigin(0);
|
||||
profileContainer.add(trainerText);
|
||||
|
||||
const idToDisplay = globalScene.hideUsername ? "*****" : globalScene.gameData.trainerId.toString();
|
||||
const trainerIdText = addTextObject(
|
||||
141,
|
||||
12,
|
||||
`${i18next.t("pokemonSummary:idNo")}${globalScene.gameData.trainerId.toString()}`,
|
||||
`${i18next.t("pokemonSummary:idNo")}${idToDisplay}`,
|
||||
TextStyle.SUMMARY_ALT,
|
||||
);
|
||||
trainerIdText.setOrigin(0, 0);
|
||||
).setOrigin(0);
|
||||
profileContainer.add(trainerIdText);
|
||||
|
||||
const typeLabel = addTextObject(7, 28, `${i18next.t("pokemonSummary:type")}/`, TextStyle.WINDOW_ALT);
|
||||
|
@ -1,79 +1,14 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { EggTier } from "#enums/egg-type";
|
||||
import { ModifierTier } from "#enums/modifier-tier";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiTheme } from "#enums/ui-theme";
|
||||
import i18next from "#plugins/i18n";
|
||||
import type { TextStyleOptions } from "#types/ui";
|
||||
import type Phaser from "phaser";
|
||||
import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText";
|
||||
import type InputText from "phaser3-rex-plugins/plugins/inputtext";
|
||||
|
||||
export enum TextStyle {
|
||||
MESSAGE,
|
||||
WINDOW,
|
||||
WINDOW_ALT,
|
||||
WINDOW_BATTLE_COMMAND,
|
||||
BATTLE_INFO,
|
||||
PARTY,
|
||||
PARTY_RED,
|
||||
PARTY_CANCEL_BUTTON,
|
||||
INSTRUCTIONS_TEXT,
|
||||
MOVE_LABEL,
|
||||
SUMMARY,
|
||||
SUMMARY_DEX_NUM,
|
||||
SUMMARY_DEX_NUM_GOLD,
|
||||
SUMMARY_ALT,
|
||||
SUMMARY_HEADER,
|
||||
SUMMARY_RED,
|
||||
SUMMARY_BLUE,
|
||||
SUMMARY_PINK,
|
||||
SUMMARY_GOLD,
|
||||
SUMMARY_GRAY,
|
||||
SUMMARY_GREEN,
|
||||
SUMMARY_STATS,
|
||||
SUMMARY_STATS_BLUE,
|
||||
SUMMARY_STATS_PINK,
|
||||
SUMMARY_STATS_GOLD,
|
||||
LUCK_VALUE,
|
||||
STATS_HEXAGON,
|
||||
GROWTH_RATE_TYPE,
|
||||
MONEY, // Money default styling (pale yellow)
|
||||
MONEY_WINDOW, // Money displayed in Windows (needs different colors based on theme)
|
||||
HEADER_LABEL,
|
||||
STATS_LABEL,
|
||||
STATS_VALUE,
|
||||
SETTINGS_VALUE,
|
||||
SETTINGS_LABEL,
|
||||
SETTINGS_LABEL_NAVBAR,
|
||||
SETTINGS_SELECTED,
|
||||
SETTINGS_LOCKED,
|
||||
EGG_LIST,
|
||||
EGG_SUMMARY_NAME,
|
||||
EGG_SUMMARY_DEX,
|
||||
STARTER_VALUE_LIMIT,
|
||||
TOOLTIP_TITLE,
|
||||
TOOLTIP_CONTENT,
|
||||
FILTER_BAR_MAIN,
|
||||
MOVE_INFO_CONTENT,
|
||||
MOVE_PP_FULL,
|
||||
MOVE_PP_HALF_FULL,
|
||||
MOVE_PP_NEAR_EMPTY,
|
||||
MOVE_PP_EMPTY,
|
||||
SMALLER_WINDOW_ALT,
|
||||
BGM_BAR,
|
||||
PERFECT_IV,
|
||||
ME_OPTION_DEFAULT, // Default style for choices in ME
|
||||
ME_OPTION_SPECIAL, // Style for choices with special requirements in ME
|
||||
SHADOW_TEXT, // To obscure unavailable options
|
||||
}
|
||||
|
||||
export interface TextStyleOptions {
|
||||
scale: number;
|
||||
styleOptions: Phaser.Types.GameObjects.Text.TextStyle | InputText.IConfig;
|
||||
shadowColor: string;
|
||||
shadowXpos: number;
|
||||
shadowYpos: number;
|
||||
}
|
||||
|
||||
export function addTextObject(
|
||||
x: number,
|
||||
y: number,
|
||||
@ -87,9 +22,10 @@ export function addTextObject(
|
||||
extraStyleOptions,
|
||||
);
|
||||
|
||||
const ret = globalScene.add.text(x, y, content, styleOptions);
|
||||
ret.setScale(scale);
|
||||
ret.setShadow(shadowXpos, shadowYpos, shadowColor);
|
||||
const ret = globalScene.add
|
||||
.text(x, y, content, styleOptions)
|
||||
.setScale(scale)
|
||||
.setShadow(shadowXpos, shadowYpos, shadowColor);
|
||||
if (!(styleOptions as Phaser.Types.GameObjects.Text.TextStyle).lineSpacing) {
|
||||
ret.setLineSpacing(scale * 30);
|
||||
}
|
||||
@ -107,8 +43,7 @@ export function setTextStyle(
|
||||
globalScene.uiTheme,
|
||||
extraStyleOptions,
|
||||
);
|
||||
obj.setScale(scale);
|
||||
obj.setShadow(shadowXpos, shadowYpos, shadowColor);
|
||||
obj.setScale(scale).setShadow(shadowXpos, shadowYpos, shadowColor);
|
||||
if (!(styleOptions as Phaser.Types.GameObjects.Text.TextStyle).lineSpacing) {
|
||||
obj.setLineSpacing(scale * 30);
|
||||
}
|
||||
@ -133,8 +68,7 @@ export function addBBCodeTextObject(
|
||||
|
||||
const ret = new BBCodeText(globalScene, x, y, content, styleOptions as BBCodeText.TextStyle);
|
||||
globalScene.add.existing(ret);
|
||||
ret.setScale(scale);
|
||||
ret.setShadow(shadowXpos, shadowYpos, shadowColor);
|
||||
ret.setScale(scale).setShadow(shadowXpos, shadowYpos, shadowColor);
|
||||
if (!(styleOptions as BBCodeText.TextStyle).lineSpacing) {
|
||||
ret.setLineSpacing(scale * 60);
|
||||
}
|
||||
|
@ -5,10 +5,11 @@ import { TimedEventDisplay } from "#app/timed-event-manager";
|
||||
import { getSplashMessages } from "#data/splash-messages";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { version } from "#package.json";
|
||||
import { OptionSelectUiHandler } from "#ui/option-select-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { fixedInt, randInt, randItem } from "#utils/common";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { Button } from "#enums/buttons";
|
||||
import type { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import type { TextStyle } from "#ui/text";
|
||||
import { getTextColor } from "#ui/text";
|
||||
|
||||
/**
|
||||
|
@ -2,6 +2,7 @@ import { globalScene } from "#app/global-scene";
|
||||
import type { Button } from "#enums/buttons";
|
||||
import { Device } from "#enums/devices";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { AchvBar } from "#ui/achv-bar";
|
||||
import { AchvsUiHandler } from "#ui/achvs-ui-handler";
|
||||
@ -52,7 +53,7 @@ import { StarterSelectUiHandler } from "#ui/starter-select-ui-handler";
|
||||
import { SummaryUiHandler } from "#ui/summary-ui-handler";
|
||||
import { TargetSelectUiHandler } from "#ui/target-select-ui-handler";
|
||||
import { TestDialogueUiHandler } from "#ui/test-dialogue-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { TitleUiHandler } from "#ui/title-ui-handler";
|
||||
import type { UiHandler } from "#ui/ui-handler";
|
||||
import { addWindow } from "#ui/ui-theme";
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { updateUserInfo } from "#app/account";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { TextStyle } from "#enums/text-style";
|
||||
import type { UiMode } from "#enums/ui-mode";
|
||||
import type { ModalConfig } from "#ui/modal-ui-handler";
|
||||
import { ModalUiHandler } from "#ui/modal-ui-handler";
|
||||
import { addTextObject, TextStyle } from "#ui/text";
|
||||
import { addTextObject } from "#ui/text";
|
||||
import { sessionIdKey } from "#utils/common";
|
||||
import { removeCookie } from "#utils/cookies";
|
||||
import i18next from "i18next";
|
||||
|
@ -145,8 +145,8 @@ describe("Abilities - Illusion", () => {
|
||||
|
||||
const zoroark = game.scene.getPlayerPokemon()!;
|
||||
|
||||
expect(zoroark.name).equals("Axew");
|
||||
expect(zoroark.getNameToRender()).equals("axew nickname");
|
||||
expect(zoroark.summonData.illusion?.name).equals("Axew");
|
||||
expect(zoroark.getNameToRender(true)).equals("axew nickname");
|
||||
expect(zoroark.getGender(false, true)).equals(Gender.FEMALE);
|
||||
expect(zoroark.isShiny(true)).equals(true);
|
||||
expect(zoroark.getPokeball(true)).equals(PokeballType.GREAT_BALL);
|
||||
|
Loading…
Reference in New Issue
Block a user