diff --git a/package.json b/package.json index 24aa6243b75..eb1b71b4e18 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,8 @@ "node": ">=20.0.0" }, "imports": { + "#enums": "./enums", + "#enums/*": "./enums/*", "#app": "./src/main.js", "#app/*": "./src/*", "#test/*": "./src/test/*" diff --git a/public/update-source-comments.py b/public/update-source-comments.py index 34f0c28dd4c..410d1a42566 100644 --- a/public/update-source-comments.py +++ b/public/update-source-comments.py @@ -1,6 +1,6 @@ import re -filenames = [['src/data/enums/moves.ts', 'move'], ['src/data/enums/abilities.ts', 'ability'], ['src/data/enums/species.ts', 'Pokémon']] +filenames = [['src/enums/moves.ts', 'move'], ['src/enums/abilities.ts', 'ability'], ['src/enums/species.ts', 'Pokémon']] commentBlockStart = re.compile('\/\*[^\*].*') # Regex for the start of a comment block commentBlockEnd = re.compile('.*,\*\/') # Regex for the end of a comment block diff --git a/src/battle-scene.ts b/src/battle-scene.ts index a4ed394f862..ab36c707025 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -9,12 +9,9 @@ import { PokeballType } from "./data/pokeball"; import { initCommonAnims, initMoveAnim, loadCommonAnimAssets, loadMoveAnimAssets, populateAnims } from "./data/battle-anims"; import { Phase } from "./phase"; import { initGameSpeed } from "./system/game-speed"; -import { Biome } from "./data/enums/biome"; import { Arena, ArenaBase } from "./field/arena"; import { GameData } from "./system/game-data"; -import { PlayerGender } from "./data/enums/player-gender"; import { TextStyle, addTextObject, getTextColor } from "./ui/text"; -import { Moves } from "./data/enums/moves"; import { allMoves } from "./data/move"; import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesForWave, getLuckString, getLuckTextTint, getModifierPoolForType, getPartyLuckValue } from "./modifier/modifier-type"; import AbilityBar from "./ui/ability-bar"; @@ -31,7 +28,6 @@ import TrainerData from "./system/trainer-data"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { pokemonPrevolutions } from "./data/pokemon-evolutions"; import PokeballTray from "./ui/pokeball-tray"; -import { Species } from "./data/enums/species"; import InvertPostFX from "./pipelines/invert"; import { Achv, ModifierAchv, MoneyAchv, achvs } from "./system/achv"; import { Voucher, vouchers } from "./system/voucher"; @@ -42,14 +38,12 @@ import PokemonData from "./system/pokemon-data"; import { Nature } from "./data/nature"; import { SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, pokemonFormChanges } from "./data/pokemon-forms"; import { FormChangePhase, QuietFormChangePhase } from "./form-change-phase"; -import { BattleSpec } from "./enums/battle-spec"; import { getTypeRgb } from "./data/type"; import PokemonSpriteSparkleHandler from "./field/pokemon-sprite-sparkle-handler"; import CharSprite from "./ui/char-sprite"; import DamageNumberHandler from "./field/damage-number-handler"; import PokemonInfoContainer from "./ui/pokemon-info-container"; import { biomeDepths, getBiomeName } from "./data/biomes"; -import { UiTheme } from "./enums/ui-theme"; import { SceneBase } from "./scene-base"; import CandyBar from "./ui/candy-bar"; import { Variant, variantData } from "./data/variant"; @@ -57,13 +51,9 @@ import { Localizable } from "./plugins/i18n"; import * as Overrides from "./overrides"; import {InputsController} from "./inputs-controller"; import {UiInputs} from "./ui-inputs"; -import { MoneyFormat } from "./enums/money-format"; import { NewArenaEvent } from "./events/battle-scene"; -import { Abilities } from "./data/enums/abilities"; +import { Abilities, BattleSpec, BattleStyle, Biome, EaseType, ExpNotification, MoneyFormat, Moves, PlayerGender, UiTheme, Species} from "#enums"; import ArenaFlyout from "./ui/arena-flyout"; -import { EaseType } from "./ui/enums/ease-type"; -import { ExpNotification } from "./enums/exp-notification"; -import { BattleStyle } from "./enums/battle-style"; export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1"; diff --git a/src/battle.ts b/src/battle.ts index 68e16cb28bb..6650903cb18 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -3,12 +3,8 @@ import { EnemyPokemon, PlayerPokemon, QueuedMove } from "./field/pokemon"; import { Command } from "./ui/command-ui-handler"; import * as Utils from "./utils"; import Trainer, { TrainerVariant } from "./field/trainer"; -import { Species } from "./data/enums/species"; -import { Moves } from "./data/enums/moves"; -import { TrainerType } from "./data/enums/trainer-type"; import { GameMode } from "./game-mode"; -import { BattleSpec } from "./enums/battle-spec"; -import { PlayerGender } from "./data/enums/player-gender"; +import { BattleSpec, Moves, PlayerGender, Species, TrainerType } from "#enums"; import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier"; import { PokeballType } from "./data/pokeball"; import {trainerConfigs} from "#app/data/trainer-config"; diff --git a/src/configs/inputs/cfg_keyboard_qwerty.ts b/src/configs/inputs/cfg_keyboard_qwerty.ts index 83472529697..ef6a0cceb8f 100644 --- a/src/configs/inputs/cfg_keyboard_qwerty.ts +++ b/src/configs/inputs/cfg_keyboard_qwerty.ts @@ -1,4 +1,4 @@ -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; const cfg_keyboard_qwerty = { diff --git a/src/configs/inputs/configHandler.ts b/src/configs/inputs/configHandler.ts index 0770ebffce1..f327efce287 100644 --- a/src/configs/inputs/configHandler.ts +++ b/src/configs/inputs/configHandler.ts @@ -1,4 +1,4 @@ -import {Device} from "#app/enums/devices"; +import {Device} from "#enums"; /** * Retrieves the key associated with the specified keycode from the mapping. diff --git a/src/configs/inputs/pad_dualshock.ts b/src/configs/inputs/pad_dualshock.ts index d58a8b2879d..0ec79ab9614 100644 --- a/src/configs/inputs/pad_dualshock.ts +++ b/src/configs/inputs/pad_dualshock.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums"; /** * Dualshock mapping diff --git a/src/configs/inputs/pad_generic.ts b/src/configs/inputs/pad_generic.ts index 916f8c82add..76aedd963f0 100644 --- a/src/configs/inputs/pad_generic.ts +++ b/src/configs/inputs/pad_generic.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums"; /** * Generic pad mapping diff --git a/src/configs/inputs/pad_procon.ts b/src/configs/inputs/pad_procon.ts index 4b7bd8457b0..c94ff39bf70 100644 --- a/src/configs/inputs/pad_procon.ts +++ b/src/configs/inputs/pad_procon.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "#app/system/settings/settings-gamepad.js"; -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums"; /** * Nintendo Pro Controller mapping diff --git a/src/configs/inputs/pad_unlicensedSNES.ts b/src/configs/inputs/pad_unlicensedSNES.ts index 106fbc9eb8f..07926ad682e 100644 --- a/src/configs/inputs/pad_unlicensedSNES.ts +++ b/src/configs/inputs/pad_unlicensedSNES.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums"; /** * 081f-e401 - UnlicensedSNES diff --git a/src/configs/inputs/pad_xbox360.ts b/src/configs/inputs/pad_xbox360.ts index 645829d5be2..01d8d9497da 100644 --- a/src/configs/inputs/pad_xbox360.ts +++ b/src/configs/inputs/pad_xbox360.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums"; /** * Generic pad mapping diff --git a/src/data/ability.ts b/src/data/ability.ts index 82d72e9ac52..fd1d048a4ee 100755 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -6,23 +6,19 @@ import { MovePhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from " import { getPokemonMessage, getPokemonNameWithAffix } from "../messages"; import { Weather, WeatherType } from "./weather"; import { BattlerTag } from "./battler-tags"; -import { BattlerTagType } from "./enums/battler-tag-type"; +import { ArenaTagType, Abilities, BattlerTagType, Moves, Species } from "#enums"; import { StatusEffect, getNonVolatileStatusEffects, getStatusEffectDescriptor, getStatusEffectHealText } from "./status-effect"; import { Gender } from "./gender"; import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, IncrementMovePriorityAttr, VariableMoveTypeAttr, RandomMovesetMoveAttr, RandomMoveAttr, NaturePowerAttr, CopyMoveAttr } from "./move"; import { ArenaTagSide, ArenaTrapTag } from "./arena-tag"; -import { ArenaTagType } from "./enums/arena-tag-type"; import { Stat, getStatName } from "./pokemon-stat"; import { BerryModifier, PokemonHeldItemModifier } from "../modifier/modifier"; -import { Moves } from "./enums/moves"; import { TerrainType } from "./terrain"; import { SpeciesFormChangeManualTrigger } from "./pokemon-forms"; -import { Abilities } from "./enums/abilities"; import i18next, { Localizable } from "#app/plugins/i18n.js"; import { Command } from "../ui/command-ui-handler"; import { BerryModifierType } from "#app/modifier/modifier-type"; import { getPokeballName } from "./pokeball"; -import { Species } from "./enums/species"; import { BattlerIndex } from "#app/battle"; export class Ability implements Localizable { diff --git a/src/data/api.ts b/src/data/api.ts index 2a88fc8d410..96d704abb05 100644 --- a/src/data/api.ts +++ b/src/data/api.ts @@ -6,11 +6,9 @@ import PokemonSpecies, { PokemonForm, SpeciesFormKey, allSpecies } from "./pokem import { GrowthRate } from "./exp"; import { Type } from "./type"; import { allAbilities } from "./ability"; -import { Abilities } from "./enums/abilities"; -import { Species } from "./enums/species"; +import { Abilities, Moves, Species } from "#enums"; import { pokemonFormLevelMoves } from "./pokemon-level-moves"; import { tmSpecies } from "./tms"; -import { Moves } from "./enums/moves"; const targetMap = { "specific-move": MoveTarget.ATTACKER, diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 37420c2ac0b..bffca0ca7f0 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -7,13 +7,10 @@ import Pokemon, { HitResult, PokemonMove } from "../field/pokemon"; import { MoveEffectPhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase} from "../phases"; import { StatusEffect } from "./status-effect"; import { BattlerIndex } from "../battle"; -import { Moves } from "./enums/moves"; -import { ArenaTagType } from "./enums/arena-tag-type"; +import { Abilities, ArenaTagType, BattlerTagType, Moves } from "#enums"; import { BlockNonDirectDamageAbAttr, ProtectStatAbAttr, applyAbAttrs } from "./ability"; import { BattleStat } from "./battle-stat"; import { CommonAnim, CommonBattleAnim } from "./battle-anims"; -import { Abilities } from "./enums/abilities"; -import { BattlerTagType } from "./enums/battler-tag-type"; import i18next from "i18next"; export enum ArenaTagSide { diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 75c883ec1e7..19ebe8ad7af 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -5,7 +5,7 @@ import Pokemon from "../field/pokemon"; import * as Utils from "../utils"; import { BattlerIndex } from "../battle"; import { Element } from "json-stable-stringify"; -import { Moves } from "./enums/moves"; +import { Moves } from "#enums"; //import fs from 'vite-plugin-fs/browser'; export enum AnimFrameTarget { diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index bfdeb2189dc..b2b58339c9b 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -5,18 +5,15 @@ import Pokemon, { MoveResult, HitResult } from "../field/pokemon"; import { Stat, getStatName } from "./pokemon-stat"; import { StatusEffect } from "./status-effect"; import * as Utils from "../utils"; -import { Moves } from "./enums/moves"; import { ChargeAttr, MoveFlags, allMoves } from "./move"; import { Type } from "./type"; import { BlockNonDirectDamageAbAttr, FlinchEffectAbAttr, ReverseDrainAbAttr, applyAbAttrs } from "./ability"; -import { Abilities } from "./enums/abilities"; -import { BattlerTagType } from "./enums/battler-tag-type"; +import { Abilities, BattlerTagType, Moves, Species } from "#enums"; import { TerrainType } from "./terrain"; import { WeatherType } from "./weather"; import { BattleStat } from "./battle-stat"; import { allAbilities } from "./ability"; import { SpeciesFormChangeManualTrigger } from "./pokemon-forms"; -import { Species } from "./enums/species"; export enum BattlerTagLapseType { FAINT, diff --git a/src/data/berry.ts b/src/data/berry.ts index 38f8f924c8a..f865ee43682 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -2,12 +2,11 @@ import { PokemonHealPhase, StatChangePhase } from "../phases"; import { getPokemonMessage } from "../messages"; import Pokemon, { HitResult } from "../field/pokemon"; import { BattleStat } from "./battle-stat"; -import { BattlerTagType } from "./enums/battler-tag-type"; +import { BattlerTagType, BerryType } from "#enums"; import { getStatusEffectHealText } from "./status-effect"; import * as Utils from "../utils"; import { DoubleBerryEffectAbAttr, ReduceBerryUseThresholdAbAttr, applyAbAttrs } from "./ability"; import i18next from "../plugins/i18n"; -import { BerryType } from "./enums/berry-type"; export function getBerryName(berryType: BerryType): string { return i18next.t(`berry:${BerryType[berryType]}.name`); diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 43cafb46fce..1d9e9638914 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -1,10 +1,7 @@ -import { Species } from "./enums/species"; import { Type } from "./type"; import * as Utils from "../utils"; import beautify from "json-beautify"; -import { TrainerType } from "./enums/trainer-type"; -import { TimeOfDay } from "./enums/time-of-day"; -import { Biome } from "./enums/biome"; +import { Biome, Species, TimeOfDay, TrainerType } from "#enums"; import {pokemonEvolutions, SpeciesFormEvolution} from "./pokemon-evolutions"; import i18next from "i18next"; diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 916f59ab2c2..9f9d5ef5823 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -1,14 +1,12 @@ import * as Utils from "../utils"; -import { Challenges } from "./enums/challenges"; +import { Challenges, TrainerType, Species } from "#enums"; import i18next from "#app/plugins/i18n.js"; import { GameData } from "#app/system/game-data.js"; import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-species"; import Pokemon from "#app/field/pokemon.js"; import { BattleType, FixedBattleConfig } from "#app/battle.js"; -import { TrainerType } from "./enums/trainer-type"; import Trainer, { TrainerVariant } from "#app/field/trainer.js"; import { GameMode } from "#app/game-mode.js"; -import { Species } from "./enums/species"; import { Type } from "./type"; /** diff --git a/src/data/daily-run.ts b/src/data/daily-run.ts index c9b097bfcc0..8be7edecbe4 100644 --- a/src/data/daily-run.ts +++ b/src/data/daily-run.ts @@ -2,9 +2,8 @@ import BattleScene from "../battle-scene"; import { PlayerPokemon } from "../field/pokemon"; import { Starter } from "../ui/starter-select-ui-handler"; import * as Utils from "../utils"; -import { Species } from "./enums/species"; import PokemonSpecies, { PokemonSpeciesForm, getPokemonSpecies, getPokemonSpeciesForm, speciesStarters } from "./pokemon-species"; -import { PartyMemberStrength } from "./enums/party-member-strength"; +import { PartyMemberStrength, Species } from "#enums"; export interface DailyRunConfig { seed: integer; diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts index 5b5e0d865ba..bcbb4dfcbc1 100644 --- a/src/data/dialogue.ts +++ b/src/data/dialogue.ts @@ -1,6 +1,5 @@ import {trainerConfigs} from "./trainer-config"; -import {TrainerType} from "./enums/trainer-type"; -import {BattleSpec} from "../enums/battle-spec"; +import {BattleSpec, TrainerType} from "#enums"; export interface TrainerTypeMessages { encounter?: string | string[], diff --git a/src/data/egg-moves.ts b/src/data/egg-moves.ts index bed989849d9..23880625a8a 100644 --- a/src/data/egg-moves.ts +++ b/src/data/egg-moves.ts @@ -1,5 +1,4 @@ -import { Moves } from "./enums/moves"; -import { Species } from "./enums/species"; +import { Moves, Species } from "#enums"; import { allMoves } from "./move"; import * as Utils from "../utils"; diff --git a/src/data/egg.ts b/src/data/egg.ts index da6100446ec..00393518f69 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -1,7 +1,6 @@ import BattleScene from "../battle-scene"; -import { Species } from "./enums/species"; import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-species"; -import { EggTier } from "./enums/egg-type"; +import { EggTier, Species } from "#enums"; import i18next from "../plugins/i18n"; export const EGG_SEED = 1073741824; diff --git a/src/data/move.ts b/src/data/move.ts index 3979314568b..9f8c861fe3d 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1,9 +1,7 @@ -import { Moves } from "./enums/moves"; import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims"; import { BattleEndPhase, MovePhase, NewBattlePhase, PartyStatusCurePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases"; import { BattleStat, getBattleStatName } from "./battle-stat"; import { EncoreTag } from "./battler-tags"; -import { BattlerTagType } from "./enums/battler-tag-type"; import { getPokemonMessage } from "../messages"; import Pokemon, { AttackMoveResult, EnemyPokemon, HitResult, MoveResult, PlayerPokemon, PokemonMove, TurnMove } from "../field/pokemon"; import { StatusEffect, getStatusEffectHealText, isNonVolatileStatusEffect, getNonVolatileStatusEffects} from "./status-effect"; @@ -11,19 +9,16 @@ import { Type } from "./type"; import * as Utils from "../utils"; import { WeatherType } from "./weather"; import { ArenaTagSide, ArenaTrapTag } from "./arena-tag"; -import { ArenaTagType } from "./enums/arena-tag-type"; import { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, BlockRecoilDamageAttr, BlockOneHitKOAbAttr, IgnoreContactAbAttr, MaxMultiHitAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr, applyPostDefendAbAttrs, PostDefendContactApplyStatusEffectAbAttr, MoveAbilityBypassAbAttr, ReverseDrainAbAttr, FieldPreventExplosiveMovesAbAttr, ForceSwitchOutImmunityAbAttr, BlockItemTheftAbAttr, applyPostAttackAbAttrs, ConfusionOnStatusEffectAbAttr, HealFromBerryUseAbAttr } from "./ability"; -import { Abilities } from "./enums/abilities"; +import { Abilities, ArenaTagType, BattlerTagType, Biome, Moves, Species } from "#enums"; import { allAbilities } from "./ability"; import { PokemonHeldItemModifier, BerryModifier, PreserveBerryModifier } from "../modifier/modifier"; import { BattlerIndex } from "../battle"; import { Stat } from "./pokemon-stat"; import { TerrainType } from "./terrain"; import { SpeciesFormChangeActiveTrigger } from "./pokemon-forms"; -import { Species } from "./enums/species"; import { ModifierPoolType } from "#app/modifier/modifier-type"; import { Command } from "../ui/command-ui-handler"; -import { Biome } from "./enums/biome"; import i18next, { Localizable } from "../plugins/i18n"; import { getBerryEffectFunc } from "./berry"; @@ -1797,7 +1792,7 @@ export class RemoveHeldItemAttr extends MoveEffectAttr { } /** - * Attribute that causes targets of the move to eat a berry. If chosenBerry is not overriden, a random berry will be picked from the target's inventory. + * Attribute that causes targets of the move to eat a berry. If chosenBerry is not overridden, a random berry will be picked from the target's inventory. */ export class EatBerryAttr extends MoveEffectAttr { protected chosenBerry: BerryModifier; diff --git a/src/data/nature.ts b/src/data/nature.ts index c9709d5ee4c..55b38f5ba86 100644 --- a/src/data/nature.ts +++ b/src/data/nature.ts @@ -1,7 +1,7 @@ import { Stat, getStatName } from "./pokemon-stat"; import * as Utils from "../utils"; import { TextStyle, getBBCodeFrag } from "../ui/text"; -import { UiTheme } from "#app/enums/ui-theme"; +import { UiTheme } from "#enums"; import i18next from "i18next"; export enum Nature { diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index 9cfcad41c08..2ccac3522a7 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -1,15 +1,12 @@ import { Gender } from "./gender"; -import { Moves } from "./enums/moves"; import { PokeballType } from "./pokeball"; import Pokemon from "../field/pokemon"; import { Stat } from "./pokemon-stat"; -import { Species } from "./enums/species"; import { Type } from "./type"; import * as Utils from "../utils"; import { SpeciesFormKey } from "./pokemon-species"; import { WeatherType } from "./weather"; -import { Biome } from "./enums/biome"; -import { TimeOfDay } from "./enums/time-of-day"; +import { Biome, Moves, Species, TimeOfDay } from "#enums"; import { Nature } from "./nature"; export enum SpeciesWildEvolutionDelay { diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 998752f4d34..b00b57826cf 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -1,12 +1,9 @@ -import { TimeOfDay } from "./enums/time-of-day"; import { PokemonFormChangeItemModifier } from "../modifier/modifier"; import Pokemon from "../field/pokemon"; -import { Moves } from "./enums/moves"; import { SpeciesFormKey } from "./pokemon-species"; -import { Species } from "./enums/species"; import { StatusEffect } from "./status-effect"; import { MoveCategory, allMoves } from "./move"; -import { Abilities } from "./enums/abilities"; +import { Abilities, Moves, Species, TimeOfDay } from "#enums"; export enum FormChangeItem { NONE, diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index 89ae23f1ac2..ffa42eda453 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -1,5 +1,4 @@ -import { Moves } from "./enums/moves"; -import { Species } from "./enums/species"; +import { Moves, Species } from "#enums"; export type LevelMoves = ([integer, Moves])[]; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 08dd59b6c01..8313a94cb50 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1,17 +1,15 @@ -import { Abilities } from "./enums/abilities"; +import { Abilities, PartyMemberStrength, Species } from "#enums"; import BattleScene, { AnySound } from "../battle-scene"; import { Variant, variantColorCache } from "./variant"; import { variantData } from "./variant"; import { GrowthRate } from "./exp"; import { SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions"; -import { Species } from "./enums/species"; import { Type } from "./type"; import { LevelMoves, pokemonFormLevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves } from "./pokemon-level-moves"; import { uncatchableSpecies } from "./biomes"; import * as Utils from "../utils"; import { StarterMoveset } from "../system/game-data"; import { speciesEggMoves } from "./egg-moves"; -import { PartyMemberStrength } from "./enums/party-member-strength"; import { GameMode } from "../game-mode"; import { QuantizerCelebi, argbFromRgba, rgbaFromArgb } from "@material/material-color-utilities"; import { VariantSet } from "./variant"; diff --git a/src/data/tms.ts b/src/data/tms.ts index dfde4ef948e..43a1fc049be 100644 --- a/src/data/tms.ts +++ b/src/data/tms.ts @@ -1,6 +1,5 @@ import { ModifierTier } from "../modifier/modifier-tier"; -import { Moves } from "./enums/moves"; -import { Species } from "./enums/species"; +import { Moves, Species } from "#enums"; interface TmSpecies { [key: integer]: Array> diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 43ce8c8444a..c083453ac00 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -2,18 +2,15 @@ import BattleScene, {startingWave} from "../battle-scene"; import {ModifierTypeFunc, modifierTypes} from "../modifier/modifier-type"; import {EnemyPokemon} from "../field/pokemon"; import * as Utils from "../utils"; -import {TrainerType} from "./enums/trainer-type"; -import {Moves} from "./enums/moves"; import {PokeballType} from "./pokeball"; import {pokemonEvolutions, pokemonPrevolutions} from "./pokemon-evolutions"; import PokemonSpecies, {getPokemonSpecies, PokemonSpeciesFilter} from "./pokemon-species"; -import {Species} from "./enums/species"; import {tmSpecies} from "./tms"; import {Type} from "./type"; import {doubleBattleDialogue} from "./dialogue"; import {PersistentModifier} from "../modifier/modifier"; import {TrainerVariant} from "../field/trainer"; -import {PartyMemberStrength} from "./enums/party-member-strength"; +import {Moves, PartyMemberStrength, Species, TrainerType} from "#enums"; import {getIsInitialized, initI18n} from "#app/plugins/i18n"; import i18next from "i18next"; diff --git a/src/data/trainer-names.ts b/src/data/trainer-names.ts index 5cd6850fba0..1233760da81 100644 --- a/src/data/trainer-names.ts +++ b/src/data/trainer-names.ts @@ -1,4 +1,4 @@ -import { TrainerType } from "./enums/trainer-type"; +import { TrainerType } from "#enums"; import * as Utils from "../utils"; class TrainerNameConfig { diff --git a/src/data/weather.ts b/src/data/weather.ts index 1df94b02da1..53b87445518 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -1,4 +1,4 @@ -import { Biome } from "./enums/biome"; +import { Biome } from "#enums"; import { getPokemonMessage, getPokemonNameWithAffix } from "../messages"; import Pokemon from "../field/pokemon"; import { Type } from "./type"; diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index b86e7a9f2ca..7264b5c8ee1 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -5,12 +5,11 @@ import * as Utils from "./utils"; import { Mode } from "./ui/ui"; import { EGG_SEED, Egg, GachaType, getLegendaryGachaSpeciesForTimestamp } from "./data/egg"; import EggHatchSceneHandler from "./ui/egg-hatch-scene-handler"; -import { Species } from "./data/enums/species"; import { PlayerPokemon } from "./field/pokemon"; import { getPokemonSpecies, speciesStarters } from "./data/pokemon-species"; import { achvs } from "./system/achv"; import { pokemonPrevolutions } from "./data/pokemon-evolutions"; -import { EggTier } from "./data/enums/egg-type"; +import { EggTier, Species } from "#enums"; import PokemonInfoContainer from "./ui/pokemon-info-container"; import EggCounterContainer from "./ui/egg-counter-container"; import { EggCountChangedEvent } from "./events/egg"; diff --git a/src/data/enums/abilities.ts b/src/enums/abilities.ts similarity index 100% rename from src/data/enums/abilities.ts rename to src/enums/abilities.ts diff --git a/src/data/enums/arena-tag-type.ts b/src/enums/arena-tag-type.ts similarity index 100% rename from src/data/enums/arena-tag-type.ts rename to src/enums/arena-tag-type.ts diff --git a/src/data/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts similarity index 100% rename from src/data/enums/battler-tag-type.ts rename to src/enums/battler-tag-type.ts diff --git a/src/data/enums/berry-type.ts b/src/enums/berry-type.ts similarity index 100% rename from src/data/enums/berry-type.ts rename to src/enums/berry-type.ts diff --git a/src/data/enums/biome.ts b/src/enums/biome.ts similarity index 100% rename from src/data/enums/biome.ts rename to src/enums/biome.ts diff --git a/src/data/enums/challenges.ts b/src/enums/challenges.ts similarity index 100% rename from src/data/enums/challenges.ts rename to src/enums/challenges.ts diff --git a/src/ui/enums/ease-type.ts b/src/enums/ease-type.ts similarity index 100% rename from src/ui/enums/ease-type.ts rename to src/enums/ease-type.ts diff --git a/src/data/enums/egg-type.ts b/src/enums/egg-type.ts similarity index 100% rename from src/data/enums/egg-type.ts rename to src/enums/egg-type.ts diff --git a/src/data/enums/game-data-type.ts b/src/enums/game-data-type.ts similarity index 100% rename from src/data/enums/game-data-type.ts rename to src/enums/game-data-type.ts diff --git a/src/enums/index.ts b/src/enums/index.ts new file mode 100644 index 00000000000..e81c5d97f22 --- /dev/null +++ b/src/enums/index.ts @@ -0,0 +1,25 @@ +export * from "./abilities"; +export * from "./arena-tag-type"; +export * from "./battle-spec"; +export * from "./battle-style"; +export * from "./battler-tag-type"; +export * from "./berry-type"; +export * from "./biome"; +export * from "./buttons"; +export * from "./challenges"; +export * from "./devices"; +export * from "./ease-type"; +export * from "./egg-type"; +export * from "./exp-notification"; +export * from "./game-data-type"; +export * from "./money-format"; +export * from "./moves"; +export * from "./money-format"; +export * from "./party-member-strength"; +export * from "./passive"; +export * from "./player-gender"; +export * from "./species"; +export * from "./time-of-day"; +export * from "./trainer-type"; +export * from "./ui-theme"; + diff --git a/src/data/enums/moves.ts b/src/enums/moves.ts similarity index 100% rename from src/data/enums/moves.ts rename to src/enums/moves.ts diff --git a/src/data/enums/party-member-strength.ts b/src/enums/party-member-strength.ts similarity index 100% rename from src/data/enums/party-member-strength.ts rename to src/enums/party-member-strength.ts diff --git a/src/data/enums/passive.ts b/src/enums/passive.ts similarity index 100% rename from src/data/enums/passive.ts rename to src/enums/passive.ts diff --git a/src/data/enums/player-gender.ts b/src/enums/player-gender.ts similarity index 100% rename from src/data/enums/player-gender.ts rename to src/enums/player-gender.ts diff --git a/src/data/enums/species.ts b/src/enums/species.ts similarity index 100% rename from src/data/enums/species.ts rename to src/enums/species.ts diff --git a/src/data/enums/time-of-day.ts b/src/enums/time-of-day.ts similarity index 100% rename from src/data/enums/time-of-day.ts rename to src/enums/time-of-day.ts diff --git a/src/data/enums/trainer-type.ts b/src/enums/trainer-type.ts similarity index 100% rename from src/data/enums/trainer-type.ts rename to src/enums/trainer-type.ts diff --git a/src/field/events/arena.ts b/src/events/arena.ts similarity index 98% rename from src/field/events/arena.ts rename to src/events/arena.ts index b3d03fdfcae..64e53a07ee9 100644 --- a/src/field/events/arena.ts +++ b/src/events/arena.ts @@ -1,5 +1,5 @@ import { ArenaTagSide } from "#app/data/arena-tag.js"; -import { ArenaTagType } from "#app/data/enums/arena-tag-type.js"; +import { ArenaTagType } from "#enums"; import { TerrainType } from "#app/data/terrain.js"; import { WeatherType } from "#app/data/weather.js"; diff --git a/src/field/arena.ts b/src/field/arena.ts index 7885668b577..e3e9d644886 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -1,25 +1,20 @@ import BattleScene from "../battle-scene"; import { BiomePoolTier, PokemonPools, BiomeTierTrainerPools, biomePokemonPools, biomeTrainerPools } from "../data/biomes"; -import { Biome } from "../data/enums/biome"; +import { ArenaTagType, Biome, Moves, Species, TimeOfDay, TrainerType } from "#enums"; import * as Utils from "../utils"; import PokemonSpecies, { getPokemonSpecies } from "../data/pokemon-species"; -import { Species } from "../data/enums/species"; import { Weather, WeatherType, getTerrainClearMessage, getTerrainStartMessage, getWeatherClearMessage, getWeatherStartMessage } from "../data/weather"; import { CommonAnimPhase } from "../phases"; import { CommonAnim } from "../data/battle-anims"; import { Type } from "../data/type"; import Move from "../data/move"; import { ArenaTag, ArenaTagSide, getArenaTag } from "../data/arena-tag"; -import { ArenaTagType } from "../data/enums/arena-tag-type"; -import { TrainerType } from "../data/enums/trainer-type"; import { BattlerIndex } from "../battle"; -import { Moves } from "../data/enums/moves"; -import { TimeOfDay } from "../data/enums/time-of-day"; import { Terrain, TerrainType } from "../data/terrain"; import { PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, applyPostTerrainChangeAbAttrs, applyPostWeatherChangeAbAttrs } from "../data/ability"; import Pokemon from "./pokemon"; import * as Overrides from "../overrides"; -import { WeatherChangedEvent, TerrainChangedEvent, TagAddedEvent, TagRemovedEvent } from "./events/arena"; +import { WeatherChangedEvent, TerrainChangedEvent, TagAddedEvent, TagRemovedEvent } from "../events/arena"; export class Arena { public scene: BattleScene; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2da0cc8d15f..ce4ee6644dd 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3,7 +3,6 @@ import BattleScene, { AnySound } from "../battle-scene"; import { Variant, VariantSet, variantColorCache } from "#app/data/variant"; import { variantData } from "#app/data/variant"; import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from "../ui/battle-info"; -import { Moves } from "../data/enums/moves"; import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, VariableMoveTypeAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr, BypassBurnDamageReductionAttr, SacrificialAttrOnHit, MoveFlags } from "../data/move"; import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from "../data/pokemon-species"; import * as Utils from "../utils"; @@ -20,18 +19,13 @@ import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase, ToggleDoublePositionPhase } from "../phases"; import { BattleStat } from "../data/battle-stat"; import { BattlerTag, BattlerTagLapseType, EncoreTag, HelpingHandTag, HighestStatBoostTag, TypeBoostTag, getBattlerTag } from "../data/battler-tags"; -import { BattlerTagType } from "../data/enums/battler-tag-type"; -import { Species } from "../data/enums/species"; import { WeatherType } from "../data/weather"; import { TempBattleStat } from "../data/temp-battle-stat"; import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from "../data/arena-tag"; -import { ArenaTagType } from "../data/enums/arena-tag-type"; -import { Biome } from "../data/enums/biome"; +import { Abilities, ArenaTagType, Moves, BattlerTagType, Species, Biome, BattleSpec, BerryType } from "#enums"; import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldBattleStatMultiplierAbAttrs, FieldMultiplyBattleStatAbAttr } from "../data/ability"; -import { Abilities } from "#app/data/enums/abilities"; import PokemonData from "../system/pokemon-data"; import { BattlerIndex } from "../battle"; -import { BattleSpec } from "../enums/battle-spec"; import { Mode } from "../ui/ui"; import PartyUiHandler, { PartyOption, PartyUiMode } from "../ui/party-ui-handler"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; @@ -44,7 +38,6 @@ import { SpeciesFormChange, SpeciesFormChangeActiveTrigger, SpeciesFormChangeMov import { TerrainType } from "../data/terrain"; import { TrainerSlot } from "../data/trainer-config"; import * as Overrides from "../overrides"; -import { BerryType } from "../data/enums/berry-type"; import i18next from "../plugins/i18n"; import { speciesEggMoves } from "../data/egg-moves"; import { ModifierTier } from "../modifier/modifier-tier"; diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 1646866189b..c4af4be767b 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -11,8 +11,7 @@ import { trainerPartyTemplates, signatureSpecies } from "../data/trainer-config"; -import {PartyMemberStrength} from "../data/enums/party-member-strength"; -import {TrainerType} from "../data/enums/trainer-type"; +import {PartyMemberStrength, Species, TrainerType} from "#enums"; import {EnemyPokemon} from "./pokemon"; import * as Utils from "../utils"; import {PersistentModifier} from "../modifier/modifier"; @@ -20,7 +19,6 @@ import {trainerNamePools} from "../data/trainer-names"; import {ArenaTagSide, ArenaTrapTag} from "#app/data/arena-tag"; import {getIsInitialized, initI18n} from "#app/plugins/i18n"; import i18next from "i18next"; -import {Species} from "#app/data/enums/species"; export enum TrainerVariant { DEFAULT, diff --git a/src/form-change-phase.ts b/src/form-change-phase.ts index a8957bfc8b6..df60cc100f7 100644 --- a/src/form-change-phase.ts +++ b/src/form-change-phase.ts @@ -7,7 +7,7 @@ import { EndEvolutionPhase, EvolutionPhase } from "./evolution-phase"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "./field/pokemon"; import { Mode } from "./ui/ui"; import PartyUiHandler from "./ui/party-ui-handler"; -import { BattleSpec } from "./enums/battle-spec"; +import { BattleSpec } from "#enums"; import { BattlePhase, MovePhase, PokemonHealPhase } from "./phases"; import { getTypeRgb } from "./data/type"; diff --git a/src/game-mode.ts b/src/game-mode.ts index cb042b2757c..f0db6c04a52 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -2,8 +2,7 @@ import i18next from "i18next"; import { classicFixedBattles, FixedBattleConfig, FixedBattleConfigs } from "./battle"; import BattleScene from "./battle-scene"; import { allChallenges, applyChallenges, Challenge, ChallengeType, copyChallenge } from "./data/challenge"; -import { Biome } from "./data/enums/biome"; -import { Species } from "./data/enums/species"; +import { Biome, Species } from "#enums"; import PokemonSpecies, { allSpecies } from "./data/pokemon-species"; import { Arena } from "./field/arena"; import * as Overrides from "./overrides"; diff --git a/src/inputs-controller.ts b/src/inputs-controller.ts index 1f10197903c..5502292cac0 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -6,12 +6,11 @@ import pad_unlicensedSNES from "./configs/inputs/pad_unlicensedSNES"; import pad_xbox360 from "./configs/inputs/pad_xbox360"; import pad_dualshock from "./configs/inputs/pad_dualshock"; import pad_procon from "./configs/inputs/pad_procon"; -import {Button} from "./enums/buttons"; import {Mode} from "./ui/ui"; import SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler"; import SettingsKeyboardUiHandler from "./ui/settings/settings-keyboard-ui-handler"; import cfg_keyboard_qwerty from "./configs/inputs/cfg_keyboard_qwerty"; -import {Device} from "#app/enums/devices"; +import {Button, Device} from "#enums"; import { assign, getButtonWithKeycode, diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 7a097cc8b37..4b10af48280 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -1,6 +1,5 @@ import { GachaType } from "./data/egg"; -import { Biome } from "./data/enums/biome"; -import { TrainerType } from "./data/enums/trainer-type"; +import { Biome, TrainerType } from "#enums"; import { trainerConfigs } from "./data/trainer-config"; import { getBiomeHasProps } from "./field/arena"; import CacheBustedLoaderPlugin from "./plugins/cache-busted-loader-plugin"; diff --git a/src/messages.ts b/src/messages.ts index e2387094502..25a0674f208 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,4 +1,4 @@ -import { BattleSpec } from "./enums/battle-spec"; +import { BattleSpec } from "#enums"; import Pokemon from "./field/pokemon"; import i18next from "./plugins/i18n"; diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 03059915b54..e2ca5418fc7 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1,7 +1,6 @@ import * as Modifiers from "./modifier"; import { AttackMove, allMoves } from "../data/move"; -import { Moves } from "../data/enums/moves"; -import { Abilities } from "../data/enums/abilities"; +import { Abilities, BattlerTagType, BerryType, Moves } from "#enums"; import { PokeballType, getPokeballCatchMultiplier, getPokeballName } from "../data/pokeball"; import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove } from "../field/pokemon"; import { EvolutionItem, pokemonEvolutions } from "../data/pokemon-evolutions"; @@ -12,7 +11,6 @@ import PartyUiHandler, { PokemonMoveSelectFilter, PokemonSelectFilter } from ".. import * as Utils from "../utils"; import { TempBattleStat, getTempBattleStatBoosterItemName, getTempBattleStatName } from "../data/temp-battle-stat"; import { getBerryEffectDescription, getBerryName } from "../data/berry"; -import { BerryType } from "../data/enums/berry-type"; import { Unlockables } from "../system/unlockables"; import { StatusEffect, getStatusEffectDescriptor } from "../data/status-effect"; import { SpeciesFormKey } from "../data/pokemon-species"; @@ -23,7 +21,6 @@ import { ModifierTier } from "./modifier-tier"; import { Nature, getNatureName, getNatureStatMultiplier } from "#app/data/nature"; import i18next from "#app/plugins/i18n"; import { getModifierTierTextTint } from "#app/ui/text"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; import * as Overrides from "../overrides"; import { MoneyMultiplierModifier } from "./modifier"; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 85746e30bb6..3a2d0d0bf1e 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -13,13 +13,12 @@ import { getPokemonMessage } from "../messages"; import * as Utils from "../utils"; import { TempBattleStat } from "../data/temp-battle-stat"; import { getBerryEffectFunc, getBerryPredicate } from "../data/berry"; -import { BerryType } from "../data/enums/berry-type"; +import { BattlerTagType, BerryType } from "#enums"; import { StatusEffect, getStatusEffectHealText } from "../data/status-effect"; import { achvs } from "../system/achv"; import { VoucherType } from "../system/voucher"; import { FormChangeItem, SpeciesFormChangeItemTrigger } from "../data/pokemon-forms"; import { Nature } from "#app/data/nature"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type"; import * as Overrides from "../overrides"; import { ModifierType, modifierTypes } from "./modifier-type"; import { Command } from "#app/ui/command-ui-handler.js"; diff --git a/src/overrides.ts b/src/overrides.ts index df95104387b..d39c0ebfa4e 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -1,17 +1,12 @@ -import { Species } from "./data/enums/species"; -import { Abilities } from "./data/enums/abilities"; -import { Biome } from "./data/enums/biome"; -import { Moves } from "./data/enums/moves"; +import { Species, Abilities, Biome, Moves, BerryType, TimeOfDay } from "#enums"; import { WeatherType } from "./data/weather"; import { Variant } from "./data/variant"; -import { BerryType } from "./data/enums/berry-type"; import { TempBattleStat } from "./data/temp-battle-stat"; import { Nature } from "./data/nature"; import { Type } from "./data/type"; import { Stat } from "./data/pokemon-stat"; import { PokeballCounts } from "./battle-scene"; import { PokeballType } from "./data/pokeball"; -import {TimeOfDay} from "#app/data/enums/time-of-day"; import { Gender } from "./data/gender"; import { StatusEffect } from "./data/status-effect"; import { modifierTypes } from "./modifier/modifier-type"; diff --git a/src/phases.ts b/src/phases.ts index dabbbb4c4eb..77d8e777b73 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1,7 +1,7 @@ import BattleScene, { bypassLogin } from "./battle-scene"; import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon"; import * as Utils from "./utils"; -import { Moves } from "./data/enums/moves"; +import { Abilities, ArenaTagType, BattleSpec, BattleStyle, BattlerTagType, Biome, ExpNotification, Moves, PlayerGender, Species, TrainerType } from "#enums"; import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, BypassRedirectAttr, FixedDamageAttr, PostVictoryStatChangeAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr, IncrementMovePriorityAttr } from "./data/move"; import { Mode } from "./ui/ui"; import { Command } from "./ui/command-ui-handler"; @@ -17,34 +17,27 @@ import { EvolutionPhase } from "./evolution-phase"; import { Phase } from "./phase"; import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "./data/battle-stat"; import { biomeLinks, getBiomeName } from "./data/biomes"; -import { Biome } from "./data/enums/biome"; import { ModifierTier } from "./modifier/modifier-tier"; import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, RememberMoveModifierType, TmModifierType, getDailyRunStarterModifiers, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptions, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { BattlerTagLapseType, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; -import { BattlerTagType } from "./data/enums/battler-tag-type"; import { getPokemonMessage, getPokemonNameWithAffix } from "./messages"; import { Starter } from "./ui/starter-select-ui-handler"; import { Gender } from "./data/gender"; import { Weather, WeatherType, getRandomWeatherType, getTerrainBlockMessage, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather"; import { TempBattleStat } from "./data/temp-battle-stat"; import { ArenaTagSide, ArenaTrapTag, MistTag, TrickRoomTag } from "./data/arena-tag"; -import { ArenaTagType } from "./data/enums/arena-tag-type"; import { CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, IgnoreOpponentEvasionAbAttr, PostAttackAbAttr, PostBattleAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreSwitchOutAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, RedirectMoveAbAttr, BlockRedirectAbAttr, RunSuccessAbAttr, StatChangeMultiplierAbAttr, SuppressWeatherEffectAbAttr, SyncEncounterNatureAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostAttackAbAttrs, applyPostBattleAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreSwitchOutAbAttrs, applyPreWeatherEffectAbAttrs, BattleStatMultiplierAbAttr, applyBattleStatMultiplierAbAttrs, IncrementMovePriorityAbAttr, applyPostVictoryAbAttrs, PostVictoryAbAttr, BlockNonDirectDamageAbAttr as BlockNonDirectDamageAbAttr, applyPostKnockOutAbAttrs, PostKnockOutAbAttr, PostBiomeChangeAbAttr, applyPostFaintAbAttrs, PostFaintAbAttr, IncreasePpAbAttr, PostStatChangeAbAttr, applyPostStatChangeAbAttrs, AlwaysHitAbAttr, PreventBerryUseAbAttr, StatChangeCopyAbAttr, PokemonTypeChangeAbAttr, applyPreAttackAbAttrs, applyPostMoveUsedAbAttrs, PostMoveUsedAbAttr, MaxMultiHitAbAttr, HealFromBerryUseAbAttr } from "./data/ability"; import { Unlockables, getUnlockableName } from "./system/unlockables"; import { getBiomeKey } from "./field/arena"; import { BattleType, BattlerIndex, TurnCommand } from "./battle"; -import { BattleSpec } from "./enums/battle-spec"; -import { Species } from "./data/enums/species"; import { ChallengeAchv, HealAchv, LevelAchv, achvs } from "./system/achv"; import { TrainerSlot, trainerConfigs } from "./data/trainer-config"; -import { TrainerType } from "./data/enums/trainer-type"; import { EggHatchPhase } from "./egg-hatch-phase"; import { Egg } from "./data/egg"; import { vouchers } from "./system/voucher"; import { loggedInUser, updateUserInfo } from "./account"; import { SessionSaveData } from "./system/game-data"; -import { PlayerGender } from "./data/enums/player-gender"; import { addPokeballCaptureStars, addPokeballOpenParticles } from "./field/anims"; import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeManualTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangePreMoveTrigger } from "./data/pokemon-forms"; import { battleSpecDialogue, getCharVariantFromDialogue, miscDialogue } from "./data/dialogue"; @@ -58,13 +51,10 @@ import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run"; import { GameMode, GameModes, getGameMode } from "./game-mode"; import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./data/pokemon-species"; import i18next from "./plugins/i18n"; -import { Abilities } from "./data/enums/abilities"; import * as Overrides from "./overrides"; import { TextStyle, addTextObject } from "./ui/text"; import { Type } from "./data/type"; import { BerryUsedEvent, EncounterPhaseEvent, MoveUsedEvent, TurnEndEvent, TurnInitEvent } from "./events/battle-scene"; -import { ExpNotification } from "./enums/exp-notification"; -import { BattleStyle } from "./enums/battle-style"; export class LoginPhase extends Phase { diff --git a/src/system/achv.ts b/src/system/achv.ts index f44ea2a9301..bf4fe4f2e32 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -3,7 +3,7 @@ import BattleScene from "../battle-scene"; import { TurnHeldItemTransferModifier } from "../modifier/modifier"; import i18next from "../plugins/i18n"; import * as Utils from "../utils"; -import { PlayerGender } from "#app/data/enums/player-gender"; +import { PlayerGender } from "#enums"; import { ParseKeys } from "i18next"; import { Challenge, SingleGenerationChallenge, SingleTypeChallenge } from "#app/data/challenge.js"; diff --git a/src/system/arena-data.ts b/src/system/arena-data.ts index 6eec27c32d3..4ed0fe42b06 100644 --- a/src/system/arena-data.ts +++ b/src/system/arena-data.ts @@ -1,6 +1,6 @@ import { Arena } from "../field/arena"; import { ArenaTag } from "../data/arena-tag"; -import { Biome } from "../data/enums/biome"; +import { Biome } from "#enums"; import { Weather } from "../data/weather"; import { Terrain } from "#app/data/terrain.js"; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 1be5cab8d97..48a8836b2ed 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -2,7 +2,7 @@ import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon"; import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions"; import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species"; -import { Species, defaultStarterSpecies } from "../data/enums/species"; +import { Species, defaultStarterSpecies, Moves, Device, PlayerGender, GameDataType } from "#enums"; import * as Utils from "../utils"; import * as Overrides from "../overrides"; import PokemonData from "./pokemon-data"; @@ -24,7 +24,6 @@ import { clientSessionId, loggedInUser, updateUserInfo } from "../account"; import { Nature } from "../data/nature"; import { GameStats } from "./game-stats"; import { Tutorial } from "../tutorial"; -import { Moves } from "../data/enums/moves"; import { speciesEggMoves } from "../data/egg-moves"; import { allMoves } from "../data/move"; import { TrainerVariant } from "../field/trainer"; @@ -32,12 +31,9 @@ import { OutdatedPhase, ReloadSessionPhase } from "#app/phases"; import { Variant, variantData } from "#app/data/variant"; import {setSettingGamepad, SettingGamepad, settingGamepadDefaults} from "./settings/settings-gamepad"; import {setSettingKeyboard, SettingKeyboard} from "#app/system/settings/settings-keyboard"; -import { TerrainChangedEvent, WeatherChangedEvent } from "#app/field/events/arena"; -import { Device } from "#app/enums/devices.js"; +import { TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; import { EnemyAttackStatusEffectChanceModifier } from "../modifier/modifier"; import { StatusEffect } from "#app/data/status-effect.js"; -import { PlayerGender } from "#app/data/enums/player-gender"; -import { GameDataType } from "#app/data/enums/game-data-type"; import ChallengeData from "./challenge-data"; const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary @@ -1213,9 +1209,11 @@ export class GameData { reader.onload = (_ => { return e => { + let dataName: string; let dataStr = AES.decrypt(e.target.result.toString(), saveKey).toString(enc.Utf8); let valid = false; try { + dataName = GameDataType[dataType].toLowerCase(); switch (dataType) { case GameDataType.SYSTEM: dataStr = this.convertSystemDataStr(dataStr); @@ -1235,28 +1233,12 @@ export class GameData { console.error(ex); } - let dataName: string; - switch (dataType) { - case GameDataType.SYSTEM: - dataName = "save"; - break; - case GameDataType.SESSION: - dataName = "session"; - break; - case GameDataType.SETTINGS: - dataName = "settings"; - break; - case GameDataType.TUTORIALS: - dataName = "tutorials"; - break; - } - const displayError = (error: string) => this.scene.ui.showText(error, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500)); if (!valid) { return this.scene.ui.showText(`Your ${dataName} data could not be loaded. It may be corrupted.`, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500)); } - this.scene.ui.revertMode(); + this.scene.ui.showText(`Your ${dataName} data will be overridden and the page will reload. Proceed?`, null, () => { this.scene.ui.setOverlayMode(Mode.CONFIRM, () => { localStorage.setItem(dataKey, encrypt(dataStr, bypassLogin)); diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index b7dc2d67883..dbec9ea9c82 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -1,15 +1,13 @@ import { BattleType } from "../battle"; import BattleScene from "../battle-scene"; -import { Biome } from "../data/enums/biome"; +import { Biome, Species, Moves } from "#enums"; import { Gender } from "../data/gender"; import { Nature } from "../data/nature"; import { PokeballType } from "../data/pokeball"; import { getPokemonSpecies } from "../data/pokemon-species"; -import { Species } from "../data/enums/species"; import { Status } from "../data/status-effect"; import Pokemon, { EnemyPokemon, PokemonMove, PokemonSummonData } from "../field/pokemon"; import { TrainerSlot } from "../data/trainer-config"; -import { Moves } from "../data/enums/moves"; import { Variant } from "#app/data/variant"; import { loadBattlerTag } from "../data/battler-tags"; diff --git a/src/system/settings/settings-gamepad.ts b/src/system/settings/settings-gamepad.ts index 909b78ffe6f..29b6de94544 100644 --- a/src/system/settings/settings-gamepad.ts +++ b/src/system/settings/settings-gamepad.ts @@ -2,7 +2,7 @@ import BattleScene from "../../battle-scene"; import SettingsGamepadUiHandler from "../../ui/settings/settings-gamepad-ui-handler"; import {Mode} from "../../ui/ui"; import {truncateString} from "../../utils"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; export enum SettingGamepad { diff --git a/src/system/settings/settings-keyboard.ts b/src/system/settings/settings-keyboard.ts index c394b2ef8f0..661be6546b5 100644 --- a/src/system/settings/settings-keyboard.ts +++ b/src/system/settings/settings-keyboard.ts @@ -1,4 +1,4 @@ -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums"; import BattleScene from "#app/battle-scene"; import {Mode} from "#app/ui/ui"; import SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler"; diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index fb446e1e081..2859d3c4b67 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -3,11 +3,9 @@ import i18next from "i18next"; import BattleScene from "../../battle-scene"; import { hasTouchscreen } from "../../touch-controls"; import { updateWindowType } from "../../ui/ui-theme"; -import { PlayerGender } from "#app/data/enums/player-gender"; +import { PlayerGender, MoneyFormat, EaseType } from "#enums"; import { CandyUpgradeNotificationChangedEvent } from "../../events/battle-scene"; -import { MoneyFormat } from "../../enums/money-format"; import SettingsUiHandler from "#app/ui/settings/settings-ui-handler"; -import { EaseType } from "#app/ui/enums/ease-type.js"; const MUTE = "Mute"; const VOLUME_OPTIONS = new Array(11).fill(null).map((_, i) => i ? (i * 10).toString() : MUTE); diff --git a/src/system/trainer-data.ts b/src/system/trainer-data.ts index d4bb3cee94d..20e62bf2a32 100644 --- a/src/system/trainer-data.ts +++ b/src/system/trainer-data.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import { TrainerType } from "../data/enums/trainer-type"; +import { TrainerType } from "#enums"; import Trainer, { TrainerVariant } from "../field/trainer"; export default class TrainerData { diff --git a/src/system/voucher.ts b/src/system/voucher.ts index f5c6a5eeacf..067ae62001c 100644 --- a/src/system/voucher.ts +++ b/src/system/voucher.ts @@ -1,8 +1,7 @@ import BattleScene from "../battle-scene"; -import { TrainerType } from "../data/enums/trainer-type"; import i18next from "../plugins/i18n"; import { Achv, AchvTier, achvs, getAchievementDescription } from "./achv"; -import { PlayerGender } from "#app/data/enums/player-gender"; +import { PlayerGender, TrainerType } from "#enums"; export enum VoucherType { REGULAR, diff --git a/src/test/abilities/battle_bond.test.ts b/src/test/abilities/battle_bond.test.ts index 2752ceed896..7d39223dbd4 100644 --- a/src/test/abilities/battle_bond.test.ts +++ b/src/test/abilities/battle_bond.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums"; +import { Abilities } from "#enums"; +import { Species } from "#enums"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index 8b9c730c4c2..5059116490a 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums"; +import { Abilities } from "#enums"; +import { Species } from "#enums"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index 2409c64e5be..662b2b5b677 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -2,8 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Species, Moves} from "#enums"; import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, SelectStarterPhase, @@ -11,7 +10,6 @@ import { } from "#app/phases"; import {Mode} from "#app/ui/ui"; import {BattleStat} from "#app/data/battle-stat"; -import {Moves} from "#app/data/enums/moves"; import {generateStarter, getMovePosition} from "#app/test/utils/gameManagerUtils"; import {Command} from "#app/ui/command-ui-handler"; import {Status, StatusEffect} from "#app/data/status-effect"; diff --git a/src/test/abilities/intrepid_sword.test.ts b/src/test/abilities/intrepid_sword.test.ts index 3a830df6845..662bc02e42e 100644 --- a/src/test/abilities/intrepid_sword.test.ts +++ b/src/test/abilities/intrepid_sword.test.ts @@ -2,8 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Species} from "#enums"; import { CommandPhase, } from "#app/phases"; diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index b479691f565..6dfb0a66413 100644 --- a/src/test/abilities/libero.test.ts +++ b/src/test/abilities/libero.test.ts @@ -2,16 +2,16 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; import GameManager from "../utils/gameManager"; import * as Overrides from "#app/overrides"; -import { Species } from "#app/data/enums/species.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Moves } from "#app/data/enums/moves.js"; +import { Species } from "#enums"; +import { Abilities } from "#enums"; +import { Moves } from "#enums"; import { getMovePosition } from "../utils/gameManagerUtils"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; import { allMoves } from "#app/data/move.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; +import { BattlerTagType } from "#enums"; import { Weather, WeatherType } from "#app/data/weather.js"; import { Type } from "#app/data/type.js"; -import { Biome } from "#app/data/enums/biome.js"; +import { Biome } from "#enums"; import { PlayerPokemon } from "#app/field/pokemon.js"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index ed27c670c87..5e910a0c3ae 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -2,8 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Moves, Species} from "#enums"; import { CommandPhase, EnemyCommandPhase, @@ -11,7 +10,6 @@ import { } from "#app/phases"; import {Mode} from "#app/ui/ui"; import {Stat} from "#app/data/pokemon-stat"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import {Command} from "#app/ui/command-ui-handler"; import {BattleStat} from "#app/data/battle-stat"; diff --git a/src/test/abilities/power_construct.test.ts b/src/test/abilities/power_construct.test.ts index c568ba9db3e..cd763661ef2 100644 --- a/src/test/abilities/power_construct.test.ts +++ b/src/test/abilities/power_construct.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums"; +import { Abilities } from "#enums"; +import { Species } from "#enums"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/protean.test.ts b/src/test/abilities/protean.test.ts index cd3633156ee..8cd44481d16 100644 --- a/src/test/abilities/protean.test.ts +++ b/src/test/abilities/protean.test.ts @@ -2,16 +2,16 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; import GameManager from "../utils/gameManager"; import * as Overrides from "#app/overrides"; -import { Species } from "#app/data/enums/species.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Moves } from "#app/data/enums/moves.js"; +import { Species } from "#enums"; +import { Abilities } from "#enums"; +import { Moves } from "#enums"; import { getMovePosition } from "../utils/gameManagerUtils"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; import { allMoves } from "#app/data/move.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; +import { BattlerTagType } from "#enums"; import { Weather, WeatherType } from "#app/data/weather.js"; import { Type } from "#app/data/type.js"; -import { Biome } from "#app/data/enums/biome.js"; +import { Biome } from "#enums"; import { PlayerPokemon } from "#app/field/pokemon.js"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/sap_sipper.test.ts b/src/test/abilities/sap_sipper.test.ts index e2b3099f28f..1a9737ecb92 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -2,19 +2,16 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, MoveEndPhase, TurnEndPhase, } from "#app/phases"; import {Mode} from "#app/ui/ui"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import {Command} from "#app/ui/command-ui-handler"; -import { Abilities } from "#app/data/enums/abilities.js"; +import { Abilities, BattlerTagType, Moves, Species } from "#enums"; import { BattleStat } from "#app/data/battle-stat.js"; import { TerrainType } from "#app/data/terrain.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; // See also: TypeImmunityAbAttr describe("Abilities - Sap Sipper", () => { diff --git a/src/test/abilities/schooling.test.ts b/src/test/abilities/schooling.test.ts index 35a05cff87a..f4d84b4502e 100644 --- a/src/test/abilities/schooling.test.ts +++ b/src/test/abilities/schooling.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums"; +import { Abilities } from "#enums"; +import { Species } from "#enums"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/shields_down.test.ts b/src/test/abilities/shields_down.test.ts index 6e7cb77e079..dd56f029f0c 100644 --- a/src/test/abilities/shields_down.test.ts +++ b/src/test/abilities/shields_down.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums"; +import { Abilities } from "#enums"; +import { Species } from "#enums"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index 1f0827780ac..6218125767a 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -2,15 +2,12 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Species} from "#app/data/enums/species"; import { TurnEndPhase, } from "#app/phases"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import { Abilities } from "#app/data/enums/abilities.js"; +import { Abilities, BattlerTagType, Moves, Species } from "#enums"; import { BattleStat } from "#app/data/battle-stat.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; // See also: TypeImmunityAbAttr describe("Abilities - Volt Absorb", () => { diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index 697350dc271..231c9a757f9 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -2,8 +2,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as Overrides from "#app/overrides"; -import { Abilities } from "#app/data/enums/abilities"; -import { Species } from "#app/data/enums/species"; import { CommandPhase, DamagePhase, @@ -18,7 +16,7 @@ import { } from "#app/phases"; import { Mode } from "#app/ui/ui"; import { Stat } from "#app/data/pokemon-stat"; -import { Moves } from "#app/data/enums/moves"; +import { Abilities, Moves, Species } from "#enums"; import { getMovePosition } from "#app/test/utils/gameManagerUtils"; import { Command } from "#app/ui/command-ui-handler"; import { QuietFormChangePhase } from "#app/form-change-phase"; diff --git a/src/test/abilities/zero_to_hero.test.ts b/src/test/abilities/zero_to_hero.test.ts index a282be2750c..36ffc2a58fb 100644 --- a/src/test/abilities/zero_to_hero.test.ts +++ b/src/test/abilities/zero_to_hero.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums"; +import { Abilities } from "#enums"; +import { Species } from "#enums"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 7ace7dae224..45d09b83dc9 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -2,19 +2,16 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Species, Moves, Button} from "#enums"; import { CommandPhase, EnemyCommandPhase, SelectTargetPhase, TurnStartPhase } from "#app/phases"; import {Mode} from "#app/ui/ui"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import {Moves} from "#app/data/enums/moves"; import {Command} from "#app/ui/command-ui-handler"; import {Stat} from "#app/data/pokemon-stat"; import TargetSelectUiHandler from "#app/ui/target-select-ui-handler"; -import {Button} from "#app/enums/buttons"; describe("Battle order", () => { diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index 9077cf00076..76f980e1498 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -2,7 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import {generateStarter, getMovePosition,} from "#app/test/utils/gameManagerUtils"; import {Mode} from "#app/ui/ui"; import {GameModes} from "#app/game-mode"; -import {Species} from "#app/data/enums/species"; +import {Species, Moves, PlayerGender, Abilities} from "#enums"; import * as overrides from "../../overrides"; import {Command} from "#app/ui/command-ui-handler"; import { @@ -17,13 +17,10 @@ import { TitlePhase, TurnInitPhase, VictoryPhase, } from "#app/phases"; -import {Moves} from "#app/data/enums/moves"; import GameManager from "#app/test/utils/gameManager"; import Phaser from "phaser"; import {allSpecies} from "#app/data/pokemon-species"; -import {PlayerGender} from "#app/data/enums/player-gender"; import { getGameMode } from "#app/game-mode.js"; -import {Abilities} from "#app/data/enums/abilities"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; diff --git a/src/test/battle/error-handling.test.ts b/src/test/battle/error-handling.test.ts index 8b94c108bc1..8e062f019e9 100644 --- a/src/test/battle/error-handling.test.ts +++ b/src/test/battle/error-handling.test.ts @@ -2,9 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import GameManager from "#app/test/utils/gameManager"; import Phaser from "phaser"; import * as overrides from "#app/overrides"; -import {Species} from "#app/data/enums/species"; -import {Moves} from "#app/data/enums/moves"; -import {Abilities} from "#app/data/enums/abilities"; +import {Species, Moves, Abilities} from "#enums"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; diff --git a/src/test/battle/special_battle.test.ts b/src/test/battle/special_battle.test.ts index 5a95d57afea..130491528f4 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -1,14 +1,12 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import {Mode} from "#app/ui/ui"; -import {Species} from "#app/data/enums/species"; +import {Species, Moves, Abilities} from "#enums"; import * as overrides from "../../overrides"; import { CommandPhase, } from "#app/phases"; -import {Moves} from "#app/data/enums/moves"; import GameManager from "#app/test/utils/gameManager"; import Phaser from "phaser"; -import {Abilities} from "#app/data/enums/abilities"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; diff --git a/src/test/eggs/egg.test.ts b/src/test/eggs/egg.test.ts index 7cfe7fda651..ccfdddf5498 100644 --- a/src/test/eggs/egg.test.ts +++ b/src/test/eggs/egg.test.ts @@ -1,7 +1,7 @@ import {beforeAll, describe, expect, it} from "vitest"; import BattleScene from "../../battle-scene"; import { getLegendaryGachaSpeciesForTimestamp } from "#app/data/egg.js"; -import { Species } from "#app/data/enums/species.js"; +import { Species } from "#enums"; import Phaser from "phaser"; describe("getLegendaryGachaSpeciesForTimestamp", () => { diff --git a/src/test/imports.test.ts b/src/test/imports.test.ts index c164813a3cd..86893de7bff 100644 --- a/src/test/imports.test.ts +++ b/src/test/imports.test.ts @@ -5,7 +5,7 @@ async function importModule() { try { initStatsKeys(); const { PokemonMove } = await import("#app/field/pokemon"); - const { Species } = await import("#app/data/enums/species"); + const { Species } = await import("#enums"); return { PokemonMove, Species, diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index 7064bcd13a1..a76008aa747 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -2,8 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Moves, Species} from "#enums"; import { CommandPhase, EnemyCommandPhase, @@ -11,7 +10,6 @@ import { TurnEndPhase, } from "#app/phases"; import {Mode} from "#app/ui/ui"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import {Command} from "#app/ui/command-ui-handler"; import {StatusEffect} from "#app/data/status-effect"; diff --git a/src/test/lokalisation/french.test.ts b/src/test/lokalisation/french.test.ts index 25b7d7d9803..c3c6873cd01 100644 --- a/src/test/lokalisation/french.test.ts +++ b/src/test/lokalisation/french.test.ts @@ -1,7 +1,7 @@ import {afterEach, beforeAll, describe, expect, it} from "vitest"; import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; -import {Species} from "#app/data/enums/species"; +import {Species} from "#enums"; import i18next from "i18next"; import {initI18n} from "#app/plugins/i18n"; diff --git a/src/test/moves/growth.test.ts b/src/test/moves/growth.test.ts index 9a6e13f06a3..439e47b236b 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -2,8 +2,7 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Moves, Species} from "#enums"; import { CommandPhase, EnemyCommandPhase, @@ -11,7 +10,6 @@ import { } from "#app/phases"; import {Mode} from "#app/ui/ui"; import {Stat} from "#app/data/pokemon-stat"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import {Command} from "#app/ui/command-ui-handler"; import {BattleStat} from "#app/data/battle-stat"; diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index df1df016de5..6ecc0b6145a 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -2,12 +2,10 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Moves, Species} from "#enums"; import { CommandPhase } from "#app/phases"; -import {Moves} from "#app/data/enums/moves"; describe("Moves - Spikes", () => { diff --git a/src/test/moves/tackle.test.ts b/src/test/moves/tackle.test.ts index ca3f95731f2..7f438cd8958 100644 --- a/src/test/moves/tackle.test.ts +++ b/src/test/moves/tackle.test.ts @@ -2,13 +2,12 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Species} from "#app/data/enums/species"; +import {Moves, Species} from "#enums"; import { CommandPhase, EnemyCommandPhase, TurnEndPhase, } from "#app/phases"; import {Mode} from "#app/ui/ui"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import {Command} from "#app/ui/command-ui-handler"; import {Stat} from "#app/data/pokemon-stat"; diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index 2d6789102d1..b081467cdad 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -2,15 +2,13 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities, Moves, Species} from "#enums"; import { CommandPhase, EnemyCommandPhase, TurnInitPhase, } from "#app/phases"; import {Mode} from "#app/ui/ui"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; import {Command} from "#app/ui/command-ui-handler"; import {BattleStat} from "#app/data/battle-stat"; diff --git a/src/test/settingMenu/rebinding_setting.test.ts b/src/test/settingMenu/rebinding_setting.test.ts index dee29cd42a2..41c8290fb49 100644 --- a/src/test/settingMenu/rebinding_setting.test.ts +++ b/src/test/settingMenu/rebinding_setting.test.ts @@ -1,5 +1,5 @@ import {beforeEach, describe, expect, it} from "vitest"; -import {Button} from "#app/enums/buttons"; +import {Button, Device} from "#enums"; import {deepCopy} from "#app/utils"; import { getKeyWithKeycode, @@ -7,7 +7,6 @@ import { } from "#app/configs/inputs/configHandler"; import {MenuManip} from "#app/test/settingMenu/helpers/menuManip"; import {InGameManip} from "#app/test/settingMenu/helpers/inGameManip"; -import {Device} from "#app/enums/devices"; import {InterfaceConfig} from "#app/inputs-controller"; import cfg_keyboard_qwerty from "#app/configs/inputs/cfg_keyboard_qwerty"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; diff --git a/src/test/ui/starter-select.test.ts b/src/test/ui/starter-select.test.ts index 9f323a2839c..7dc45c06f4a 100644 --- a/src/test/ui/starter-select.test.ts +++ b/src/test/ui/starter-select.test.ts @@ -1,7 +1,6 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it} from "vitest"; import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; -import {Species} from "#app/data/enums/species"; import { EncounterPhase, SelectStarterPhase, @@ -10,14 +9,13 @@ import { import {Mode} from "#app/ui/ui"; import {GameModes} from "#app/game-mode"; import StarterSelectUiHandler from "#app/ui/starter-select-ui-handler"; -import {Button} from "#app/enums/buttons"; import OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler"; import SaveSlotSelectUiHandler from "#app/ui/save-slot-select-ui-handler"; import {OptionSelectItem} from "#app/ui/abstact-option-select-ui-handler"; import {Gender} from "#app/data/gender"; import {allSpecies} from "#app/data/pokemon-species"; import {Nature} from "#app/data/nature"; -import {Abilities} from "#app/data/enums/abilities"; +import {Abilities, Button, Species} from "#enums"; describe("UI - Starter select", () => { diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index 418f8236033..719c6776ac4 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -16,17 +16,13 @@ import {GameModes, getGameMode} from "#app/game-mode"; import fs from "fs"; import {AES, enc} from "crypto-js"; import {updateUserInfo} from "#app/account"; -import {Species} from "#app/data/enums/species"; -import {PlayerGender} from "#app/data/enums/player-gender"; -import {GameDataType} from "#app/data/enums/game-data-type"; import InputsHandler from "#app/test/utils/inputsHandler"; -import {ExpNotification} from "#app/enums/exp-notification"; import ErrorInterceptor from "#app/test/utils/errorInterceptor"; import {EnemyPokemon, PlayerPokemon} from "#app/field/pokemon"; import {MockClock} from "#app/test/utils/mocks/mockClock"; import {Command} from "#app/ui/command-ui-handler"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import {Button} from "#app/enums/buttons"; +import {Button, ExpNotification, GameDataType, PlayerGender, Species} from "#enums"; import PartyUiHandler, {PartyUiMode} from "#app/ui/party-ui-handler"; import Trainer from "#app/field/trainer"; diff --git a/src/test/utils/gameManagerUtils.ts b/src/test/utils/gameManagerUtils.ts index 1b7bbdabaf0..7ff5bbdf8b6 100644 --- a/src/test/utils/gameManagerUtils.ts +++ b/src/test/utils/gameManagerUtils.ts @@ -1,7 +1,7 @@ // Function to convert Blob to string import {getDailyRunStarters} from "#app/data/daily-run"; import {Gender} from "#app/data/gender"; -import {Species} from "#app/data/enums/species"; +import {Species} from "#enums"; import {Starter} from "#app/ui/starter-select-ui-handler"; import {GameModes, getGameMode} from "#app/game-mode"; import {getPokemonSpecies, getPokemonSpeciesForm} from "#app/data/pokemon-species"; diff --git a/src/touch-controls.ts b/src/touch-controls.ts index d5a3197f833..6656d6af5a3 100644 --- a/src/touch-controls.ts +++ b/src/touch-controls.ts @@ -1,4 +1,4 @@ -import {Button} from "./enums/buttons"; +import {Button} from "#enums"; import EventEmitter = Phaser.Events.EventEmitter; import BattleScene from "./battle-scene"; diff --git a/src/ui-inputs.ts b/src/ui-inputs.ts index 21d0d0841e6..aea0e6647cd 100644 --- a/src/ui-inputs.ts +++ b/src/ui-inputs.ts @@ -5,7 +5,7 @@ import MessageUiHandler from "./ui/message-ui-handler"; import StarterSelectUiHandler from "./ui/starter-select-ui-handler"; import {Setting, SettingKeys, settingIndex} from "./system/settings/settings"; import SettingsUiHandler from "./ui/settings/settings-ui-handler"; -import {Button} from "./enums/buttons"; +import {Button} from "#enums"; import SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler"; import SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler"; import BattleScene from "./battle-scene"; diff --git a/src/ui/abstact-option-select-ui-handler.ts b/src/ui/abstact-option-select-ui-handler.ts index 568c8208eac..a0e61c343a8 100644 --- a/src/ui/abstact-option-select-ui-handler.ts +++ b/src/ui/abstact-option-select-ui-handler.ts @@ -5,7 +5,7 @@ import UiHandler from "./ui-handler"; import { addWindow } from "./ui-theme"; import * as Utils from "../utils"; import { argbFromRgba } from "@material/material-color-utilities"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export interface OptionSelectConfig { xOffset?: number; diff --git a/src/ui/achv-bar.ts b/src/ui/achv-bar.ts index 9e9b20795e3..9f6dc52ad56 100644 --- a/src/ui/achv-bar.ts +++ b/src/ui/achv-bar.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import { Achv, getAchievementDescription } from "../system/achv"; import { Voucher } from "../system/voucher"; import { TextStyle, addTextObject } from "./text"; -import { PlayerGender } from "#app/data/enums/player-gender"; +import { PlayerGender } from "#enums"; export default class AchvBar extends Phaser.GameObjects.Container { private defaultWidth: number; diff --git a/src/ui/achvs-ui-handler.ts b/src/ui/achvs-ui-handler.ts index 464a967cbfd..4299f8802a3 100644 --- a/src/ui/achvs-ui-handler.ts +++ b/src/ui/achvs-ui-handler.ts @@ -1,12 +1,11 @@ import BattleScene from "../battle-scene"; -import { Button } from "../enums/buttons"; +import { Button, PlayerGender } from "#enums"; import i18next from "../plugins/i18n"; import { Achv, achvs, getAchievementDescription } from "../system/achv"; import MessageUiHandler from "./message-ui-handler"; import { addTextObject, TextStyle } from "./text"; import { Mode } from "./ui"; import { addWindow } from "./ui-theme"; -import { PlayerGender } from "#app/data/enums/player-gender"; import { ParseKeys } from "i18next"; export default class AchvsUiHandler extends MessageUiHandler { diff --git a/src/ui/arena-flyout.ts b/src/ui/arena-flyout.ts index 5793582d6c4..08d7915b63b 100644 --- a/src/ui/arena-flyout.ts +++ b/src/ui/arena-flyout.ts @@ -4,9 +4,9 @@ import { ArenaTagSide } from "#app/data/arena-tag.js"; import { WeatherType } from "#app/data/weather.js"; import { TerrainType } from "#app/data/terrain.js"; import { addWindow, WindowVariant } from "./ui-theme"; -import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/field/events/arena"; +import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; import { BattleSceneEventType, TurnEndEvent } from "../events/battle-scene"; -import { ArenaTagType } from "#app/data/enums/arena-tag-type.js"; +import { ArenaTagType } from "#enums"; import TimeOfDayWidget from "./time-of-day-widget"; import * as Utils from "../utils"; diff --git a/src/ui/awaitable-ui-handler.ts b/src/ui/awaitable-ui-handler.ts index 22a21069acb..788384ac8d2 100644 --- a/src/ui/awaitable-ui-handler.ts +++ b/src/ui/awaitable-ui-handler.ts @@ -1,7 +1,7 @@ import BattleScene from "../battle-scene"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export default abstract class AwaitableUiHandler extends UiHandler { protected awaitingActionInput: boolean; diff --git a/src/ui/ball-ui-handler.ts b/src/ui/ball-ui-handler.ts index b96dd799b18..430a00422c4 100644 --- a/src/ui/ball-ui-handler.ts +++ b/src/ui/ball-ui-handler.ts @@ -6,7 +6,7 @@ import { Command } from "./command-ui-handler"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import { addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export default class BallUiHandler extends UiHandler { private pokeballSelectContainer: Phaser.GameObjects.Container; diff --git a/src/ui/battle-flyout.ts b/src/ui/battle-flyout.ts index 812969a988d..d6121e2d209 100644 --- a/src/ui/battle-flyout.ts +++ b/src/ui/battle-flyout.ts @@ -2,11 +2,9 @@ import { default as Pokemon } from "../field/pokemon"; import { addTextObject, TextStyle } from "./text"; import * as Utils from "../utils"; import BattleScene from "#app/battle-scene.js"; -import { UiTheme } from "#app/enums/ui-theme.js"; import Move from "#app/data/move.js"; import { BattleSceneEventType, BerryUsedEvent, MoveUsedEvent } from "../events/battle-scene"; -import { BerryType } from "#app/data/enums/berry-type.js"; -import { Moves } from "#app/data/enums/moves.js"; +import { BerryType, Moves, UiTheme } from "#enums"; /** Container for info about a {@linkcode Move} */ interface MoveInfo { diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index 0f856cbb390..fd2386355b4 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -6,7 +6,7 @@ import MessageUiHandler from "./message-ui-handler"; import { getStatName, Stat } from "../data/pokemon-stat"; import { addWindow } from "./ui-theme"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; import i18next from "../plugins/i18n"; export default class BattleMessageUiHandler extends MessageUiHandler { diff --git a/src/ui/candy-bar.ts b/src/ui/candy-bar.ts index 84d1c2f70e7..87d6b7431c1 100644 --- a/src/ui/candy-bar.ts +++ b/src/ui/candy-bar.ts @@ -2,7 +2,7 @@ import BattleScene, { starterColors } from "../battle-scene"; import { TextStyle, addTextObject } from "./text"; import { argbFromRgba } from "@material/material-color-utilities"; import * as Utils from "../utils"; -import { Species } from "#app/data/enums/species"; +import { Species } from "#enums"; export default class CandyBar extends Phaser.GameObjects.Container { private bg: Phaser.GameObjects.NineSlice; diff --git a/src/ui/challenges-select-ui-handler.ts b/src/ui/challenges-select-ui-handler.ts index 092d954eae7..dc0aa30d489 100644 --- a/src/ui/challenges-select-ui-handler.ts +++ b/src/ui/challenges-select-ui-handler.ts @@ -3,7 +3,7 @@ import { TextStyle, addTextObject } from "./text"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import { addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; import i18next from "#app/plugins/i18n.js"; import { SelectStarterPhase, TitlePhase } from "#app/phases.js"; import { Challenge } from "#app/data/challenge.js"; diff --git a/src/ui/command-ui-handler.ts b/src/ui/command-ui-handler.ts index 7c21d5cc142..2f8e81807a3 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -5,7 +5,7 @@ import PartyUiHandler, { PartyUiMode } from "./party-ui-handler"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import i18next from "../plugins/i18n"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export enum Command { FIGHT = 0, diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index 4e4e0f9bb8c..4ffee79dab0 100644 --- a/src/ui/confirm-ui-handler.ts +++ b/src/ui/confirm-ui-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import AbstractOptionSelectUiHandler, { OptionSelectConfig } from "./abstact-option-select-ui-handler"; import { Mode } from "./ui"; import i18next from "i18next"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler { diff --git a/src/ui/egg-gacha-ui-handler.ts b/src/ui/egg-gacha-ui-handler.ts index 96874f439ff..3949c60c76a 100644 --- a/src/ui/egg-gacha-ui-handler.ts +++ b/src/ui/egg-gacha-ui-handler.ts @@ -8,8 +8,7 @@ import { VoucherType, getVoucherTypeIcon } from "../system/voucher"; import { getPokemonSpecies } from "../data/pokemon-species"; import { addWindow } from "./ui-theme"; import { Tutorial, handleTutorial } from "../tutorial"; -import { EggTier } from "../data/enums/egg-type"; -import {Button} from "../enums/buttons"; +import {Button, EggTier} from "#enums"; import i18next from "../plugins/i18n"; export default class EggGachaUiHandler extends MessageUiHandler { diff --git a/src/ui/egg-hatch-scene-handler.ts b/src/ui/egg-hatch-scene-handler.ts index 94affc2e751..e103cf30a6c 100644 --- a/src/ui/egg-hatch-scene-handler.ts +++ b/src/ui/egg-hatch-scene-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import { EggHatchPhase } from "../egg-hatch-phase"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export default class EggHatchSceneHandler extends UiHandler { public eggHatchContainer: Phaser.GameObjects.Container; diff --git a/src/ui/egg-list-ui-handler.ts b/src/ui/egg-list-ui-handler.ts index 653789d4a20..3957ebfa1f4 100644 --- a/src/ui/egg-list-ui-handler.ts +++ b/src/ui/egg-list-ui-handler.ts @@ -5,7 +5,7 @@ import { TextStyle, addTextObject } from "./text"; import MessageUiHandler from "./message-ui-handler"; import { Egg, getEggGachaTypeDescriptor, getEggHatchWavesMessage, getEggDescriptor } from "../data/egg"; import { addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; import i18next from "../plugins/i18n"; export default class EggListUiHandler extends MessageUiHandler { diff --git a/src/ui/evolution-scene-handler.ts b/src/ui/evolution-scene-handler.ts index 12b6ccc93d1..c387a24d1ba 100644 --- a/src/ui/evolution-scene-handler.ts +++ b/src/ui/evolution-scene-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import MessageUiHandler from "./message-ui-handler"; import { TextStyle, addTextObject } from "./text"; import { Mode } from "./ui"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export default class EvolutionSceneHandler extends MessageUiHandler { public evolutionContainer: Phaser.GameObjects.Container; diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index 657c8b7e311..0fbfc9a93cd 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -8,7 +8,7 @@ import * as Utils from "../utils"; import { CommandPhase } from "../phases"; import { MoveCategory } from "#app/data/move.js"; import i18next from "../plugins/i18n"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; import Pokemon, { PokemonMove } from "#app/field/pokemon.js"; export default class FightUiHandler extends UiHandler { diff --git a/src/ui/form-modal-ui-handler.ts b/src/ui/form-modal-ui-handler.ts index e55b8514642..754c2d21dd2 100644 --- a/src/ui/form-modal-ui-handler.ts +++ b/src/ui/form-modal-ui-handler.ts @@ -6,7 +6,7 @@ import { WindowVariant, addWindow } from "./ui-theme"; import InputText from "phaser3-rex-plugins/plugins/inputtext"; import * as Utils from "../utils"; import i18next from "../plugins/i18n"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export interface FormModalConfig extends ModalConfig { errorMessage?: string; diff --git a/src/ui/game-stats-ui-handler.ts b/src/ui/game-stats-ui-handler.ts index 57a02257810..d7536108e0a 100644 --- a/src/ui/game-stats-ui-handler.ts +++ b/src/ui/game-stats-ui-handler.ts @@ -7,7 +7,7 @@ import { addWindow } from "./ui-theme"; import * as Utils from "../utils"; import { DexAttr, GameData } from "../system/game-data"; import { speciesStarters } from "../data/pokemon-species"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; import i18next from "../plugins/i18n"; interface DisplayStat { diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index a0b0c5da66b..2b3b76164a2 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -4,12 +4,11 @@ import { Mode } from "./ui"; import * as Utils from "../utils"; import { addWindow } from "./ui-theme"; import MessageUiHandler from "./message-ui-handler"; -import { GameDataType } from "#app/data/enums/game-data-type"; import { OptionSelectConfig, OptionSelectItem } from "./abstact-option-select-ui-handler"; import { Tutorial, handleTutorial } from "../tutorial"; import { updateUserInfo } from "../account"; import i18next from "../plugins/i18n"; -import {Button} from "../enums/buttons"; +import {Button, GameDataType} from "#enums"; export enum MenuOptions { GAME_SETTINGS, @@ -156,6 +155,7 @@ export default class MenuUiHandler extends MessageUiHandler { manageDataOptions.push({ label: i18next.t("menuUiHandler:importData"), handler: () => { + ui.revertMode(); this.scene.gameData.importData(GameDataType.SYSTEM); return true; }, diff --git a/src/ui/modal-ui-handler.ts b/src/ui/modal-ui-handler.ts index b521ec43759..76c833f7af1 100644 --- a/src/ui/modal-ui-handler.ts +++ b/src/ui/modal-ui-handler.ts @@ -3,7 +3,7 @@ import { TextStyle, addTextObject } from "./text"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import { WindowVariant, addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; export interface ModalConfig { buttonActions: Function[]; diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 9a17f6e344d..87c14f7253a 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -6,7 +6,7 @@ import AwaitableUiHandler from "./awaitable-ui-handler"; import { Mode } from "./ui"; import { LockModifierTiersModifier, PokemonHeldItemModifier } from "../modifier/modifier"; import { handleTutorial, Tutorial } from "../tutorial"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; import MoveInfoOverlay from "./move-info-overlay"; import { allMoves } from "../data/move"; import * as Utils from "./../utils"; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 0fc0853f234..7138e440635 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -8,7 +8,6 @@ import { Mode } from "./ui"; import * as Utils from "../utils"; import { PokemonFormChangeItemModifier, PokemonHeldItemModifier, SwitchEffectTransferModifier } from "../modifier/modifier"; import { allMoves } from "../data/move"; -import { Moves } from "../data/enums/moves"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { StatusEffect } from "../data/status-effect"; import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; @@ -16,7 +15,7 @@ import { pokemonEvolutions } from "../data/pokemon-evolutions"; import { addWindow } from "./ui-theme"; import { SpeciesFormChangeItemTrigger } from "../data/pokemon-forms"; import { getVariantTint } from "#app/data/variant"; -import {Button} from "../enums/buttons"; +import {Button, Moves} from "#enums"; import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; import MoveInfoOverlay from "./move-info-overlay"; import i18next from "i18next"; diff --git a/src/ui/save-slot-select-ui-handler.ts b/src/ui/save-slot-select-ui-handler.ts index e5417f83596..7c51b154e74 100644 --- a/src/ui/save-slot-select-ui-handler.ts +++ b/src/ui/save-slot-select-ui-handler.ts @@ -1,6 +1,6 @@ import i18next from "i18next"; import BattleScene from "../battle-scene"; -import { Button } from "../enums/buttons"; +import { Button } from "#enums"; import { GameMode } from "../game-mode"; import { PokemonHeldItemModifier } from "../modifier/modifier"; import { SessionSaveData } from "../system/game-data"; diff --git a/src/ui/settings/abstract-binding-ui-handler.ts b/src/ui/settings/abstract-binding-ui-handler.ts index fe0736ce101..285e6f58575 100644 --- a/src/ui/settings/abstract-binding-ui-handler.ts +++ b/src/ui/settings/abstract-binding-ui-handler.ts @@ -3,7 +3,7 @@ import BattleScene from "../../battle-scene"; import {Mode} from "../ui"; import {addWindow} from "../ui-theme"; import {addTextObject, TextStyle} from "../text"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums"; import {NavigationManager} from "#app/ui/settings/navigationMenu"; /** diff --git a/src/ui/settings/abstract-control-settings-ui-handler.ts b/src/ui/settings/abstract-control-settings-ui-handler.ts index b8165d41980..0a271ea5b63 100644 --- a/src/ui/settings/abstract-control-settings-ui-handler.ts +++ b/src/ui/settings/abstract-control-settings-ui-handler.ts @@ -4,10 +4,9 @@ import {Mode} from "../ui"; import {InterfaceConfig} from "../../inputs-controller"; import {addWindow} from "../ui-theme"; import {addTextObject, TextStyle} from "../text"; -import {Button} from "../../enums/buttons"; +import {Button, Device} from "#enums"; import {getIconWithSettingName} from "#app/configs/inputs/configHandler"; import NavigationMenu, {NavigationManager} from "#app/ui/settings/navigationMenu"; -import { Device } from "#app/enums/devices.js"; export interface InputsIcons { [key: string]: Phaser.GameObjects.Sprite; diff --git a/src/ui/settings/abstract-settings-ui-handler.ts b/src/ui/settings/abstract-settings-ui-handler.ts index 87d6a611662..742933dfba2 100644 --- a/src/ui/settings/abstract-settings-ui-handler.ts +++ b/src/ui/settings/abstract-settings-ui-handler.ts @@ -4,7 +4,7 @@ import { TextStyle, addTextObject } from "../text"; import { Mode } from "../ui"; import UiHandler from "../ui-handler"; import { addWindow } from "../ui-theme"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums"; import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler.js"; import NavigationMenu, {NavigationManager} from "#app/ui/settings/navigationMenu"; import { Setting, SettingKeys } from "#app/system/settings/settings"; diff --git a/src/ui/settings/gamepad-binding-ui-handler.ts b/src/ui/settings/gamepad-binding-ui-handler.ts index 1ab705d3278..785f9f4fd58 100644 --- a/src/ui/settings/gamepad-binding-ui-handler.ts +++ b/src/ui/settings/gamepad-binding-ui-handler.ts @@ -1,7 +1,7 @@ import BattleScene from "../../battle-scene"; import AbstractBindingUiHandler from "./abstract-binding-ui-handler"; import {Mode} from "../ui"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums"; import {getIconWithSettingName, getKeyWithKeycode} from "#app/configs/inputs/configHandler"; import {addTextObject, TextStyle} from "#app/ui/text"; diff --git a/src/ui/settings/keyboard-binding-ui-handler.ts b/src/ui/settings/keyboard-binding-ui-handler.ts index ca490857200..0c2c38513f0 100644 --- a/src/ui/settings/keyboard-binding-ui-handler.ts +++ b/src/ui/settings/keyboard-binding-ui-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../../battle-scene"; import AbstractBindingUiHandler from "./abstract-binding-ui-handler"; import {Mode} from "../ui"; import { getKeyWithKeycode} from "#app/configs/inputs/configHandler"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums"; import {addTextObject, TextStyle} from "#app/ui/text"; diff --git a/src/ui/settings/navigationMenu.ts b/src/ui/settings/navigationMenu.ts index c35e60d3ac7..0523b1da625 100644 --- a/src/ui/settings/navigationMenu.ts +++ b/src/ui/settings/navigationMenu.ts @@ -3,7 +3,7 @@ import {Mode} from "#app/ui/ui"; import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler.js"; import {addTextObject, setTextStyle, TextStyle} from "#app/ui/text"; import {addWindow} from "#app/ui/ui-theme"; -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums"; const LEFT = "LEFT"; const RIGHT = "RIGHT"; diff --git a/src/ui/settings/settings-gamepad-ui-handler.ts b/src/ui/settings/settings-gamepad-ui-handler.ts index 20a713012ae..9e4b1e90a64 100644 --- a/src/ui/settings/settings-gamepad-ui-handler.ts +++ b/src/ui/settings/settings-gamepad-ui-handler.ts @@ -13,7 +13,7 @@ import pad_dualshock from "#app/configs/inputs/pad_dualshock"; import pad_unlicensedSNES from "#app/configs/inputs/pad_unlicensedSNES"; import {InterfaceConfig} from "#app/inputs-controller"; import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler.js"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums"; import {truncateString} from "#app/utils"; /** diff --git a/src/ui/settings/settings-keyboard-ui-handler.ts b/src/ui/settings/settings-keyboard-ui-handler.ts index 59b409fe990..15dd058d53e 100644 --- a/src/ui/settings/settings-keyboard-ui-handler.ts +++ b/src/ui/settings/settings-keyboard-ui-handler.ts @@ -13,7 +13,7 @@ import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control- import {InterfaceConfig} from "#app/inputs-controller"; import {addTextObject, TextStyle} from "#app/ui/text"; import {deleteBind} from "#app/configs/inputs/configHandler"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums"; import {NavigationManager} from "#app/ui/settings/navigationMenu"; /** diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 58d053ac14e..bdeb542d899 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -7,8 +7,6 @@ import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import BattleScene, { starterColors } from "../battle-scene"; import { allAbilities } from "../data/ability"; import { speciesEggMoves } from "../data/egg-moves"; -import { Moves } from "../data/enums/moves"; -import { Species } from "../data/enums/species"; import { GrowthRate, getGrowthRateColor } from "../data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "../data/gender"; import { allMoves } from "../data/move"; @@ -17,11 +15,9 @@ import { pokemonFormChanges } from "../data/pokemon-forms"; import { LevelMoves, pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "../data/pokemon-level-moves"; import PokemonSpecies, { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from "../data/pokemon-species"; import { Type } from "../data/type"; -import { Button } from "../enums/buttons"; import { GameModes } from "../game-mode"; import { SelectChallengePhase, TitlePhase } from "../phases"; import { AbilityAttr, DexAttr, DexAttrProps, DexEntry, StarterFormMoveData, StarterMoveset } from "../system/game-data"; -import { Passive as PassiveAttr } from "#app/data/enums/passive"; import { Tutorial, handleTutorial } from "../tutorial"; import * as Utils from "../utils"; import { OptionSelectItem } from "./abstact-option-select-ui-handler"; @@ -32,7 +28,7 @@ import { TextStyle, addBBCodeTextObject, addTextObject } from "./text"; import { Mode } from "./ui"; import { addWindow } from "./ui-theme"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; -import {Device} from "#app/enums/devices"; +import {Device, Moves, Species, Button, Passive as PassiveAttr} from "#enums"; import * as Challenge from "../data/challenge"; import MoveInfoOverlay from "./move-info-overlay"; import { getEggTierForSpecies } from "#app/data/egg.js"; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index fb788f2c9c0..d063d9c6d26 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -17,9 +17,8 @@ import { StatusEffect } from "../data/status-effect"; import { getBiomeName } from "../data/biomes"; import { Nature, getNatureStatMultiplier } from "../data/nature"; import { loggedInUser } from "../account"; -import { PlayerGender } from "#app/data/enums/player-gender"; import { Variant, getVariantTint } from "#app/data/variant"; -import {Button} from "../enums/buttons"; +import {Button, PlayerGender} from "#enums"; import { Ability } from "../data/ability.js"; import i18next from "i18next"; import {modifierSortFunc} from "../modifier/modifier"; diff --git a/src/ui/target-select-ui-handler.ts b/src/ui/target-select-ui-handler.ts index c69284fe64e..256acc78c8a 100644 --- a/src/ui/target-select-ui-handler.ts +++ b/src/ui/target-select-ui-handler.ts @@ -1,11 +1,10 @@ import { BattlerIndex } from "../battle"; import BattleScene from "../battle-scene"; -import { Moves } from "../data/enums/moves"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import * as Utils from "../utils"; import { getMoveTargets } from "../data/move"; -import {Button} from "../enums/buttons"; +import {Button, Moves} from "#enums"; export type TargetSelectCallback = (cursor: integer) => void; diff --git a/src/ui/text.ts b/src/ui/text.ts index 79d64c57fad..8c034564469 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -1,8 +1,7 @@ import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; import InputText from "phaser3-rex-plugins/plugins/inputtext"; import BattleScene from "../battle-scene"; -import { EggTier } from "../data/enums/egg-type"; -import { UiTheme } from "../enums/ui-theme"; +import { EggTier, UiTheme } from "#enums"; import { ModifierTier } from "../modifier/modifier-tier"; import Phaser from "phaser"; diff --git a/src/ui/time-of-day-widget.ts b/src/ui/time-of-day-widget.ts index da3503fb573..eabd91b4608 100644 --- a/src/ui/time-of-day-widget.ts +++ b/src/ui/time-of-day-widget.ts @@ -1,8 +1,7 @@ import * as Utils from "../utils"; import BattleScene from "#app/battle-scene.js"; -import { TimeOfDay } from "#app/data/enums/time-of-day.js"; import { BattleSceneEventType } from "../events/battle-scene"; -import { EaseType } from "./enums/ease-type"; +import { EaseType, TimeOfDay } from "#enums"; /** A small self contained UI element that displays the time of day as an icon */ export default class TimeOfDayWidget extends Phaser.GameObjects.Container { diff --git a/src/ui/ui-handler.ts b/src/ui/ui-handler.ts index e74853276ea..f574844dc5a 100644 --- a/src/ui/ui-handler.ts +++ b/src/ui/ui-handler.ts @@ -1,7 +1,7 @@ import BattleScene from "../battle-scene"; import { TextStyle, getTextColor } from "./text"; import { Mode } from "./ui"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums"; /** * A basic abstract class to act as a holder and processor for UI elements. diff --git a/src/ui/ui-theme.ts b/src/ui/ui-theme.ts index 3351efffa1d..139b5f75768 100644 --- a/src/ui/ui-theme.ts +++ b/src/ui/ui-theme.ts @@ -1,4 +1,4 @@ -import { UiTheme } from "#app/enums/ui-theme"; +import { UiTheme } from "#enums"; import { legacyCompatibleImages } from "#app/scene-base"; import BattleScene from "../battle-scene"; diff --git a/src/ui/ui.ts b/src/ui/ui.ts index 366be949374..f576d157e2d 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -37,9 +37,8 @@ import SavingIconHandler from "./saving-icon-handler"; import UnavailableModalUiHandler from "./unavailable-modal-ui-handler"; import OutdatedModalUiHandler from "./outdated-modal-ui-handler"; import SessionReloadModalUiHandler from "./session-reload-modal-ui-handler"; -import {Button} from "../enums/buttons"; +import {Button, PlayerGender} from "#enums"; import i18next, {ParseKeys} from "i18next"; -import { PlayerGender } from "#app/data/enums/player-gender"; import GamepadBindingUiHandler from "./settings/gamepad-binding-ui-handler"; import SettingsKeyboardUiHandler from "#app/ui/settings/settings-keyboard-ui-handler"; import KeyboardBindingUiHandler from "#app/ui/settings/keyboard-binding-ui-handler"; diff --git a/src/ui/vouchers-ui-handler.ts b/src/ui/vouchers-ui-handler.ts index 4508a5be193..ebb32ea8ed0 100644 --- a/src/ui/vouchers-ui-handler.ts +++ b/src/ui/vouchers-ui-handler.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import { Button } from "../enums/buttons"; +import { Button } from "#enums"; import i18next from "../plugins/i18n"; import { Voucher, getVoucherTypeIcon, getVoucherTypeName, vouchers } from "../system/voucher"; import MessageUiHandler from "./message-ui-handler"; diff --git a/src/utils.ts b/src/utils.ts index 6f2c9cd0c65..e4d31d16121 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ import i18next from "i18next"; -import { MoneyFormat } from "./enums/money-format"; +import { MoneyFormat } from "#enums"; export const MissingTextureKey = "__MISSING"; diff --git a/tsconfig.json b/tsconfig.json index ec0b5e95ac2..5ca3e257306 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2020", "module": "ES2020", - "moduleResolution": "Bundler", + "moduleResolution": "bundler", "resolveJsonModule": true, "esModuleInterop": true, "strictNullChecks": false, @@ -11,6 +11,8 @@ "rootDir": "./src", "baseUrl": "./src", "paths": { + "#enums": ["./enums"], + "#enums/*": ["./enums/*"], "#app/*": ["*.ts"], "#app": ["."], "#test/*": ["./test/*.ts"] diff --git a/vite.config.js b/vite.config.js index 220747b98e3..46c72cd0e6b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,3 +1,4 @@ +import { resolve } from 'path'; import { defineConfig } from 'vite'; // import fs from 'vite-plugin-fs'; @@ -8,7 +9,26 @@ export default defineConfig(({ mode }) => { clearScreen: false, build: { minify: 'esbuild', - sourcemap: false + sourcemap: false, + rollupOptions: { + external: [ + /^\#enums/, + ] + } + }, + rollupOptions: { + onwarn(warning, warn) { + // Suppress "Module level directives cause errors when bundled" warnings + if (warning.code === "MODULE_LEVEL_DIRECTIVE") { + return; + } + warn(warning); + }, + }, + resolve: { + alias: { + "#enums": resolve('./src/enums') + } }, esbuild: { pure: mode === 'production' ? [ 'console.log' ] : [], diff --git a/vitest.config.js b/vitest.config.js index 5dcb326e1ea..d68ce4d52fe 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,4 +1,5 @@ import { defineConfig } from 'vite'; +import path from 'path'; // import fs from 'vite-plugin-fs'; export default defineConfig(({ mode }) => { @@ -34,6 +35,11 @@ export default defineConfig(({ mode }) => { minify: 'esbuild', sourcemap: true }, + resolve: { + alias: { + "#enums": path.resolve('./src/enums') + } + }, esbuild: { pure: mode === 'production' ? [ 'console.log' ] : [], keepNames: true,