From e6c24dceabe0a9ede202b1f8a90f0a93568aa216 Mon Sep 17 00:00:00 2001 From: Matthew Olker Date: Thu, 13 Jun 2024 11:30:47 -0400 Subject: [PATCH] Revert "[QoL] Reorganize Enum Locations (#2142)" This reverts commit cf06ff3b8d3bca1195150533b9f72f46271b167f. --- package.json | 2 -- public/update-source-comments.py | 2 +- src/battle-scene.ts | 12 +++++++- src/battle.ts | 6 +++- src/configs/inputs/cfg_keyboard_qwerty.ts | 2 +- src/configs/inputs/configHandler.ts | 2 +- src/configs/inputs/pad_dualshock.ts | 2 +- src/configs/inputs/pad_generic.ts | 2 +- src/configs/inputs/pad_procon.ts | 2 +- src/configs/inputs/pad_unlicensedSNES.ts | 2 +- src/configs/inputs/pad_xbox360.ts | 2 +- src/data/ability.ts | 6 +++- src/data/api.ts | 4 ++- src/data/arena-tag.ts | 5 +++- src/data/battle-anims.ts | 2 +- src/data/battler-tags.ts | 5 +++- src/data/berry.ts | 3 +- src/data/biomes.ts | 5 +++- src/data/challenge.ts | 4 ++- src/data/daily-run.ts | 3 +- src/data/dialogue.ts | 3 +- src/data/egg-moves.ts | 3 +- src/data/egg.ts | 3 +- src/{ => data}/enums/abilities.ts | 0 src/{ => data}/enums/arena-tag-type.ts | 0 src/{ => data}/enums/battler-tag-type.ts | 0 src/{ => data}/enums/berry-type.ts | 0 src/{ => data}/enums/biome.ts | 0 src/{ => data}/enums/challenges.ts | 0 src/{ => data}/enums/egg-type.ts | 0 src/{ => data}/enums/game-data-type.ts | 0 src/{ => data}/enums/moves.ts | 0 src/{ => data}/enums/party-member-strength.ts | 0 src/{ => data}/enums/passive.ts | 0 src/{ => data}/enums/player-gender.ts | 0 src/{ => data}/enums/species.ts | 0 src/{ => data}/enums/time-of-day.ts | 0 src/{ => data}/enums/trainer-type.ts | 0 src/data/move.ts | 9 ++++-- src/data/nature.ts | 2 +- src/data/pokemon-evolutions.ts | 5 +++- src/data/pokemon-forms.ts | 5 +++- src/data/pokemon-level-moves.ts | 3 +- src/data/pokemon-species.ts | 4 ++- src/data/tms.ts | 3 +- src/data/trainer-config.ts | 5 +++- src/data/trainer-names.ts | 2 +- src/data/weather.ts | 2 +- src/egg-hatch-phase.ts | 3 +- src/enums/index.ts | 25 ----------------- src/field/arena.ts | 9 ++++-- src/{ => field}/events/arena.ts | 2 +- src/field/pokemon.ts | 9 +++++- src/field/trainer.ts | 4 ++- src/form-change-phase.ts | 2 +- src/game-mode.ts | 3 +- src/inputs-controller.ts | 3 +- src/loading-scene.ts | 3 +- src/messages.ts | 2 +- src/modifier/modifier-type.ts | 5 +++- src/modifier/modifier.ts | 3 +- src/overrides.ts | 7 ++++- src/phases.ts | 12 +++++++- src/system/achv.ts | 2 +- src/system/arena-data.ts | 2 +- src/system/game-data.ts | 28 +++++++++++++++---- src/system/pokemon-data.ts | 4 ++- src/system/settings/settings-gamepad.ts | 2 +- src/system/settings/settings-keyboard.ts | 2 +- src/system/settings/settings.ts | 4 ++- src/system/trainer-data.ts | 2 +- src/system/voucher.ts | 3 +- src/test/abilities/battle_bond.test.ts | 6 ++-- src/test/abilities/disguise.test.ts | 6 ++-- src/test/abilities/intimidate.test.ts | 4 ++- src/test/abilities/intrepid_sword.test.ts | 3 +- src/test/abilities/libero.test.ts | 10 +++---- src/test/abilities/moxie.test.ts | 4 ++- src/test/abilities/power_construct.test.ts | 6 ++-- src/test/abilities/protean.test.ts | 10 +++---- src/test/abilities/sap_sipper.test.ts | 5 +++- src/test/abilities/schooling.test.ts | 6 ++-- src/test/abilities/shields_down.test.ts | 6 ++-- src/test/abilities/volt_absorb.test.ts | 5 +++- src/test/abilities/zen_mode.test.ts | 4 ++- src/test/abilities/zero_to_hero.test.ts | 6 ++-- src/test/battle/battle-order.test.ts | 5 +++- src/test/battle/battle.test.ts | 5 +++- src/test/battle/error-handling.test.ts | 4 ++- src/test/battle/special_battle.test.ts | 4 ++- src/test/eggs/egg.test.ts | 2 +- src/test/imports.test.ts | 2 +- src/test/items/toxic_orb.test.ts | 4 ++- src/test/lokalisation/french.test.ts | 2 +- src/test/moves/growth.test.ts | 4 ++- src/test/moves/spikes.test.ts | 4 ++- src/test/moves/tackle.test.ts | 3 +- src/test/moves/tail_whip.test.ts | 4 ++- .../settingMenu/rebinding_setting.test.ts | 3 +- src/test/ui/starter-select.test.ts | 4 ++- src/test/utils/gameManager.ts | 6 +++- src/test/utils/gameManagerUtils.ts | 2 +- src/touch-controls.ts | 2 +- src/ui-inputs.ts | 2 +- src/ui/abstact-option-select-ui-handler.ts | 2 +- src/ui/achv-bar.ts | 2 +- src/ui/achvs-ui-handler.ts | 3 +- src/ui/arena-flyout.ts | 4 +-- src/ui/awaitable-ui-handler.ts | 2 +- src/ui/ball-ui-handler.ts | 2 +- src/ui/battle-flyout.ts | 4 ++- src/ui/battle-message-ui-handler.ts | 2 +- src/ui/candy-bar.ts | 2 +- src/ui/challenges-select-ui-handler.ts | 2 +- src/ui/command-ui-handler.ts | 2 +- src/ui/confirm-ui-handler.ts | 2 +- src/ui/egg-gacha-ui-handler.ts | 3 +- src/ui/egg-hatch-scene-handler.ts | 2 +- src/ui/egg-list-ui-handler.ts | 2 +- src/{ => ui}/enums/ease-type.ts | 0 src/ui/evolution-scene-handler.ts | 2 +- src/ui/fight-ui-handler.ts | 2 +- src/ui/form-modal-ui-handler.ts | 2 +- src/ui/game-stats-ui-handler.ts | 2 +- src/ui/menu-ui-handler.ts | 4 +-- src/ui/modal-ui-handler.ts | 2 +- src/ui/modifier-select-ui-handler.ts | 2 +- src/ui/party-ui-handler.ts | 3 +- src/ui/save-slot-select-ui-handler.ts | 2 +- .../settings/abstract-binding-ui-handler.ts | 2 +- .../abstract-control-settings-ui-handler.ts | 3 +- .../settings/abstract-settings-ui-handler.ts | 2 +- src/ui/settings/gamepad-binding-ui-handler.ts | 2 +- .../settings/keyboard-binding-ui-handler.ts | 2 +- src/ui/settings/navigationMenu.ts | 2 +- .../settings/settings-gamepad-ui-handler.ts | 2 +- .../settings/settings-keyboard-ui-handler.ts | 2 +- src/ui/starter-select-ui-handler.ts | 6 +++- src/ui/summary-ui-handler.ts | 3 +- src/ui/target-select-ui-handler.ts | 3 +- src/ui/text.ts | 3 +- src/ui/time-of-day-widget.ts | 3 +- src/ui/ui-handler.ts | 2 +- src/ui/ui-theme.ts | 2 +- src/ui/ui.ts | 3 +- src/ui/vouchers-ui-handler.ts | 2 +- src/utils.ts | 2 +- tsconfig.json | 4 +-- vite.config.js | 22 +-------------- vitest.config.js | 6 ---- 150 files changed, 327 insertions(+), 214 deletions(-) rename src/{ => data}/enums/abilities.ts (100%) rename src/{ => data}/enums/arena-tag-type.ts (100%) rename src/{ => data}/enums/battler-tag-type.ts (100%) rename src/{ => data}/enums/berry-type.ts (100%) rename src/{ => data}/enums/biome.ts (100%) rename src/{ => data}/enums/challenges.ts (100%) rename src/{ => data}/enums/egg-type.ts (100%) rename src/{ => data}/enums/game-data-type.ts (100%) rename src/{ => data}/enums/moves.ts (100%) rename src/{ => data}/enums/party-member-strength.ts (100%) rename src/{ => data}/enums/passive.ts (100%) rename src/{ => data}/enums/player-gender.ts (100%) rename src/{ => data}/enums/species.ts (100%) rename src/{ => data}/enums/time-of-day.ts (100%) rename src/{ => data}/enums/trainer-type.ts (100%) delete mode 100644 src/enums/index.ts rename src/{ => field}/events/arena.ts (98%) rename src/{ => ui}/enums/ease-type.ts (100%) diff --git a/package.json b/package.json index eb1b71b4e18..24aa6243b75 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,6 @@ "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 410d1a42566..34f0c28dd4c 100644 --- a/public/update-source-comments.py +++ b/public/update-source-comments.py @@ -1,6 +1,6 @@ import re -filenames = [['src/enums/moves.ts', 'move'], ['src/enums/abilities.ts', 'ability'], ['src/enums/species.ts', 'Pokémon']] +filenames = [['src/data/enums/moves.ts', 'move'], ['src/data/enums/abilities.ts', 'ability'], ['src/data/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 ab36c707025..a4ed394f862 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -9,9 +9,12 @@ 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"; @@ -28,6 +31,7 @@ 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"; @@ -38,12 +42,14 @@ 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"; @@ -51,9 +57,13 @@ 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, BattleSpec, BattleStyle, Biome, EaseType, ExpNotification, MoneyFormat, Moves, PlayerGender, UiTheme, Species} from "#enums"; +import { Abilities } from "./data/enums/abilities"; 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 6650903cb18..68e16cb28bb 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -3,8 +3,12 @@ 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, Moves, PlayerGender, Species, TrainerType } from "#enums"; +import { BattleSpec } from "./enums/battle-spec"; +import { PlayerGender } from "./data/enums/player-gender"; 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 ef6a0cceb8f..83472529697 100644 --- a/src/configs/inputs/cfg_keyboard_qwerty.ts +++ b/src/configs/inputs/cfg_keyboard_qwerty.ts @@ -1,4 +1,4 @@ -import {Button} from "#enums"; +import {Button} from "#app/enums/buttons"; 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 f327efce287..0770ebffce1 100644 --- a/src/configs/inputs/configHandler.ts +++ b/src/configs/inputs/configHandler.ts @@ -1,4 +1,4 @@ -import {Device} from "#enums"; +import {Device} from "#app/enums/devices"; /** * 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 0ec79ab9614..d58a8b2879d 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"; +import {Button} from "../../enums/buttons"; /** * Dualshock mapping diff --git a/src/configs/inputs/pad_generic.ts b/src/configs/inputs/pad_generic.ts index 76aedd963f0..916f8c82add 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"; +import {Button} from "../../enums/buttons"; /** * Generic pad mapping diff --git a/src/configs/inputs/pad_procon.ts b/src/configs/inputs/pad_procon.ts index c94ff39bf70..4b7bd8457b0 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 "#enums"; +import {Button} from "#app/enums/buttons"; /** * Nintendo Pro Controller mapping diff --git a/src/configs/inputs/pad_unlicensedSNES.ts b/src/configs/inputs/pad_unlicensedSNES.ts index 07926ad682e..106fbc9eb8f 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"; +import {Button} from "../../enums/buttons"; /** * 081f-e401 - UnlicensedSNES diff --git a/src/configs/inputs/pad_xbox360.ts b/src/configs/inputs/pad_xbox360.ts index 01d8d9497da..645829d5be2 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 "#enums"; +import {Button} from "#app/enums/buttons"; /** * Generic pad mapping diff --git a/src/data/ability.ts b/src/data/ability.ts index fd1d048a4ee..82d72e9ac52 100755 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -6,19 +6,23 @@ import { MovePhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from " import { getPokemonMessage, getPokemonNameWithAffix } from "../messages"; import { Weather, WeatherType } from "./weather"; import { BattlerTag } from "./battler-tags"; -import { ArenaTagType, Abilities, BattlerTagType, Moves, Species } from "#enums"; +import { BattlerTagType } from "./enums/battler-tag-type"; 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 96d704abb05..2a88fc8d410 100644 --- a/src/data/api.ts +++ b/src/data/api.ts @@ -6,9 +6,11 @@ import PokemonSpecies, { PokemonForm, SpeciesFormKey, allSpecies } from "./pokem import { GrowthRate } from "./exp"; import { Type } from "./type"; import { allAbilities } from "./ability"; -import { Abilities, Moves, Species } from "#enums"; +import { Abilities } from "./enums/abilities"; +import { Species } from "./enums/species"; 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 bffca0ca7f0..37420c2ac0b 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -7,10 +7,13 @@ import Pokemon, { HitResult, PokemonMove } from "../field/pokemon"; import { MoveEffectPhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase} from "../phases"; import { StatusEffect } from "./status-effect"; import { BattlerIndex } from "../battle"; -import { Abilities, ArenaTagType, BattlerTagType, Moves } from "#enums"; +import { Moves } from "./enums/moves"; +import { ArenaTagType } from "./enums/arena-tag-type"; 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 19ebe8ad7af..75c883ec1e7 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"; +import { Moves } from "./enums/moves"; //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 b2b58339c9b..bfdeb2189dc 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -5,15 +5,18 @@ 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, BattlerTagType, Moves, Species } from "#enums"; +import { Abilities } from "./enums/abilities"; +import { BattlerTagType } from "./enums/battler-tag-type"; 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 f865ee43682..38f8f924c8a 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -2,11 +2,12 @@ import { PokemonHealPhase, StatChangePhase } from "../phases"; import { getPokemonMessage } from "../messages"; import Pokemon, { HitResult } from "../field/pokemon"; import { BattleStat } from "./battle-stat"; -import { BattlerTagType, BerryType } from "#enums"; +import { BattlerTagType } from "./enums/battler-tag-type"; 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 1d9e9638914..43cafb46fce 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -1,7 +1,10 @@ +import { Species } from "./enums/species"; import { Type } from "./type"; import * as Utils from "../utils"; import beautify from "json-beautify"; -import { Biome, Species, TimeOfDay, TrainerType } from "#enums"; +import { TrainerType } from "./enums/trainer-type"; +import { TimeOfDay } from "./enums/time-of-day"; +import { Biome } from "./enums/biome"; import {pokemonEvolutions, SpeciesFormEvolution} from "./pokemon-evolutions"; import i18next from "i18next"; diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 9f9d5ef5823..916f59ab2c2 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -1,12 +1,14 @@ import * as Utils from "../utils"; -import { Challenges, TrainerType, Species } from "#enums"; +import { Challenges } from "./enums/challenges"; 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 8be7edecbe4..c9b097bfcc0 100644 --- a/src/data/daily-run.ts +++ b/src/data/daily-run.ts @@ -2,8 +2,9 @@ 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, Species } from "#enums"; +import { PartyMemberStrength } from "./enums/party-member-strength"; export interface DailyRunConfig { seed: integer; diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts index bcbb4dfcbc1..5b5e0d865ba 100644 --- a/src/data/dialogue.ts +++ b/src/data/dialogue.ts @@ -1,5 +1,6 @@ import {trainerConfigs} from "./trainer-config"; -import {BattleSpec, TrainerType} from "#enums"; +import {TrainerType} from "./enums/trainer-type"; +import {BattleSpec} from "../enums/battle-spec"; export interface TrainerTypeMessages { encounter?: string | string[], diff --git a/src/data/egg-moves.ts b/src/data/egg-moves.ts index 23880625a8a..bed989849d9 100644 --- a/src/data/egg-moves.ts +++ b/src/data/egg-moves.ts @@ -1,4 +1,5 @@ -import { Moves, Species } from "#enums"; +import { Moves } from "./enums/moves"; +import { Species } from "./enums/species"; import { allMoves } from "./move"; import * as Utils from "../utils"; diff --git a/src/data/egg.ts b/src/data/egg.ts index 00393518f69..da6100446ec 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -1,6 +1,7 @@ import BattleScene from "../battle-scene"; +import { Species } from "./enums/species"; import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-species"; -import { EggTier, Species } from "#enums"; +import { EggTier } from "./enums/egg-type"; import i18next from "../plugins/i18n"; export const EGG_SEED = 1073741824; diff --git a/src/enums/abilities.ts b/src/data/enums/abilities.ts similarity index 100% rename from src/enums/abilities.ts rename to src/data/enums/abilities.ts diff --git a/src/enums/arena-tag-type.ts b/src/data/enums/arena-tag-type.ts similarity index 100% rename from src/enums/arena-tag-type.ts rename to src/data/enums/arena-tag-type.ts diff --git a/src/enums/battler-tag-type.ts b/src/data/enums/battler-tag-type.ts similarity index 100% rename from src/enums/battler-tag-type.ts rename to src/data/enums/battler-tag-type.ts diff --git a/src/enums/berry-type.ts b/src/data/enums/berry-type.ts similarity index 100% rename from src/enums/berry-type.ts rename to src/data/enums/berry-type.ts diff --git a/src/enums/biome.ts b/src/data/enums/biome.ts similarity index 100% rename from src/enums/biome.ts rename to src/data/enums/biome.ts diff --git a/src/enums/challenges.ts b/src/data/enums/challenges.ts similarity index 100% rename from src/enums/challenges.ts rename to src/data/enums/challenges.ts diff --git a/src/enums/egg-type.ts b/src/data/enums/egg-type.ts similarity index 100% rename from src/enums/egg-type.ts rename to src/data/enums/egg-type.ts diff --git a/src/enums/game-data-type.ts b/src/data/enums/game-data-type.ts similarity index 100% rename from src/enums/game-data-type.ts rename to src/data/enums/game-data-type.ts diff --git a/src/enums/moves.ts b/src/data/enums/moves.ts similarity index 100% rename from src/enums/moves.ts rename to src/data/enums/moves.ts diff --git a/src/enums/party-member-strength.ts b/src/data/enums/party-member-strength.ts similarity index 100% rename from src/enums/party-member-strength.ts rename to src/data/enums/party-member-strength.ts diff --git a/src/enums/passive.ts b/src/data/enums/passive.ts similarity index 100% rename from src/enums/passive.ts rename to src/data/enums/passive.ts diff --git a/src/enums/player-gender.ts b/src/data/enums/player-gender.ts similarity index 100% rename from src/enums/player-gender.ts rename to src/data/enums/player-gender.ts diff --git a/src/enums/species.ts b/src/data/enums/species.ts similarity index 100% rename from src/enums/species.ts rename to src/data/enums/species.ts diff --git a/src/enums/time-of-day.ts b/src/data/enums/time-of-day.ts similarity index 100% rename from src/enums/time-of-day.ts rename to src/data/enums/time-of-day.ts diff --git a/src/enums/trainer-type.ts b/src/data/enums/trainer-type.ts similarity index 100% rename from src/enums/trainer-type.ts rename to src/data/enums/trainer-type.ts diff --git a/src/data/move.ts b/src/data/move.ts index 9f8c861fe3d..3979314568b 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1,7 +1,9 @@ +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"; @@ -9,16 +11,19 @@ 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, ArenaTagType, BattlerTagType, Biome, Moves, Species } from "#enums"; +import { Abilities } from "./enums/abilities"; 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"; @@ -1792,7 +1797,7 @@ export class RemoveHeldItemAttr extends MoveEffectAttr { } /** - * 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. + * 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. */ export class EatBerryAttr extends MoveEffectAttr { protected chosenBerry: BerryModifier; diff --git a/src/data/nature.ts b/src/data/nature.ts index 55b38f5ba86..c9709d5ee4c 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 "#enums"; +import { UiTheme } from "#app/enums/ui-theme"; import i18next from "i18next"; export enum Nature { diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index 2ccac3522a7..9cfcad41c08 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -1,12 +1,15 @@ 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, Moves, Species, TimeOfDay } from "#enums"; +import { Biome } from "./enums/biome"; +import { TimeOfDay } from "./enums/time-of-day"; import { Nature } from "./nature"; export enum SpeciesWildEvolutionDelay { diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index b00b57826cf..998752f4d34 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -1,9 +1,12 @@ +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, Moves, Species, TimeOfDay } from "#enums"; +import { Abilities } from "./enums/abilities"; export enum FormChangeItem { NONE, diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index ffa42eda453..89ae23f1ac2 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -1,4 +1,5 @@ -import { Moves, Species } from "#enums"; +import { Moves } from "./enums/moves"; +import { Species } from "./enums/species"; export type LevelMoves = ([integer, Moves])[]; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 8313a94cb50..08dd59b6c01 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1,15 +1,17 @@ -import { Abilities, PartyMemberStrength, Species } from "#enums"; +import { Abilities } from "./enums/abilities"; 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 43a1fc049be..dfde4ef948e 100644 --- a/src/data/tms.ts +++ b/src/data/tms.ts @@ -1,5 +1,6 @@ import { ModifierTier } from "../modifier/modifier-tier"; -import { Moves, Species } from "#enums"; +import { Moves } from "./enums/moves"; +import { Species } from "./enums/species"; interface TmSpecies { [key: integer]: Array> diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index c083453ac00..43ce8c8444a 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -2,15 +2,18 @@ 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 {Moves, PartyMemberStrength, Species, TrainerType} from "#enums"; +import {PartyMemberStrength} from "./enums/party-member-strength"; 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 1233760da81..5cd6850fba0 100644 --- a/src/data/trainer-names.ts +++ b/src/data/trainer-names.ts @@ -1,4 +1,4 @@ -import { TrainerType } from "#enums"; +import { TrainerType } from "./enums/trainer-type"; import * as Utils from "../utils"; class TrainerNameConfig { diff --git a/src/data/weather.ts b/src/data/weather.ts index 53b87445518..1df94b02da1 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -1,4 +1,4 @@ -import { Biome } from "#enums"; +import { Biome } from "./enums/biome"; 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 7264b5c8ee1..b86e7a9f2ca 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -5,11 +5,12 @@ 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, Species } from "#enums"; +import { EggTier } from "./data/enums/egg-type"; import PokemonInfoContainer from "./ui/pokemon-info-container"; import EggCounterContainer from "./ui/egg-counter-container"; import { EggCountChangedEvent } from "./events/egg"; diff --git a/src/enums/index.ts b/src/enums/index.ts deleted file mode 100644 index e81c5d97f22..00000000000 --- a/src/enums/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -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/field/arena.ts b/src/field/arena.ts index e3e9d644886..7885668b577 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -1,20 +1,25 @@ import BattleScene from "../battle-scene"; import { BiomePoolTier, PokemonPools, BiomeTierTrainerPools, biomePokemonPools, biomeTrainerPools } from "../data/biomes"; -import { ArenaTagType, Biome, Moves, Species, TimeOfDay, TrainerType } from "#enums"; +import { Biome } from "../data/enums/biome"; 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/events/arena.ts b/src/field/events/arena.ts similarity index 98% rename from src/events/arena.ts rename to src/field/events/arena.ts index 64e53a07ee9..b3d03fdfcae 100644 --- a/src/events/arena.ts +++ b/src/field/events/arena.ts @@ -1,5 +1,5 @@ import { ArenaTagSide } from "#app/data/arena-tag.js"; -import { ArenaTagType } from "#enums"; +import { ArenaTagType } from "#app/data/enums/arena-tag-type.js"; import { TerrainType } from "#app/data/terrain.js"; import { WeatherType } from "#app/data/weather.js"; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index ce4ee6644dd..2da0cc8d15f 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3,6 +3,7 @@ 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"; @@ -19,13 +20,18 @@ 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 { Abilities, ArenaTagType, Moves, BattlerTagType, Species, Biome, BattleSpec, BerryType } from "#enums"; +import { ArenaTagType } from "../data/enums/arena-tag-type"; +import { Biome } from "../data/enums/biome"; 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"; @@ -38,6 +44,7 @@ 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 c4af4be767b..1646866189b 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -11,7 +11,8 @@ import { trainerPartyTemplates, signatureSpecies } from "../data/trainer-config"; -import {PartyMemberStrength, Species, TrainerType} from "#enums"; +import {PartyMemberStrength} from "../data/enums/party-member-strength"; +import {TrainerType} from "../data/enums/trainer-type"; import {EnemyPokemon} from "./pokemon"; import * as Utils from "../utils"; import {PersistentModifier} from "../modifier/modifier"; @@ -19,6 +20,7 @@ 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 df60cc100f7..a8957bfc8b6 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"; +import { BattleSpec } from "./enums/battle-spec"; import { BattlePhase, MovePhase, PokemonHealPhase } from "./phases"; import { getTypeRgb } from "./data/type"; diff --git a/src/game-mode.ts b/src/game-mode.ts index f0db6c04a52..cb042b2757c 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -2,7 +2,8 @@ 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, Species } from "#enums"; +import { Biome } from "./data/enums/biome"; +import { Species } from "./data/enums/species"; 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 5502292cac0..1f10197903c 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -6,11 +6,12 @@ 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 {Button, Device} from "#enums"; +import {Device} from "#app/enums/devices"; import { assign, getButtonWithKeycode, diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 4b10af48280..7a097cc8b37 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -1,5 +1,6 @@ import { GachaType } from "./data/egg"; -import { Biome, TrainerType } from "#enums"; +import { Biome } from "./data/enums/biome"; +import { TrainerType } from "./data/enums/trainer-type"; 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 25a0674f208..e2387094502 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,4 +1,4 @@ -import { BattleSpec } from "#enums"; +import { BattleSpec } from "./enums/battle-spec"; 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 e2ca5418fc7..03059915b54 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1,6 +1,7 @@ import * as Modifiers from "./modifier"; import { AttackMove, allMoves } from "../data/move"; -import { Abilities, BattlerTagType, BerryType, Moves } from "#enums"; +import { Moves } from "../data/enums/moves"; +import { Abilities } from "../data/enums/abilities"; import { PokeballType, getPokeballCatchMultiplier, getPokeballName } from "../data/pokeball"; import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove } from "../field/pokemon"; import { EvolutionItem, pokemonEvolutions } from "../data/pokemon-evolutions"; @@ -11,6 +12,7 @@ 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"; @@ -21,6 +23,7 @@ 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 3a2d0d0bf1e..85746e30bb6 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -13,12 +13,13 @@ import { getPokemonMessage } from "../messages"; import * as Utils from "../utils"; import { TempBattleStat } from "../data/temp-battle-stat"; import { getBerryEffectFunc, getBerryPredicate } from "../data/berry"; -import { BattlerTagType, BerryType } from "#enums"; +import { BerryType } from "../data/enums/berry-type"; 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 d39c0ebfa4e..df95104387b 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -1,12 +1,17 @@ -import { Species, Abilities, Biome, Moves, BerryType, TimeOfDay } from "#enums"; +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 { 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 77d8e777b73..dabbbb4c4eb 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 { Abilities, ArenaTagType, BattleSpec, BattleStyle, BattlerTagType, Biome, ExpNotification, Moves, PlayerGender, Species, TrainerType } from "#enums"; +import { Moves } from "./data/enums/moves"; 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,27 +17,34 @@ 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"; @@ -51,10 +58,13 @@ 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 bf4fe4f2e32..f44ea2a9301 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 "#enums"; +import { PlayerGender } from "#app/data/enums/player-gender"; 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 4ed0fe42b06..6eec27c32d3 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 "#enums"; +import { Biome } from "../data/enums/biome"; 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 48a8836b2ed..1be5cab8d97 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, Moves, Device, PlayerGender, GameDataType } from "#enums"; +import { Species, defaultStarterSpecies } from "../data/enums/species"; import * as Utils from "../utils"; import * as Overrides from "../overrides"; import PokemonData from "./pokemon-data"; @@ -24,6 +24,7 @@ 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"; @@ -31,9 +32,12 @@ 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/events/arena.js"; +import { TerrainChangedEvent, WeatherChangedEvent } from "#app/field/events/arena"; +import { Device } from "#app/enums/devices.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 @@ -1209,11 +1213,9 @@ 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); @@ -1233,12 +1235,28 @@ 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 dbec9ea9c82..b7dc2d67883 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -1,13 +1,15 @@ import { BattleType } from "../battle"; import BattleScene from "../battle-scene"; -import { Biome, Species, Moves } from "#enums"; +import { Biome } from "../data/enums/biome"; 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 29b6de94544..909b78ffe6f 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"; +import {Button} from "../../enums/buttons"; 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 661be6546b5..c394b2ef8f0 100644 --- a/src/system/settings/settings-keyboard.ts +++ b/src/system/settings/settings-keyboard.ts @@ -1,4 +1,4 @@ -import {Button} from "#enums"; +import {Button} from "#app/enums/buttons"; 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 2859d3c4b67..fb446e1e081 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -3,9 +3,11 @@ import i18next from "i18next"; import BattleScene from "../../battle-scene"; import { hasTouchscreen } from "../../touch-controls"; import { updateWindowType } from "../../ui/ui-theme"; -import { PlayerGender, MoneyFormat, EaseType } from "#enums"; +import { PlayerGender } from "#app/data/enums/player-gender"; 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 20e62bf2a32..d4bb3cee94d 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 "#enums"; +import { TrainerType } from "../data/enums/trainer-type"; import Trainer, { TrainerVariant } from "../field/trainer"; export default class TrainerData { diff --git a/src/system/voucher.ts b/src/system/voucher.ts index 067ae62001c..f5c6a5eeacf 100644 --- a/src/system/voucher.ts +++ b/src/system/voucher.ts @@ -1,7 +1,8 @@ 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, TrainerType } from "#enums"; +import { PlayerGender } from "#app/data/enums/player-gender"; export enum VoucherType { REGULAR, diff --git a/src/test/abilities/battle_bond.test.ts b/src/test/abilities/battle_bond.test.ts index 7d39223dbd4..2752ceed896 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 "#enums"; -import { Abilities } from "#enums"; -import { Species } from "#enums"; +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 { 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 5059116490a..8b9c730c4c2 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 "#enums"; -import { Abilities } from "#enums"; -import { Species } from "#enums"; +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 { 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 662b2b5b677..2409c64e5be 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -2,7 +2,8 @@ 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, Species, Moves} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, SelectStarterPhase, @@ -10,6 +11,7 @@ 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 662bc02e42e..3a830df6845 100644 --- a/src/test/abilities/intrepid_sword.test.ts +++ b/src/test/abilities/intrepid_sword.test.ts @@ -2,7 +2,8 @@ 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, Species} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; import { CommandPhase, } from "#app/phases"; diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index 6dfb0a66413..b479691f565 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 "#enums"; -import { Abilities } from "#enums"; -import { Moves } from "#enums"; +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 { getMovePosition } from "../utils/gameManagerUtils"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; import { allMoves } from "#app/data/move.js"; -import { BattlerTagType } from "#enums"; +import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; import { Weather, WeatherType } from "#app/data/weather.js"; import { Type } from "#app/data/type.js"; -import { Biome } from "#enums"; +import { Biome } from "#app/data/enums/biome.js"; 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 5e910a0c3ae..ed27c670c87 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -2,7 +2,8 @@ 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, Moves, Species} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, @@ -10,6 +11,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 {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 cd763661ef2..c568ba9db3e 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 "#enums"; -import { Abilities } from "#enums"; -import { Species } from "#enums"; +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 { 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 8cd44481d16..cd3633156ee 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 "#enums"; -import { Abilities } from "#enums"; -import { Moves } from "#enums"; +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 { getMovePosition } from "../utils/gameManagerUtils"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; import { allMoves } from "#app/data/move.js"; -import { BattlerTagType } from "#enums"; +import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; import { Weather, WeatherType } from "#app/data/weather.js"; import { Type } from "#app/data/type.js"; -import { Biome } from "#enums"; +import { Biome } from "#app/data/enums/biome.js"; 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 1a9737ecb92..e2b3099f28f 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -2,16 +2,19 @@ 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, BattlerTagType, Moves, Species } from "#enums"; +import { Abilities } from "#app/data/enums/abilities.js"; 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 f4d84b4502e..35a05cff87a 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 "#enums"; -import { Abilities } from "#enums"; -import { Species } from "#enums"; +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 { 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 dd56f029f0c..6e7cb77e079 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 "#enums"; -import { Abilities } from "#enums"; -import { Species } from "#enums"; +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 { 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 6218125767a..1f0827780ac 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -2,12 +2,15 @@ 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, BattlerTagType, Moves, Species } from "#enums"; +import { Abilities } from "#app/data/enums/abilities.js"; 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 231c9a757f9..697350dc271 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -2,6 +2,8 @@ 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, @@ -16,7 +18,7 @@ import { } from "#app/phases"; import { Mode } from "#app/ui/ui"; import { Stat } from "#app/data/pokemon-stat"; -import { Abilities, Moves, Species } from "#enums"; +import { Moves } from "#app/data/enums/moves"; 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 36ffc2a58fb..a282be2750c 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 "#enums"; -import { Abilities } from "#enums"; -import { Species } from "#enums"; +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 { 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 45d09b83dc9..7ace7dae224 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -2,16 +2,19 @@ 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, Species, Moves, Button} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; 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 76f980e1498..9077cf00076 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, Moves, PlayerGender, Abilities} from "#enums"; +import {Species} from "#app/data/enums/species"; import * as overrides from "../../overrides"; import {Command} from "#app/ui/command-ui-handler"; import { @@ -17,10 +17,13 @@ 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 8e062f019e9..8b94c108bc1 100644 --- a/src/test/battle/error-handling.test.ts +++ b/src/test/battle/error-handling.test.ts @@ -2,7 +2,9 @@ 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, Moves, Abilities} from "#enums"; +import {Species} from "#app/data/enums/species"; +import {Moves} from "#app/data/enums/moves"; +import {Abilities} from "#app/data/enums/abilities"; 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 130491528f4..5a95d57afea 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -1,12 +1,14 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import {Mode} from "#app/ui/ui"; -import {Species, Moves, Abilities} from "#enums"; +import {Species} from "#app/data/enums/species"; 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 ccfdddf5498..7cfe7fda651 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 "#enums"; +import { Species } from "#app/data/enums/species.js"; import Phaser from "phaser"; describe("getLegendaryGachaSpeciesForTimestamp", () => { diff --git a/src/test/imports.test.ts b/src/test/imports.test.ts index 86893de7bff..c164813a3cd 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("#enums"); + const { Species } = await import("#app/data/enums/species"); return { PokemonMove, Species, diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index a76008aa747..7064bcd13a1 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -2,7 +2,8 @@ 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, Moves, Species} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, @@ -10,6 +11,7 @@ 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 c3c6873cd01..25b7d7d9803 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 "#enums"; +import {Species} from "#app/data/enums/species"; 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 439e47b236b..9a6e13f06a3 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -2,7 +2,8 @@ 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, Moves, Species} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, @@ -10,6 +11,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 {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 6ecc0b6145a..df1df016de5 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -2,10 +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 {Abilities, Moves, Species} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; 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 7f438cd8958..ca3f95731f2 100644 --- a/src/test/moves/tackle.test.ts +++ b/src/test/moves/tackle.test.ts @@ -2,12 +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 {Moves, Species} from "#enums"; +import {Species} from "#app/data/enums/species"; 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 b081467cdad..2d6789102d1 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -2,13 +2,15 @@ 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, Moves, Species} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; +import {Species} from "#app/data/enums/species"; 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 41c8290fb49..dee29cd42a2 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, Device} from "#enums"; +import {Button} from "#app/enums/buttons"; import {deepCopy} from "#app/utils"; import { getKeyWithKeycode, @@ -7,6 +7,7 @@ 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 7dc45c06f4a..9f323a2839c 100644 --- a/src/test/ui/starter-select.test.ts +++ b/src/test/ui/starter-select.test.ts @@ -1,6 +1,7 @@ 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, @@ -9,13 +10,14 @@ 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, Button, Species} from "#enums"; +import {Abilities} from "#app/data/enums/abilities"; describe("UI - Starter select", () => { diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index 719c6776ac4..418f8236033 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -16,13 +16,17 @@ 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, ExpNotification, GameDataType, PlayerGender, Species} from "#enums"; +import {Button} from "#app/enums/buttons"; 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 7ff5bbdf8b6..1b7bbdabaf0 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 "#enums"; +import {Species} from "#app/data/enums/species"; 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 6656d6af5a3..d5a3197f833 100644 --- a/src/touch-controls.ts +++ b/src/touch-controls.ts @@ -1,4 +1,4 @@ -import {Button} from "#enums"; +import {Button} from "./enums/buttons"; import EventEmitter = Phaser.Events.EventEmitter; import BattleScene from "./battle-scene"; diff --git a/src/ui-inputs.ts b/src/ui-inputs.ts index aea0e6647cd..21d0d0841e6 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"; +import {Button} from "./enums/buttons"; 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 a0e61c343a8..568c8208eac 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"; +import {Button} from "../enums/buttons"; export interface OptionSelectConfig { xOffset?: number; diff --git a/src/ui/achv-bar.ts b/src/ui/achv-bar.ts index 9f6dc52ad56..9e9b20795e3 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 "#enums"; +import { PlayerGender } from "#app/data/enums/player-gender"; 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 4299f8802a3..464a967cbfd 100644 --- a/src/ui/achvs-ui-handler.ts +++ b/src/ui/achvs-ui-handler.ts @@ -1,11 +1,12 @@ import BattleScene from "../battle-scene"; -import { Button, PlayerGender } from "#enums"; +import { Button } from "../enums/buttons"; 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 08d7915b63b..5793582d6c4 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/events/arena.js"; +import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/field/events/arena"; import { BattleSceneEventType, TurnEndEvent } from "../events/battle-scene"; -import { ArenaTagType } from "#enums"; +import { ArenaTagType } from "#app/data/enums/arena-tag-type.js"; 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 788384ac8d2..22a21069acb 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"; +import {Button} from "../enums/buttons"; 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 430a00422c4..b96dd799b18 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"; +import {Button} from "../enums/buttons"; 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 d6121e2d209..812969a988d 100644 --- a/src/ui/battle-flyout.ts +++ b/src/ui/battle-flyout.ts @@ -2,9 +2,11 @@ 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, Moves, UiTheme } from "#enums"; +import { BerryType } from "#app/data/enums/berry-type.js"; +import { Moves } from "#app/data/enums/moves.js"; /** 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 fd2386355b4..0f856cbb390 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"; +import {Button} from "../enums/buttons"; 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 87d6b7431c1..84d1c2f70e7 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 "#enums"; +import { Species } from "#app/data/enums/species"; 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 dc0aa30d489..092d954eae7 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"; +import {Button} from "../enums/buttons"; 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 2f8e81807a3..7c21d5cc142 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"; +import {Button} from "../enums/buttons"; export enum Command { FIGHT = 0, diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index 4ffee79dab0..4e4e0f9bb8c 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"; +import {Button} from "../enums/buttons"; 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 3949c60c76a..96874f439ff 100644 --- a/src/ui/egg-gacha-ui-handler.ts +++ b/src/ui/egg-gacha-ui-handler.ts @@ -8,7 +8,8 @@ import { VoucherType, getVoucherTypeIcon } from "../system/voucher"; import { getPokemonSpecies } from "../data/pokemon-species"; import { addWindow } from "./ui-theme"; import { Tutorial, handleTutorial } from "../tutorial"; -import {Button, EggTier} from "#enums"; +import { EggTier } from "../data/enums/egg-type"; +import {Button} from "../enums/buttons"; 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 e103cf30a6c..94affc2e751 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"; +import {Button} from "../enums/buttons"; 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 3957ebfa1f4..653789d4a20 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"; +import {Button} from "../enums/buttons"; import i18next from "../plugins/i18n"; export default class EggListUiHandler extends MessageUiHandler { diff --git a/src/enums/ease-type.ts b/src/ui/enums/ease-type.ts similarity index 100% rename from src/enums/ease-type.ts rename to src/ui/enums/ease-type.ts diff --git a/src/ui/evolution-scene-handler.ts b/src/ui/evolution-scene-handler.ts index c387a24d1ba..12b6ccc93d1 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"; +import {Button} from "../enums/buttons"; 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 0fbfc9a93cd..657c8b7e311 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"; +import {Button} from "../enums/buttons"; 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 754c2d21dd2..e55b8514642 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"; +import {Button} from "../enums/buttons"; 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 d7536108e0a..57a02257810 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"; +import {Button} from "../enums/buttons"; import i18next from "../plugins/i18n"; interface DisplayStat { diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 2b3b76164a2..a0b0c5da66b 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -4,11 +4,12 @@ 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, GameDataType} from "#enums"; +import {Button} from "../enums/buttons"; export enum MenuOptions { GAME_SETTINGS, @@ -155,7 +156,6 @@ 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 76c833f7af1..b521ec43759 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"; +import {Button} from "../enums/buttons"; export interface ModalConfig { buttonActions: Function[]; diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 87c14f7253a..9a17f6e344d 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"; +import {Button} from "../enums/buttons"; 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 7138e440635..0fc0853f234 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -8,6 +8,7 @@ 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"; @@ -15,7 +16,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, Moves} from "#enums"; +import {Button} from "../enums/buttons"; 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 7c51b154e74..e5417f83596 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"; +import { Button } from "../enums/buttons"; 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 285e6f58575..fe0736ce101 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"; +import {Button} from "../../enums/buttons"; 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 0a271ea5b63..b8165d41980 100644 --- a/src/ui/settings/abstract-control-settings-ui-handler.ts +++ b/src/ui/settings/abstract-control-settings-ui-handler.ts @@ -4,9 +4,10 @@ import {Mode} from "../ui"; import {InterfaceConfig} from "../../inputs-controller"; import {addWindow} from "../ui-theme"; import {addTextObject, TextStyle} from "../text"; -import {Button, Device} from "#enums"; +import {Button} from "../../enums/buttons"; 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 742933dfba2..87d6a611662 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"; +import {Button} from "../../enums/buttons"; 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 785f9f4fd58..1ab705d3278 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 "#enums"; +import {Device} from "#app/enums/devices"; 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 0c2c38513f0..ca490857200 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 "#enums"; +import {Device} from "#app/enums/devices"; import {addTextObject, TextStyle} from "#app/ui/text"; diff --git a/src/ui/settings/navigationMenu.ts b/src/ui/settings/navigationMenu.ts index 0523b1da625..c35e60d3ac7 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 "#enums"; +import {Button} from "#app/enums/buttons"; 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 9e4b1e90a64..20a713012ae 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 "#enums"; +import {Device} from "#app/enums/devices"; 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 15dd058d53e..59b409fe990 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 "#enums"; +import {Device} from "#app/enums/devices"; 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 bdeb542d899..58d053ac14e 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -7,6 +7,8 @@ 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"; @@ -15,9 +17,11 @@ 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"; @@ -28,7 +32,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, Moves, Species, Button, Passive as PassiveAttr} from "#enums"; +import {Device} from "#app/enums/devices"; 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 d063d9c6d26..fb788f2c9c0 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -17,8 +17,9 @@ 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, PlayerGender} from "#enums"; +import {Button} from "../enums/buttons"; 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 256acc78c8a..c69284fe64e 100644 --- a/src/ui/target-select-ui-handler.ts +++ b/src/ui/target-select-ui-handler.ts @@ -1,10 +1,11 @@ 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, Moves} from "#enums"; +import {Button} from "../enums/buttons"; export type TargetSelectCallback = (cursor: integer) => void; diff --git a/src/ui/text.ts b/src/ui/text.ts index 8c034564469..79d64c57fad 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -1,7 +1,8 @@ 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, UiTheme } from "#enums"; +import { EggTier } from "../data/enums/egg-type"; +import { UiTheme } from "../enums/ui-theme"; 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 eabd91b4608..da3503fb573 100644 --- a/src/ui/time-of-day-widget.ts +++ b/src/ui/time-of-day-widget.ts @@ -1,7 +1,8 @@ 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, TimeOfDay } from "#enums"; +import { EaseType } from "./enums/ease-type"; /** 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 f574844dc5a..e74853276ea 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"; +import {Button} from "../enums/buttons"; /** * 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 139b5f75768..3351efffa1d 100644 --- a/src/ui/ui-theme.ts +++ b/src/ui/ui-theme.ts @@ -1,4 +1,4 @@ -import { UiTheme } from "#enums"; +import { UiTheme } from "#app/enums/ui-theme"; import { legacyCompatibleImages } from "#app/scene-base"; import BattleScene from "../battle-scene"; diff --git a/src/ui/ui.ts b/src/ui/ui.ts index f576d157e2d..366be949374 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -37,8 +37,9 @@ 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, PlayerGender} from "#enums"; +import {Button} from "../enums/buttons"; 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 ebb32ea8ed0..4508a5be193 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"; +import { Button } from "../enums/buttons"; 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 e4d31d16121..6f2c9cd0c65 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ import i18next from "i18next"; -import { MoneyFormat } from "#enums"; +import { MoneyFormat } from "./enums/money-format"; export const MissingTextureKey = "__MISSING"; diff --git a/tsconfig.json b/tsconfig.json index 5ca3e257306..ec0b5e95ac2 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,8 +11,6 @@ "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 46c72cd0e6b..220747b98e3 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,4 +1,3 @@ -import { resolve } from 'path'; import { defineConfig } from 'vite'; // import fs from 'vite-plugin-fs'; @@ -9,26 +8,7 @@ export default defineConfig(({ mode }) => { clearScreen: false, build: { minify: 'esbuild', - 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') - } + sourcemap: false }, esbuild: { pure: mode === 'production' ? [ 'console.log' ] : [], diff --git a/vitest.config.js b/vitest.config.js index d68ce4d52fe..5dcb326e1ea 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,5 +1,4 @@ import { defineConfig } from 'vite'; -import path from 'path'; // import fs from 'vite-plugin-fs'; export default defineConfig(({ mode }) => { @@ -35,11 +34,6 @@ export default defineConfig(({ mode }) => { minify: 'esbuild', sourcemap: true }, - resolve: { - alias: { - "#enums": path.resolve('./src/enums') - } - }, esbuild: { pure: mode === 'production' ? [ 'console.log' ] : [], keepNames: true,