From dc30dd33b226a22d3ce32df4d8f442f53f2ed04e Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 13 Jun 2024 18:44:23 -0400 Subject: [PATCH] [QoL] Reorganize Enum Locations (#2185) * moving enums * import updates * fix tsconfig paths importing (#2184) * reverse index.ts addition --------- Co-authored-by: Devin Korb --- package-lock.json | 46 +++++++++++++++++++ package.json | 2 + public/update-source-comments.py | 2 +- src/battle-scene.ts | 22 ++++----- src/battle.ts | 10 ++-- 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 | 10 ++-- src/data/api.ts | 6 +-- src/data/arena-tag.ts | 8 ++-- src/data/battle-anims.ts | 2 +- src/data/battler-tags.ts | 8 ++-- src/data/berry.ts | 4 +- src/data/biomes.ts | 8 ++-- src/data/challenge.ts | 6 +-- src/data/daily-run.ts | 4 +- src/data/dialogue.ts | 4 +- src/data/egg-moves.ts | 4 +- src/data/egg.ts | 4 +- src/data/move.ts | 14 +++--- src/data/nature.ts | 2 +- src/data/pokemon-evolutions.ts | 8 ++-- src/data/pokemon-forms.ts | 8 ++-- src/data/pokemon-level-moves.ts | 4 +- src/data/pokemon-species.ts | 7 +-- src/data/tms.ts | 4 +- src/data/trainer-config.ts | 8 ++-- src/data/trainer-names.ts | 2 +- src/data/weather.ts | 2 +- src/egg-hatch-phase.ts | 4 +- 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/{ui => }/enums/ease-type.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 | 12 ----- src/{data => }/enums/time-of-day.ts | 0 src/{data => }/enums/trainer-type.ts | 0 src/{field => }/events/arena.ts | 2 +- src/field/arena.ts | 14 +++--- src/field/pokemon.ts | 16 +++---- src/field/trainer.ts | 6 +-- src/form-change-phase.ts | 2 +- src/game-mode.ts | 4 +- src/inputs-controller.ts | 4 +- src/loading-scene.ts | 4 +- src/messages.ts | 2 +- src/modifier/modifier-type.ts | 8 ++-- src/modifier/modifier.ts | 4 +- src/overrides.ts | 12 ++--- src/phases.ts | 22 ++++----- src/system/achv.ts | 2 +- src/system/arena-data.ts | 2 +- src/system/game-data.ts | 44 +++++++++--------- src/system/pokemon-data.ts | 6 +-- src/system/settings/settings-gamepad.ts | 2 +- src/system/settings/settings-keyboard.ts | 2 +- src/system/settings/settings.ts | 6 +-- src/system/trainer-data.ts | 2 +- src/system/voucher.ts | 4 +- src/test/abilities/battle_bond.test.ts | 6 +-- src/test/abilities/disguise.test.ts | 6 +-- src/test/abilities/intimidate.test.ts | 6 +-- src/test/abilities/intrepid_sword.test.ts | 4 +- src/test/abilities/libero.test.ts | 10 ++-- src/test/abilities/moxie.test.ts | 6 +-- src/test/abilities/power_construct.test.ts | 6 +-- src/test/abilities/protean.test.ts | 10 ++-- src/test/abilities/sap_sipper.test.ts | 8 ++-- src/test/abilities/schooling.test.ts | 6 +-- src/test/abilities/shields_down.test.ts | 6 +-- src/test/abilities/volt_absorb.test.ts | 8 ++-- src/test/abilities/zen_mode.test.ts | 6 +-- src/test/abilities/zero_to_hero.test.ts | 6 +-- src/test/battle/battle-order.test.ts | 8 ++-- src/test/battle/battle.test.ts | 8 ++-- src/test/battle/error-handling.test.ts | 6 +-- src/test/battle/special_battle.test.ts | 6 +-- src/test/eggs/egg.test.ts | 2 +- src/test/imports.test.ts | 2 +- src/test/items/toxic_orb.test.ts | 6 +-- src/test/lokalisation/french.test.ts | 2 +- src/test/moves/growth.test.ts | 6 +-- src/test/moves/spikes.test.ts | 6 +-- src/test/moves/tackle.test.ts | 4 +- src/test/moves/tail_whip.test.ts | 6 +-- .../settingMenu/rebinding_setting.test.ts | 4 +- src/test/ui/starter-select.test.ts | 6 +-- src/test/utils/gameManager.ts | 10 ++-- 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 | 4 +- 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 | 6 +-- 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 | 4 +- src/ui/egg-hatch-scene-handler.ts | 2 +- src/ui/egg-list-ui-handler.ts | 2 +- 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 | 5 +- src/ui/modal-ui-handler.ts | 2 +- src/ui/modifier-select-ui-handler.ts | 2 +- src/ui/party-ui-handler.ts | 4 +- src/ui/save-slot-select-ui-handler.ts | 2 +- .../settings/abstract-binding-ui-handler.ts | 2 +- .../abstract-control-settings-ui-handler.ts | 4 +- .../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 | 10 ++-- src/ui/summary-ui-handler.ts | 4 +- src/ui/target-select-ui-handler.ts | 4 +- src/ui/text.ts | 4 +- src/ui/time-of-day-widget.ts | 4 +- src/ui/ui-handler.ts | 2 +- src/ui/ui-theme.ts | 2 +- src/ui/ui.ts | 4 +- src/ui/vouchers-ui-handler.ts | 2 +- src/utils.ts | 2 +- tsconfig.json | 3 +- vite.config.js | 20 +++++++- vitest.config.js | 6 +++ 150 files changed, 399 insertions(+), 340 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/{ui => }/enums/ease-type.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 (99%) rename src/{data => }/enums/time-of-day.ts (100%) rename src/{data => }/enums/trainer-type.ts (100%) rename src/{field => }/events/arena.ts (98%) diff --git a/package-lock.json b/package-lock.json index 8c625694f02..7f71787cb4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,7 @@ "typescript-eslint": "^7.10.0", "vite": "^4.5.0", "vite-plugin-fs": "^0.4.4", + "vite-tsconfig-paths": "^4.3.2", "vitest": "^1.4.0", "vitest-canvas-mock": "^0.3.3" }, @@ -3393,6 +3394,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -6051,6 +6058,26 @@ "typescript": ">=4.2.0" } }, + "node_modules/tsconfck": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.0.tgz", + "integrity": "sha512-CMjc5zMnyAjcS9sPLytrbFmj89st2g+JYtY/c02ug4Q+CZaAtCgbyviI0n1YvjZE/pzoc6FbNsINS13DOL1B9w==", + "dev": true, + "bin": { + "tsconfck": "bin/tsconfck.js" + }, + "engines": { + "node": "^18 || >=20" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -6962,6 +6989,25 @@ "node": ">=14" } }, + "node_modules/vite-tsconfig-paths": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.2.tgz", + "integrity": "sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "globrex": "^0.1.2", + "tsconfck": "^3.0.3" + }, + "peerDependencies": { + "vite": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, "node_modules/vitest": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.5.2.tgz", diff --git a/package.json b/package.json index 24aa6243b75..7ee9010acda 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "typescript-eslint": "^7.10.0", "vite": "^4.5.0", "vite-plugin-fs": "^0.4.4", + "vite-tsconfig-paths": "^4.3.2", "vitest": "^1.4.0", "vitest-canvas-mock": "^0.3.3" }, @@ -53,6 +54,7 @@ "node": ">=20.0.0" }, "imports": { + "#enums/*": "./enums/*", "#app": "./src/main.js", "#app/*": "./src/*", "#test/*": "./src/test/*" diff --git a/public/update-source-comments.py b/public/update-source-comments.py index 34f0c28dd4c..410d1a42566 100644 --- a/public/update-source-comments.py +++ b/public/update-source-comments.py @@ -1,6 +1,6 @@ import re -filenames = [['src/data/enums/moves.ts', 'move'], ['src/data/enums/abilities.ts', 'ability'], ['src/data/enums/species.ts', 'Pokémon']] +filenames = [['src/enums/moves.ts', 'move'], ['src/enums/abilities.ts', 'ability'], ['src/enums/species.ts', 'Pokémon']] commentBlockStart = re.compile('\/\*[^\*].*') # Regex for the start of a comment block commentBlockEnd = re.compile('.*,\*\/') # Regex for the end of a comment block diff --git a/src/battle-scene.ts b/src/battle-scene.ts index a4ed394f862..ef4304be9da 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -9,12 +9,9 @@ import { PokeballType } from "./data/pokeball"; import { initCommonAnims, initMoveAnim, loadCommonAnimAssets, loadMoveAnimAssets, populateAnims } from "./data/battle-anims"; import { Phase } from "./phase"; import { initGameSpeed } from "./system/game-speed"; -import { Biome } from "./data/enums/biome"; import { Arena, ArenaBase } from "./field/arena"; import { GameData } from "./system/game-data"; -import { PlayerGender } from "./data/enums/player-gender"; import { TextStyle, addTextObject, getTextColor } from "./ui/text"; -import { Moves } from "./data/enums/moves"; import { allMoves } from "./data/move"; import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesForWave, getLuckString, getLuckTextTint, getModifierPoolForType, getPartyLuckValue } from "./modifier/modifier-type"; import AbilityBar from "./ui/ability-bar"; @@ -31,7 +28,6 @@ import TrainerData from "./system/trainer-data"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { pokemonPrevolutions } from "./data/pokemon-evolutions"; import PokeballTray from "./ui/pokeball-tray"; -import { Species } from "./data/enums/species"; import InvertPostFX from "./pipelines/invert"; import { Achv, ModifierAchv, MoneyAchv, achvs } from "./system/achv"; import { Voucher, vouchers } from "./system/voucher"; @@ -42,14 +38,12 @@ import PokemonData from "./system/pokemon-data"; import { Nature } from "./data/nature"; import { SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, pokemonFormChanges } from "./data/pokemon-forms"; import { FormChangePhase, QuietFormChangePhase } from "./form-change-phase"; -import { BattleSpec } from "./enums/battle-spec"; import { getTypeRgb } from "./data/type"; import PokemonSpriteSparkleHandler from "./field/pokemon-sprite-sparkle-handler"; import CharSprite from "./ui/char-sprite"; import DamageNumberHandler from "./field/damage-number-handler"; import PokemonInfoContainer from "./ui/pokemon-info-container"; import { biomeDepths, getBiomeName } from "./data/biomes"; -import { UiTheme } from "./enums/ui-theme"; import { SceneBase } from "./scene-base"; import CandyBar from "./ui/candy-bar"; import { Variant, variantData } from "./data/variant"; @@ -57,13 +51,19 @@ import { Localizable } from "./plugins/i18n"; import * as Overrides from "./overrides"; import {InputsController} from "./inputs-controller"; import {UiInputs} from "./ui-inputs"; -import { MoneyFormat } from "./enums/money-format"; import { NewArenaEvent } from "./events/battle-scene"; -import { Abilities } from "./data/enums/abilities"; import ArenaFlyout from "./ui/arena-flyout"; -import { EaseType } from "./ui/enums/ease-type"; -import { ExpNotification } from "./enums/exp-notification"; -import { BattleStyle } from "./enums/battle-style"; +import { EaseType } from "#enums/ease-type"; +import { Abilities } from "#enums/abilities"; +import { BattleSpec } from "#enums/battle-spec"; +import { BattleStyle } from "#enums/battle-style"; +import { Biome } from "#enums/biome"; +import { ExpNotification } from "#enums/exp-notification"; +import { MoneyFormat } from "#enums/money-format"; +import { Moves } from "#enums/moves"; +import { PlayerGender } from "#enums/player-gender"; +import { Species } from "#enums/species"; +import { UiTheme } from "#enums/ui-theme"; export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1"; diff --git a/src/battle.ts b/src/battle.ts index 68e16cb28bb..97fd8dd064c 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -3,15 +3,15 @@ import { EnemyPokemon, PlayerPokemon, QueuedMove } from "./field/pokemon"; import { Command } from "./ui/command-ui-handler"; import * as Utils from "./utils"; import Trainer, { TrainerVariant } from "./field/trainer"; -import { Species } from "./data/enums/species"; -import { Moves } from "./data/enums/moves"; -import { TrainerType } from "./data/enums/trainer-type"; import { GameMode } from "./game-mode"; -import { BattleSpec } from "./enums/battle-spec"; -import { PlayerGender } from "./data/enums/player-gender"; import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier"; import { PokeballType } from "./data/pokeball"; import {trainerConfigs} from "#app/data/trainer-config"; +import { BattleSpec } from "#enums/battle-spec"; +import { Moves } from "#enums/moves"; +import { PlayerGender } from "#enums/player-gender"; +import { Species } from "#enums/species"; +import { TrainerType } from "#enums/trainer-type"; export enum BattleType { WILD, diff --git a/src/configs/inputs/cfg_keyboard_qwerty.ts b/src/configs/inputs/cfg_keyboard_qwerty.ts index 83472529697..09a02f02836 100644 --- a/src/configs/inputs/cfg_keyboard_qwerty.ts +++ b/src/configs/inputs/cfg_keyboard_qwerty.ts @@ -1,4 +1,4 @@ -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums/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 0770ebffce1..a67c45fd413 100644 --- a/src/configs/inputs/configHandler.ts +++ b/src/configs/inputs/configHandler.ts @@ -1,4 +1,4 @@ -import {Device} from "#app/enums/devices"; +import {Device} from "#enums/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 d58a8b2879d..742040958b4 100644 --- a/src/configs/inputs/pad_dualshock.ts +++ b/src/configs/inputs/pad_dualshock.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums/buttons"; /** * Dualshock mapping diff --git a/src/configs/inputs/pad_generic.ts b/src/configs/inputs/pad_generic.ts index 916f8c82add..88ff66e231c 100644 --- a/src/configs/inputs/pad_generic.ts +++ b/src/configs/inputs/pad_generic.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums/buttons"; /** * Generic pad mapping diff --git a/src/configs/inputs/pad_procon.ts b/src/configs/inputs/pad_procon.ts index 4b7bd8457b0..8cb707f882a 100644 --- a/src/configs/inputs/pad_procon.ts +++ b/src/configs/inputs/pad_procon.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "#app/system/settings/settings-gamepad.js"; -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums/buttons"; /** * Nintendo Pro Controller mapping diff --git a/src/configs/inputs/pad_unlicensedSNES.ts b/src/configs/inputs/pad_unlicensedSNES.ts index 106fbc9eb8f..8a7f3e78f98 100644 --- a/src/configs/inputs/pad_unlicensedSNES.ts +++ b/src/configs/inputs/pad_unlicensedSNES.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums/buttons"; /** * 081f-e401 - UnlicensedSNES diff --git a/src/configs/inputs/pad_xbox360.ts b/src/configs/inputs/pad_xbox360.ts index 645829d5be2..e003ccc8e87 100644 --- a/src/configs/inputs/pad_xbox360.ts +++ b/src/configs/inputs/pad_xbox360.ts @@ -1,5 +1,5 @@ import {SettingGamepad} from "../../system/settings/settings-gamepad"; -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums/buttons"; /** * Generic pad mapping diff --git a/src/data/ability.ts b/src/data/ability.ts index 0365e740672..f0c6443eca6 100755 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -6,24 +6,24 @@ import { MovePhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from " import { getPokemonMessage, getPokemonNameWithAffix } from "../messages"; import { Weather, WeatherType } from "./weather"; import { BattlerTag } from "./battler-tags"; -import { BattlerTagType } from "./enums/battler-tag-type"; import { 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"; +import { Abilities } from "#enums/abilities"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; export class Ability implements Localizable { public id: Abilities; diff --git a/src/data/api.ts b/src/data/api.ts index 2a88fc8d410..f4a72a24c76 100644 --- a/src/data/api.ts +++ b/src/data/api.ts @@ -6,11 +6,11 @@ import PokemonSpecies, { PokemonForm, SpeciesFormKey, allSpecies } from "./pokem import { GrowthRate } from "./exp"; import { Type } from "./type"; import { allAbilities } from "./ability"; -import { Abilities } from "./enums/abilities"; -import { Species } from "./enums/species"; import { pokemonFormLevelMoves } from "./pokemon-level-moves"; import { tmSpecies } from "./tms"; -import { Moves } from "./enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; const targetMap = { "specific-move": MoveTarget.ATTACKER, diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 37420c2ac0b..b1c1b46487c 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -7,14 +7,14 @@ import Pokemon, { HitResult, PokemonMove } from "../field/pokemon"; import { MoveEffectPhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase} from "../phases"; import { StatusEffect } from "./status-effect"; import { BattlerIndex } from "../battle"; -import { Moves } from "./enums/moves"; -import { ArenaTagType } from "./enums/arena-tag-type"; import { 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"; +import { Abilities } from "#enums/abilities"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Moves } from "#enums/moves"; export enum ArenaTagSide { BOTH, diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 75c883ec1e7..d4dbb8ec350 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -5,7 +5,7 @@ import Pokemon from "../field/pokemon"; import * as Utils from "../utils"; import { BattlerIndex } from "../battle"; import { Element } from "json-stable-stringify"; -import { Moves } from "./enums/moves"; +import { Moves } from "#enums/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 bfdeb2189dc..977dceb8d30 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -5,18 +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 } 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"; +import { Abilities } from "#enums/abilities"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; export enum BattlerTagLapseType { FAINT, diff --git a/src/data/berry.ts b/src/data/berry.ts index 38f8f924c8a..5b4f55c8e13 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -2,12 +2,12 @@ import { PokemonHealPhase, StatChangePhase } from "../phases"; import { getPokemonMessage } from "../messages"; import Pokemon, { HitResult } from "../field/pokemon"; import { BattleStat } from "./battle-stat"; -import { BattlerTagType } from "./enums/battler-tag-type"; import { 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"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; export function getBerryName(berryType: BerryType): string { return i18next.t(`berry:${BerryType[berryType]}.name`); diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 43cafb46fce..166b1fd40c3 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -1,12 +1,12 @@ -import { Species } from "./enums/species"; import { Type } from "./type"; import * as Utils from "../utils"; import beautify from "json-beautify"; -import { TrainerType } from "./enums/trainer-type"; -import { TimeOfDay } from "./enums/time-of-day"; -import { Biome } from "./enums/biome"; import {pokemonEvolutions, SpeciesFormEvolution} from "./pokemon-evolutions"; import i18next from "i18next"; +import { Biome } from "#enums/biome"; +import { Species } from "#enums/species"; +import { TimeOfDay } from "#enums/time-of-day"; +import { TrainerType } from "#enums/trainer-type"; export function getBiomeName(biome: Biome | -1) { if (biome === -1) { diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 916f59ab2c2..8b41e8c8d9d 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -1,15 +1,15 @@ import * as Utils from "../utils"; -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"; +import { Challenges } from "#enums/challenges"; +import { Species } from "#enums/species"; +import { TrainerType } from "#enums/trainer-type"; /** * An enum for all the challenge types. The parameter entries on these describe the diff --git a/src/data/daily-run.ts b/src/data/daily-run.ts index c9b097bfcc0..4b741b6f473 100644 --- a/src/data/daily-run.ts +++ b/src/data/daily-run.ts @@ -1,10 +1,10 @@ +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { Species } from "#enums/species"; import BattleScene from "../battle-scene"; import { PlayerPokemon } from "../field/pokemon"; import { Starter } from "../ui/starter-select-ui-handler"; import * as Utils from "../utils"; -import { Species } from "./enums/species"; import PokemonSpecies, { PokemonSpeciesForm, getPokemonSpecies, getPokemonSpeciesForm, speciesStarters } from "./pokemon-species"; -import { PartyMemberStrength } from "./enums/party-member-strength"; export interface DailyRunConfig { seed: integer; diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts index 5b5e0d865ba..ae6aa72b52c 100644 --- a/src/data/dialogue.ts +++ b/src/data/dialogue.ts @@ -1,6 +1,6 @@ +import { BattleSpec } from "#enums/battle-spec"; +import { TrainerType } from "#enums/trainer-type"; import {trainerConfigs} from "./trainer-config"; -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 bed989849d9..6204b9e1df7 100644 --- a/src/data/egg-moves.ts +++ b/src/data/egg-moves.ts @@ -1,7 +1,7 @@ -import { Moves } from "./enums/moves"; -import { Species } from "./enums/species"; import { allMoves } from "./move"; import * as Utils from "../utils"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; export const speciesEggMoves = { diff --git a/src/data/egg.ts b/src/data/egg.ts index 63db27311cb..1c3c0e78798 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -1,8 +1,8 @@ import BattleScene from "../battle-scene"; -import { Species } from "./enums/species"; import PokemonSpecies, { getPokemonSpecies, speciesStarters } from "./pokemon-species"; -import { EggTier } from "./enums/egg-type"; import i18next from "../plugins/i18n"; +import { EggTier } from "#enums/egg-type"; +import { Species } from "#enums/species"; export const EGG_SEED = 1073741824; diff --git a/src/data/move.ts b/src/data/move.ts index 6dc23925187..b7bfd9343f2 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1,9 +1,7 @@ -import { Moves } from "./enums/moves"; import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims"; import { BattleEndPhase, MovePhase, NewBattlePhase, PartyStatusCurePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases"; import { BattleStat, getBattleStatName } from "./battle-stat"; import { EncoreTag } from "./battler-tags"; -import { BattlerTagType } from "./enums/battler-tag-type"; import { getPokemonMessage } from "../messages"; import Pokemon, { AttackMoveResult, EnemyPokemon, HitResult, MoveResult, PlayerPokemon, PokemonMove, TurnMove } from "../field/pokemon"; import { StatusEffect, getStatusEffectHealText, isNonVolatileStatusEffect, getNonVolatileStatusEffects} from "./status-effect"; @@ -11,21 +9,23 @@ import { Type } from "./type"; import * as Utils from "../utils"; import { WeatherType } from "./weather"; import { ArenaTagSide, ArenaTrapTag } from "./arena-tag"; -import { ArenaTagType } from "./enums/arena-tag-type"; import { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, BlockRecoilDamageAttr, BlockOneHitKOAbAttr, IgnoreContactAbAttr, MaxMultiHitAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr, applyPostDefendAbAttrs, PostDefendContactApplyStatusEffectAbAttr, MoveAbilityBypassAbAttr, ReverseDrainAbAttr, FieldPreventExplosiveMovesAbAttr, ForceSwitchOutImmunityAbAttr, BlockItemTheftAbAttr, applyPostAttackAbAttrs, ConfusionOnStatusEffectAbAttr, HealFromBerryUseAbAttr } from "./ability"; -import { Abilities } from "./enums/abilities"; import { 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"; +import { Abilities } from "#enums/abilities"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Biome } from "#enums/biome"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; export enum MoveCategory { PHYSICAL, @@ -1833,7 +1833,7 @@ export class RemoveHeldItemAttr extends MoveEffectAttr { } /** - * Attribute that causes targets of the move to eat a berry. If chosenBerry is not overriden, a random berry will be picked from the target's inventory. + * Attribute that causes targets of the move to eat a berry. If chosenBerry is not overridden, a random berry will be picked from the target's inventory. */ export class EatBerryAttr extends MoveEffectAttr { protected chosenBerry: BerryModifier; diff --git a/src/data/nature.ts b/src/data/nature.ts index c9709d5ee4c..0d9be0f663d 100644 --- a/src/data/nature.ts +++ b/src/data/nature.ts @@ -1,7 +1,7 @@ import { Stat, getStatName } from "./pokemon-stat"; import * as Utils from "../utils"; import { TextStyle, getBBCodeFrag } from "../ui/text"; -import { UiTheme } from "#app/enums/ui-theme"; +import { UiTheme } from "#enums/ui-theme"; import i18next from "i18next"; export enum Nature { diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index 9cfcad41c08..1fb1f7db5fd 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -1,16 +1,16 @@ import { Gender } from "./gender"; -import { Moves } from "./enums/moves"; import { PokeballType } from "./pokeball"; import Pokemon from "../field/pokemon"; import { Stat } from "./pokemon-stat"; -import { Species } from "./enums/species"; import { Type } from "./type"; import * as Utils from "../utils"; import { SpeciesFormKey } from "./pokemon-species"; import { WeatherType } from "./weather"; -import { Biome } from "./enums/biome"; -import { TimeOfDay } from "./enums/time-of-day"; import { Nature } from "./nature"; +import { Biome } from "#enums/biome"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { TimeOfDay } from "#enums/time-of-day"; export enum SpeciesWildEvolutionDelay { NONE, diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 998752f4d34..cc05af50f6f 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -1,12 +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 } from "./enums/abilities"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { TimeOfDay } from "#enums/time-of-day"; export enum FormChangeItem { NONE, diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index 89ae23f1ac2..5f01b4db02f 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -1,5 +1,5 @@ -import { Moves } from "./enums/moves"; -import { Species } from "./enums/species"; +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 08dd59b6c01..6bb0f8db7c5 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -1,22 +1,23 @@ -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"; import i18next, { Localizable } from "../plugins/i18n"; import { Stat } from "./pokemon-stat"; +import { Abilities } from "#enums/abilities"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { Species } from "#enums/species"; export enum Region { NORMAL, diff --git a/src/data/tms.ts b/src/data/tms.ts index dfde4ef948e..605419e4685 100644 --- a/src/data/tms.ts +++ b/src/data/tms.ts @@ -1,6 +1,6 @@ import { ModifierTier } from "../modifier/modifier-tier"; -import { Moves } from "./enums/moves"; -import { Species } from "./enums/species"; +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 43ce8c8444a..2479f1a189f 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -2,20 +2,20 @@ import BattleScene, {startingWave} from "../battle-scene"; import {ModifierTypeFunc, modifierTypes} from "../modifier/modifier-type"; import {EnemyPokemon} from "../field/pokemon"; import * as Utils from "../utils"; -import {TrainerType} from "./enums/trainer-type"; -import {Moves} from "./enums/moves"; import {PokeballType} from "./pokeball"; import {pokemonEvolutions, pokemonPrevolutions} from "./pokemon-evolutions"; import PokemonSpecies, {getPokemonSpecies, PokemonSpeciesFilter} from "./pokemon-species"; -import {Species} from "./enums/species"; import {tmSpecies} from "./tms"; import {Type} from "./type"; import {doubleBattleDialogue} from "./dialogue"; import {PersistentModifier} from "../modifier/modifier"; import {TrainerVariant} from "../field/trainer"; -import {PartyMemberStrength} from "./enums/party-member-strength"; import {getIsInitialized, initI18n} from "#app/plugins/i18n"; import i18next from "i18next"; +import { Moves } from "#enums/moves"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { Species } from "#enums/species"; +import { TrainerType } from "#enums/trainer-type"; export enum TrainerPoolTier { COMMON, diff --git a/src/data/trainer-names.ts b/src/data/trainer-names.ts index 5cd6850fba0..b986378ee47 100644 --- a/src/data/trainer-names.ts +++ b/src/data/trainer-names.ts @@ -1,4 +1,4 @@ -import { TrainerType } from "./enums/trainer-type"; +import { TrainerType } from "#enums/trainer-type"; import * as Utils from "../utils"; class TrainerNameConfig { diff --git a/src/data/weather.ts b/src/data/weather.ts index 1df94b02da1..425dd3724f6 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -1,4 +1,4 @@ -import { Biome } from "./enums/biome"; +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 b86e7a9f2ca..3fce35e4f88 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -5,15 +5,15 @@ import * as Utils from "./utils"; import { Mode } from "./ui/ui"; import { EGG_SEED, Egg, GachaType, getLegendaryGachaSpeciesForTimestamp } from "./data/egg"; import EggHatchSceneHandler from "./ui/egg-hatch-scene-handler"; -import { Species } from "./data/enums/species"; import { PlayerPokemon } from "./field/pokemon"; import { getPokemonSpecies, speciesStarters } from "./data/pokemon-species"; import { achvs } from "./system/achv"; import { pokemonPrevolutions } from "./data/pokemon-evolutions"; -import { EggTier } from "./data/enums/egg-type"; import PokemonInfoContainer from "./ui/pokemon-info-container"; import EggCounterContainer from "./ui/egg-counter-container"; import { EggCountChangedEvent } from "./events/egg"; +import { EggTier } from "#enums/egg-type"; +import { Species } from "#enums/species"; /** * Class that represents egg hatching diff --git a/src/data/enums/abilities.ts b/src/enums/abilities.ts similarity index 100% rename from src/data/enums/abilities.ts rename to src/enums/abilities.ts diff --git a/src/data/enums/arena-tag-type.ts b/src/enums/arena-tag-type.ts similarity index 100% rename from src/data/enums/arena-tag-type.ts rename to src/enums/arena-tag-type.ts diff --git a/src/data/enums/battler-tag-type.ts b/src/enums/battler-tag-type.ts similarity index 100% rename from src/data/enums/battler-tag-type.ts rename to src/enums/battler-tag-type.ts diff --git a/src/data/enums/berry-type.ts b/src/enums/berry-type.ts similarity index 100% rename from src/data/enums/berry-type.ts rename to src/enums/berry-type.ts diff --git a/src/data/enums/biome.ts b/src/enums/biome.ts similarity index 100% rename from src/data/enums/biome.ts rename to src/enums/biome.ts diff --git a/src/data/enums/challenges.ts b/src/enums/challenges.ts similarity index 100% rename from src/data/enums/challenges.ts rename to src/enums/challenges.ts diff --git a/src/ui/enums/ease-type.ts b/src/enums/ease-type.ts similarity index 100% rename from src/ui/enums/ease-type.ts rename to src/enums/ease-type.ts diff --git a/src/data/enums/egg-type.ts b/src/enums/egg-type.ts similarity index 100% rename from src/data/enums/egg-type.ts rename to src/enums/egg-type.ts diff --git a/src/data/enums/game-data-type.ts b/src/enums/game-data-type.ts similarity index 100% rename from src/data/enums/game-data-type.ts rename to src/enums/game-data-type.ts diff --git a/src/data/enums/moves.ts b/src/enums/moves.ts similarity index 100% rename from src/data/enums/moves.ts rename to src/enums/moves.ts diff --git a/src/data/enums/party-member-strength.ts b/src/enums/party-member-strength.ts similarity index 100% rename from src/data/enums/party-member-strength.ts rename to src/enums/party-member-strength.ts diff --git a/src/data/enums/passive.ts b/src/enums/passive.ts similarity index 100% rename from src/data/enums/passive.ts rename to src/enums/passive.ts diff --git a/src/data/enums/player-gender.ts b/src/enums/player-gender.ts similarity index 100% rename from src/data/enums/player-gender.ts rename to src/enums/player-gender.ts diff --git a/src/data/enums/species.ts b/src/enums/species.ts similarity index 99% rename from src/data/enums/species.ts rename to src/enums/species.ts index 0299ee0ce5b..3d410deec1a 100644 --- a/src/data/enums/species.ts +++ b/src/enums/species.ts @@ -2164,15 +2164,3 @@ export enum Species { /**{@link https://bulbapedia.bulbagarden.net/wiki/Ursaluna_(Pokémon) | Source} */ BLOODMOON_URSALUNA = 8901, } - -export const defaultStarterSpecies: Species[] = [ - Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, - Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE, - Species.TREECKO, Species.TORCHIC, Species.MUDKIP, - Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP, - Species.SNIVY, Species.TEPIG, Species.OSHAWOTT, - Species.CHESPIN, Species.FENNEKIN, Species.FROAKIE, - Species.ROWLET, Species.LITTEN, Species.POPPLIO, - Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE, - Species.SPRIGATITO, Species.FUECOCO, Species.QUAXLY -]; diff --git a/src/data/enums/time-of-day.ts b/src/enums/time-of-day.ts similarity index 100% rename from src/data/enums/time-of-day.ts rename to src/enums/time-of-day.ts diff --git a/src/data/enums/trainer-type.ts b/src/enums/trainer-type.ts similarity index 100% rename from src/data/enums/trainer-type.ts rename to src/enums/trainer-type.ts diff --git a/src/field/events/arena.ts b/src/events/arena.ts similarity index 98% rename from src/field/events/arena.ts rename to src/events/arena.ts index b3d03fdfcae..657acaeae7e 100644 --- a/src/field/events/arena.ts +++ b/src/events/arena.ts @@ -1,5 +1,5 @@ import { ArenaTagSide } from "#app/data/arena-tag.js"; -import { ArenaTagType } from "#app/data/enums/arena-tag-type.js"; +import { ArenaTagType } from "#enums/arena-tag-type"; import { TerrainType } from "#app/data/terrain.js"; import { WeatherType } from "#app/data/weather.js"; diff --git a/src/field/arena.ts b/src/field/arena.ts index 7885668b577..14280536a5f 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -1,25 +1,25 @@ import BattleScene from "../battle-scene"; import { BiomePoolTier, PokemonPools, BiomeTierTrainerPools, biomePokemonPools, biomeTrainerPools } from "../data/biomes"; -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"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { Biome } from "#enums/biome"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { TimeOfDay } from "#enums/time-of-day"; +import { TrainerType } from "#enums/trainer-type"; export class Arena { public scene: BattleScene; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2da0cc8d15f..53db7ac262e 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3,7 +3,6 @@ import BattleScene, { AnySound } from "../battle-scene"; import { Variant, VariantSet, variantColorCache } from "#app/data/variant"; import { variantData } from "#app/data/variant"; import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from "../ui/battle-info"; -import { Moves } from "../data/enums/moves"; import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, VariableMoveTypeAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr, BypassBurnDamageReductionAttr, SacrificialAttrOnHit, MoveFlags } from "../data/move"; import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from "../data/pokemon-species"; import * as Utils from "../utils"; @@ -20,18 +19,12 @@ import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase, ToggleDoublePositionPhase } from "../phases"; import { BattleStat } from "../data/battle-stat"; import { BattlerTag, BattlerTagLapseType, EncoreTag, HelpingHandTag, HighestStatBoostTag, TypeBoostTag, getBattlerTag } from "../data/battler-tags"; -import { BattlerTagType } from "../data/enums/battler-tag-type"; -import { Species } from "../data/enums/species"; import { WeatherType } from "../data/weather"; import { TempBattleStat } from "../data/temp-battle-stat"; import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from "../data/arena-tag"; -import { ArenaTagType } from "../data/enums/arena-tag-type"; -import { Biome } from "../data/enums/biome"; import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldBattleStatMultiplierAbAttrs, FieldMultiplyBattleStatAbAttr } from "../data/ability"; -import { Abilities } from "#app/data/enums/abilities"; import PokemonData from "../system/pokemon-data"; import { BattlerIndex } from "../battle"; -import { BattleSpec } from "../enums/battle-spec"; import { Mode } from "../ui/ui"; import PartyUiHandler, { PartyOption, PartyUiMode } from "../ui/party-ui-handler"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; @@ -44,11 +37,18 @@ 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"; import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; +import { Abilities } from "#enums/abilities"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattleSpec } from "#enums/battle-spec"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; +import { Biome } from "#enums/biome"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; export enum FieldPosition { CENTER, diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 1646866189b..a582ab4b096 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -11,8 +11,6 @@ import { trainerPartyTemplates, signatureSpecies } from "../data/trainer-config"; -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"; @@ -20,7 +18,9 @@ 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"; +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { Species } from "#enums/species"; +import { TrainerType } from "#enums/trainer-type"; export enum TrainerVariant { DEFAULT, diff --git a/src/form-change-phase.ts b/src/form-change-phase.ts index a8957bfc8b6..f2cf9933b17 100644 --- a/src/form-change-phase.ts +++ b/src/form-change-phase.ts @@ -7,7 +7,7 @@ import { EndEvolutionPhase, EvolutionPhase } from "./evolution-phase"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "./field/pokemon"; import { Mode } from "./ui/ui"; import PartyUiHandler from "./ui/party-ui-handler"; -import { BattleSpec } from "./enums/battle-spec"; +import { BattleSpec } from "#enums/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 cb042b2757c..0a472e223e3 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -2,12 +2,12 @@ import i18next from "i18next"; import { classicFixedBattles, FixedBattleConfig, FixedBattleConfigs } from "./battle"; import BattleScene from "./battle-scene"; import { allChallenges, applyChallenges, Challenge, ChallengeType, copyChallenge } from "./data/challenge"; -import { Biome } from "./data/enums/biome"; -import { Species } from "./data/enums/species"; import PokemonSpecies, { allSpecies } from "./data/pokemon-species"; import { Arena } from "./field/arena"; import * as Overrides from "./overrides"; import * as Utils from "./utils"; +import { Biome } from "#enums/biome"; +import { Species } from "#enums/species"; export enum GameModes { CLASSIC, diff --git a/src/inputs-controller.ts b/src/inputs-controller.ts index 1f10197903c..834ca233942 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -6,12 +6,10 @@ import pad_unlicensedSNES from "./configs/inputs/pad_unlicensedSNES"; import pad_xbox360 from "./configs/inputs/pad_xbox360"; import pad_dualshock from "./configs/inputs/pad_dualshock"; import pad_procon from "./configs/inputs/pad_procon"; -import {Button} from "./enums/buttons"; import {Mode} from "./ui/ui"; import SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler"; import SettingsKeyboardUiHandler from "./ui/settings/settings-keyboard-ui-handler"; import cfg_keyboard_qwerty from "./configs/inputs/cfg_keyboard_qwerty"; -import {Device} from "#app/enums/devices"; import { assign, getButtonWithKeycode, @@ -21,6 +19,8 @@ import BattleScene from "./battle-scene"; import {SettingGamepad} from "#app/system/settings/settings-gamepad.js"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; import TouchControl from "#app/touch-controls"; +import { Button } from "#enums/buttons"; +import { Device } from "#enums/devices"; export interface DeviceMapping { [key: string]: number; diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 7a097cc8b37..cb1eae4c6d9 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -1,6 +1,4 @@ import { GachaType } from "./data/egg"; -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"; @@ -22,6 +20,8 @@ import { initChallenges } from "./data/challenge"; import i18next from "i18next"; import { initStatsKeys } from "./ui/game-stats-ui-handler"; import { initVouchers } from "./system/voucher"; +import { Biome } from "#enums/biome"; +import { TrainerType } from "#enums/trainer-type"; export class LoadingScene extends SceneBase { constructor() { diff --git a/src/messages.ts b/src/messages.ts index e2387094502..b9fbf7f7183 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,4 +1,4 @@ -import { BattleSpec } from "./enums/battle-spec"; +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 03059915b54..ac7452ae4c9 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1,7 +1,5 @@ import * as Modifiers from "./modifier"; import { AttackMove, allMoves } from "../data/move"; -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"; @@ -12,7 +10,6 @@ import PartyUiHandler, { PokemonMoveSelectFilter, PokemonSelectFilter } from ".. import * as Utils from "../utils"; import { TempBattleStat, getTempBattleStatBoosterItemName, getTempBattleStatName } from "../data/temp-battle-stat"; import { getBerryEffectDescription, getBerryName } from "../data/berry"; -import { BerryType } from "../data/enums/berry-type"; import { Unlockables } from "../system/unlockables"; import { StatusEffect, getStatusEffectDescriptor } from "../data/status-effect"; import { SpeciesFormKey } from "../data/pokemon-species"; @@ -23,9 +20,12 @@ 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"; +import { Abilities } from "#enums/abilities"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { BerryType } from "#enums/berry-type"; +import { Moves } from "#enums/moves"; const outputModifierData = false; const useMaxWeightForOutput = false; diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 85746e30bb6..5ea983fb598 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -13,13 +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 { BerryType } from "../data/enums/berry-type"; +import { BattlerTagType} from "#enums/battler-tag-type"; +import { BerryType } from "#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 df95104387b..6ae3af64299 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -1,21 +1,21 @@ -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"; import { allSpecies } from "./data/pokemon-species"; // eslint-disable-line @typescript-eslint/no-unused-vars +import { Abilities } from "#enums/abilities"; +import { BerryType } from "#enums/berry-type"; +import { Biome } from "#enums/biome"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import { TimeOfDay } from "#enums/time-of-day"; /** * Overrides for testing different in game situations diff --git a/src/phases.ts b/src/phases.ts index dabbbb4c4eb..e976b133fea 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1,7 +1,6 @@ import BattleScene, { bypassLogin } from "./battle-scene"; import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon"; import * as Utils from "./utils"; -import { Moves } from "./data/enums/moves"; import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, BypassRedirectAttr, FixedDamageAttr, PostVictoryStatChangeAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr, IncrementMovePriorityAttr } from "./data/move"; import { Mode } from "./ui/ui"; import { Command } from "./ui/command-ui-handler"; @@ -17,34 +16,27 @@ import { EvolutionPhase } from "./evolution-phase"; import { Phase } from "./phase"; import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "./data/battle-stat"; import { biomeLinks, getBiomeName } from "./data/biomes"; -import { Biome } from "./data/enums/biome"; import { ModifierTier } from "./modifier/modifier-tier"; import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, RememberMoveModifierType, TmModifierType, getDailyRunStarterModifiers, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptions, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import { BattlerTagLapseType, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; -import { BattlerTagType } from "./data/enums/battler-tag-type"; import { getPokemonMessage, getPokemonNameWithAffix } from "./messages"; import { Starter } from "./ui/starter-select-ui-handler"; import { Gender } from "./data/gender"; import { Weather, WeatherType, getRandomWeatherType, getTerrainBlockMessage, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather"; import { TempBattleStat } from "./data/temp-battle-stat"; import { ArenaTagSide, ArenaTrapTag, MistTag, TrickRoomTag } from "./data/arena-tag"; -import { ArenaTagType } from "./data/enums/arena-tag-type"; import { CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, IgnoreOpponentEvasionAbAttr, PostAttackAbAttr, PostBattleAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreSwitchOutAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, RedirectMoveAbAttr, BlockRedirectAbAttr, RunSuccessAbAttr, StatChangeMultiplierAbAttr, SuppressWeatherEffectAbAttr, SyncEncounterNatureAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostAttackAbAttrs, applyPostBattleAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreSwitchOutAbAttrs, applyPreWeatherEffectAbAttrs, BattleStatMultiplierAbAttr, applyBattleStatMultiplierAbAttrs, IncrementMovePriorityAbAttr, applyPostVictoryAbAttrs, PostVictoryAbAttr, BlockNonDirectDamageAbAttr as BlockNonDirectDamageAbAttr, applyPostKnockOutAbAttrs, PostKnockOutAbAttr, PostBiomeChangeAbAttr, applyPostFaintAbAttrs, PostFaintAbAttr, IncreasePpAbAttr, PostStatChangeAbAttr, applyPostStatChangeAbAttrs, AlwaysHitAbAttr, PreventBerryUseAbAttr, StatChangeCopyAbAttr, PokemonTypeChangeAbAttr, applyPreAttackAbAttrs, applyPostMoveUsedAbAttrs, PostMoveUsedAbAttr, MaxMultiHitAbAttr, HealFromBerryUseAbAttr } from "./data/ability"; import { Unlockables, getUnlockableName } from "./system/unlockables"; import { getBiomeKey } from "./field/arena"; import { BattleType, BattlerIndex, TurnCommand } from "./battle"; -import { BattleSpec } from "./enums/battle-spec"; -import { Species } from "./data/enums/species"; import { ChallengeAchv, HealAchv, LevelAchv, achvs } from "./system/achv"; import { TrainerSlot, trainerConfigs } from "./data/trainer-config"; -import { TrainerType } from "./data/enums/trainer-type"; import { EggHatchPhase } from "./egg-hatch-phase"; import { Egg } from "./data/egg"; import { vouchers } from "./system/voucher"; import { loggedInUser, updateUserInfo } from "./account"; import { SessionSaveData } from "./system/game-data"; -import { PlayerGender } from "./data/enums/player-gender"; import { addPokeballCaptureStars, addPokeballOpenParticles } from "./field/anims"; import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeManualTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangePreMoveTrigger } from "./data/pokemon-forms"; import { battleSpecDialogue, getCharVariantFromDialogue, miscDialogue } from "./data/dialogue"; @@ -58,13 +50,21 @@ 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"; +import { Abilities } from "#enums/abilities"; +import { ArenaTagType } from "#enums/arena-tag-type"; +import { BattleSpec } from "#enums/battle-spec"; +import { BattleStyle } from "#enums/battle-style"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Biome } from "#enums/biome"; +import { ExpNotification } from "#enums/exp-notification"; +import { Moves } from "#enums/moves"; +import { PlayerGender } from "#enums/player-gender"; +import { Species } from "#enums/species"; +import { TrainerType } from "#enums/trainer-type"; export class LoginPhase extends Phase { diff --git a/src/system/achv.ts b/src/system/achv.ts index f44ea2a9301..21393862d92 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -3,7 +3,7 @@ import BattleScene from "../battle-scene"; import { TurnHeldItemTransferModifier } from "../modifier/modifier"; import i18next from "../plugins/i18n"; import * as Utils from "../utils"; -import { PlayerGender } from "#app/data/enums/player-gender"; +import { PlayerGender } from "#enums/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 6eec27c32d3..f6db53d7f7f 100644 --- a/src/system/arena-data.ts +++ b/src/system/arena-data.ts @@ -1,6 +1,6 @@ import { Arena } from "../field/arena"; import { ArenaTag } from "../data/arena-tag"; -import { Biome } from "../data/enums/biome"; +import { Biome } from "#enums/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 1be5cab8d97..119842cb621 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -2,7 +2,6 @@ import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon"; import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions"; import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species"; -import { Species, defaultStarterSpecies } from "../data/enums/species"; import * as Utils from "../utils"; import * as Overrides from "../overrides"; import PokemonData from "./pokemon-data"; @@ -24,7 +23,6 @@ import { clientSessionId, loggedInUser, updateUserInfo } from "../account"; import { Nature } from "../data/nature"; import { GameStats } from "./game-stats"; import { Tutorial } from "../tutorial"; -import { Moves } from "../data/enums/moves"; import { speciesEggMoves } from "../data/egg-moves"; import { allMoves } from "../data/move"; import { TrainerVariant } from "../field/trainer"; @@ -32,13 +30,27 @@ import { OutdatedPhase, ReloadSessionPhase } from "#app/phases"; import { Variant, variantData } from "#app/data/variant"; import {setSettingGamepad, SettingGamepad, settingGamepadDefaults} from "./settings/settings-gamepad"; import {setSettingKeyboard, SettingKeyboard} from "#app/system/settings/settings-keyboard"; -import { TerrainChangedEvent, WeatherChangedEvent } from "#app/field/events/arena"; -import { Device } from "#app/enums/devices.js"; +import { TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; import { EnemyAttackStatusEffectChanceModifier } from "../modifier/modifier"; import { StatusEffect } from "#app/data/status-effect.js"; -import { PlayerGender } from "#app/data/enums/player-gender"; -import { GameDataType } from "#app/data/enums/game-data-type"; import ChallengeData from "./challenge-data"; +import { Device } from "#enums/devices"; +import { GameDataType } from "#enums/game-data-type"; +import { Moves } from "#enums/moves"; +import { PlayerGender } from "#enums/player-gender"; +import { Species } from "#enums/species"; + +export const defaultStarterSpecies: Species[] = [ + Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, + Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE, + Species.TREECKO, Species.TORCHIC, Species.MUDKIP, + Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP, + Species.SNIVY, Species.TEPIG, Species.OSHAWOTT, + Species.CHESPIN, Species.FENNEKIN, Species.FROAKIE, + Species.ROWLET, Species.LITTEN, Species.POPPLIO, + Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE, + Species.SPRIGATITO, Species.FUECOCO, Species.QUAXLY +]; const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary @@ -1213,9 +1225,11 @@ export class GameData { reader.onload = (_ => { return e => { + let dataName: string; let dataStr = AES.decrypt(e.target.result.toString(), saveKey).toString(enc.Utf8); let valid = false; try { + dataName = GameDataType[dataType].toLowerCase(); switch (dataType) { case GameDataType.SYSTEM: dataStr = this.convertSystemDataStr(dataStr); @@ -1235,28 +1249,12 @@ export class GameData { console.error(ex); } - let dataName: string; - switch (dataType) { - case GameDataType.SYSTEM: - dataName = "save"; - break; - case GameDataType.SESSION: - dataName = "session"; - break; - case GameDataType.SETTINGS: - dataName = "settings"; - break; - case GameDataType.TUTORIALS: - dataName = "tutorials"; - break; - } - const displayError = (error: string) => this.scene.ui.showText(error, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500)); if (!valid) { return this.scene.ui.showText(`Your ${dataName} data could not be loaded. It may be corrupted.`, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500)); } - this.scene.ui.revertMode(); + this.scene.ui.showText(`Your ${dataName} data will be overridden and the page will reload. Proceed?`, null, () => { this.scene.ui.setOverlayMode(Mode.CONFIRM, () => { localStorage.setItem(dataKey, encrypt(dataStr, bypassLogin)); diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index b7dc2d67883..e30cfd7e24e 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -1,17 +1,17 @@ import { BattleType } from "../battle"; import BattleScene from "../battle-scene"; -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"; +import { Biome } from "#enums/biome"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; export default class PokemonData { public id: integer; diff --git a/src/system/settings/settings-gamepad.ts b/src/system/settings/settings-gamepad.ts index 909b78ffe6f..5dd94b780a0 100644 --- a/src/system/settings/settings-gamepad.ts +++ b/src/system/settings/settings-gamepad.ts @@ -2,7 +2,7 @@ import BattleScene from "../../battle-scene"; import SettingsGamepadUiHandler from "../../ui/settings/settings-gamepad-ui-handler"; import {Mode} from "../../ui/ui"; import {truncateString} from "../../utils"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums/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 c394b2ef8f0..662c718ddcc 100644 --- a/src/system/settings/settings-keyboard.ts +++ b/src/system/settings/settings-keyboard.ts @@ -1,4 +1,4 @@ -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums/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 dc0fa379d69..b929e8ad1e8 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -3,11 +3,11 @@ import i18next from "i18next"; import BattleScene from "../../battle-scene"; import { hasTouchscreen } from "../../touch-controls"; import { updateWindowType } from "../../ui/ui-theme"; -import { PlayerGender } from "#app/data/enums/player-gender"; import { 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"; +import { EaseType } from "#enums/ease-type"; +import { MoneyFormat } from "#enums/money-format"; +import { PlayerGender } from "#enums/player-gender"; const MUTE = "Mute"; const VOLUME_OPTIONS = new Array(11).fill(null).map((_, i) => i ? (i * 10).toString() : MUTE); diff --git a/src/system/trainer-data.ts b/src/system/trainer-data.ts index d4bb3cee94d..fc8a14488cc 100644 --- a/src/system/trainer-data.ts +++ b/src/system/trainer-data.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import { TrainerType } from "../data/enums/trainer-type"; +import { TrainerType } from "#enums/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 f5c6a5eeacf..dd0aa0ef6d4 100644 --- a/src/system/voucher.ts +++ b/src/system/voucher.ts @@ -1,8 +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 } from "#app/data/enums/player-gender"; +import { PlayerGender } from "#enums/player-gender"; +import { TrainerType } from "#enums/trainer-type"; export enum VoucherType { REGULAR, diff --git a/src/test/abilities/battle_bond.test.ts b/src/test/abilities/battle_bond.test.ts index 2752ceed896..b2ff73f5b76 100644 --- a/src/test/abilities/battle_bond.test.ts +++ b/src/test/abilities/battle_bond.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/disguise.test.ts b/src/test/abilities/disguise.test.ts index 8b9c730c4c2..cf8ba386b2e 100644 --- a/src/test/abilities/disguise.test.ts +++ b/src/test/abilities/disguise.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/intimidate.test.ts b/src/test/abilities/intimidate.test.ts index 2409c64e5be..4a690e76b56 100644 --- a/src/test/abilities/intimidate.test.ts +++ b/src/test/abilities/intimidate.test.ts @@ -2,8 +2,6 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; import { CommandPhase, DamagePhase, EncounterPhase, EnemyCommandPhase, SelectStarterPhase, @@ -11,11 +9,13 @@ 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"; import {GameModes, getGameMode} from "#app/game-mode"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Abilities - Intimidate", () => { diff --git a/src/test/abilities/intrepid_sword.test.ts b/src/test/abilities/intrepid_sword.test.ts index 3a830df6845..2d51642be70 100644 --- a/src/test/abilities/intrepid_sword.test.ts +++ b/src/test/abilities/intrepid_sword.test.ts @@ -2,8 +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} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; +import {Abilities} from "#enums/abilities"; +import {Species} from "#enums/species"; import { CommandPhase, } from "#app/phases"; diff --git a/src/test/abilities/libero.test.ts b/src/test/abilities/libero.test.ts index b479691f565..a11feea9f88 100644 --- a/src/test/abilities/libero.test.ts +++ b/src/test/abilities/libero.test.ts @@ -2,16 +2,16 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; import GameManager from "../utils/gameManager"; import * as Overrides from "#app/overrides"; -import { Species } from "#app/data/enums/species.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Moves } from "#app/data/enums/moves.js"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; import { getMovePosition } from "../utils/gameManagerUtils"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; import { allMoves } from "#app/data/move.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { Weather, WeatherType } from "#app/data/weather.js"; import { Type } from "#app/data/type.js"; -import { Biome } from "#app/data/enums/biome.js"; +import { Biome } from "#enums/biome"; import { PlayerPokemon } from "#app/field/pokemon.js"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/moxie.test.ts b/src/test/abilities/moxie.test.ts index ed27c670c87..46fc4e5c34c 100644 --- a/src/test/abilities/moxie.test.ts +++ b/src/test/abilities/moxie.test.ts @@ -2,8 +2,6 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, @@ -11,10 +9,12 @@ 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"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Abilities - Moxie", () => { diff --git a/src/test/abilities/power_construct.test.ts b/src/test/abilities/power_construct.test.ts index c568ba9db3e..68a360a60a2 100644 --- a/src/test/abilities/power_construct.test.ts +++ b/src/test/abilities/power_construct.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/protean.test.ts b/src/test/abilities/protean.test.ts index cd3633156ee..d102daf7fcc 100644 --- a/src/test/abilities/protean.test.ts +++ b/src/test/abilities/protean.test.ts @@ -2,16 +2,16 @@ import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest"; import GameManager from "../utils/gameManager"; import * as Overrides from "#app/overrides"; -import { Species } from "#app/data/enums/species.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Moves } from "#app/data/enums/moves.js"; +import { Species } from "#enums/species"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; import { getMovePosition } from "../utils/gameManagerUtils"; import { MoveEffectPhase, TurnEndPhase } from "#app/phases.js"; import { allMoves } from "#app/data/move.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; +import { BattlerTagType } from "#enums/battler-tag-type"; import { Weather, WeatherType } from "#app/data/weather.js"; import { Type } from "#app/data/type.js"; -import { Biome } from "#app/data/enums/biome.js"; +import { Biome } from "#enums/biome"; 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 7725806555a..403ac1bf4ff 100644 --- a/src/test/abilities/sap_sipper.test.ts +++ b/src/test/abilities/sap_sipper.test.ts @@ -2,16 +2,16 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Species} from "#app/data/enums/species"; import { MoveEndPhase, TurnEndPhase, } from "#app/phases"; -import {Moves} from "#app/data/enums/moves"; import {getMovePosition} from "#app/test/utils/gameManagerUtils"; -import { Abilities } from "#app/data/enums/abilities.js"; import { BattleStat } from "#app/data/battle-stat.js"; import { TerrainType } from "#app/data/terrain.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; +import { Abilities } from "#enums/abilities"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; // See also: TypeImmunityAbAttr describe("Abilities - Sap Sipper", () => { diff --git a/src/test/abilities/schooling.test.ts b/src/test/abilities/schooling.test.ts index 35a05cff87a..4fd64b97246 100644 --- a/src/test/abilities/schooling.test.ts +++ b/src/test/abilities/schooling.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/shields_down.test.ts b/src/test/abilities/shields_down.test.ts index 6e7cb77e079..f35fdd9ed79 100644 --- a/src/test/abilities/shields_down.test.ts +++ b/src/test/abilities/shields_down.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/abilities/volt_absorb.test.ts b/src/test/abilities/volt_absorb.test.ts index 1f0827780ac..8c629d8d771 100644 --- a/src/test/abilities/volt_absorb.test.ts +++ b/src/test/abilities/volt_absorb.test.ts @@ -2,15 +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 } from "#app/data/enums/abilities.js"; import { BattleStat } from "#app/data/battle-stat.js"; -import { BattlerTagType } from "#app/data/enums/battler-tag-type.js"; +import { Abilities } from "#enums/abilities"; +import { BattlerTagType } from "#enums/battler-tag-type"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; // See also: TypeImmunityAbAttr describe("Abilities - Volt Absorb", () => { diff --git a/src/test/abilities/zen_mode.test.ts b/src/test/abilities/zen_mode.test.ts index 697350dc271..4a3caaaa157 100644 --- a/src/test/abilities/zen_mode.test.ts +++ b/src/test/abilities/zen_mode.test.ts @@ -2,8 +2,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as Overrides from "#app/overrides"; -import { Abilities } from "#app/data/enums/abilities"; -import { Species } from "#app/data/enums/species"; import { CommandPhase, DamagePhase, @@ -18,11 +16,13 @@ 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 { QuietFormChangePhase } from "#app/form-change-phase"; import { Status, StatusEffect } from "#app/data/status-effect.js"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; const TIMEOUT = 20 * 1000; diff --git a/src/test/abilities/zero_to_hero.test.ts b/src/test/abilities/zero_to_hero.test.ts index a282be2750c..e0264729125 100644 --- a/src/test/abilities/zero_to_hero.test.ts +++ b/src/test/abilities/zero_to_hero.test.ts @@ -2,9 +2,9 @@ import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vi import GameManager from "#test/utils/gameManager"; import { getMovePosition } from "#test/utils/gameManagerUtils"; import * as Overrides from "#app/overrides"; -import { Moves } from "#app/data/enums/moves.js"; -import { Abilities } from "#app/data/enums/abilities.js"; -import { Species } from "#app/data/enums/species.js"; +import { Moves } from "#enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; import { Status, StatusEffect } from "#app/data/status-effect.js"; import { TurnEndPhase } from "#app/phases.js"; import { QuietFormChangePhase } from "#app/form-change-phase.js"; diff --git a/src/test/battle/battle-order.test.ts b/src/test/battle/battle-order.test.ts index 7ace7dae224..5d8f9d2c98f 100644 --- a/src/test/battle/battle-order.test.ts +++ b/src/test/battle/battle-order.test.ts @@ -2,19 +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} 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"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import {Button} from "#enums/buttons"; describe("Battle order", () => { diff --git a/src/test/battle/battle.test.ts b/src/test/battle/battle.test.ts index 9077cf00076..87949be70a8 100644 --- a/src/test/battle/battle.test.ts +++ b/src/test/battle/battle.test.ts @@ -2,7 +2,6 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import {generateStarter, getMovePosition,} from "#app/test/utils/gameManagerUtils"; import {Mode} from "#app/ui/ui"; import {GameModes} from "#app/game-mode"; -import {Species} from "#app/data/enums/species"; import * as overrides from "../../overrides"; import {Command} from "#app/ui/command-ui-handler"; import { @@ -17,13 +16,14 @@ 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"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { PlayerGender } from "#enums/player-gender"; +import { Species } from "#enums/species"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; diff --git a/src/test/battle/error-handling.test.ts b/src/test/battle/error-handling.test.ts index 8b94c108bc1..d46d8bcf7e8 100644 --- a/src/test/battle/error-handling.test.ts +++ b/src/test/battle/error-handling.test.ts @@ -2,9 +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} from "#app/data/enums/species"; -import {Moves} from "#app/data/enums/moves"; -import {Abilities} from "#app/data/enums/abilities"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; diff --git a/src/test/battle/special_battle.test.ts b/src/test/battle/special_battle.test.ts index 5a95d57afea..01ae7d05359 100644 --- a/src/test/battle/special_battle.test.ts +++ b/src/test/battle/special_battle.test.ts @@ -1,14 +1,14 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest"; import {Mode} from "#app/ui/ui"; -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"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Test Battle Phase", () => { let phaserGame: Phaser.Game; diff --git a/src/test/eggs/egg.test.ts b/src/test/eggs/egg.test.ts index 7cfe7fda651..e6c4ad0e16e 100644 --- a/src/test/eggs/egg.test.ts +++ b/src/test/eggs/egg.test.ts @@ -1,7 +1,7 @@ import {beforeAll, describe, expect, it} from "vitest"; import BattleScene from "../../battle-scene"; import { getLegendaryGachaSpeciesForTimestamp } from "#app/data/egg.js"; -import { Species } from "#app/data/enums/species.js"; +import { Species } from "#enums/species"; import Phaser from "phaser"; describe("getLegendaryGachaSpeciesForTimestamp", () => { diff --git a/src/test/imports.test.ts b/src/test/imports.test.ts index c164813a3cd..5c0272e191d 100644 --- a/src/test/imports.test.ts +++ b/src/test/imports.test.ts @@ -5,7 +5,7 @@ async function importModule() { try { initStatsKeys(); const { PokemonMove } = await import("#app/field/pokemon"); - const { Species } = await import("#app/data/enums/species"); + const { Species } = await import("#enums/species"); return { PokemonMove, Species, diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index 7064bcd13a1..6aacfd0e5e7 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -2,8 +2,6 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, @@ -11,10 +9,12 @@ 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"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Items - Toxic orb", () => { diff --git a/src/test/lokalisation/french.test.ts b/src/test/lokalisation/french.test.ts index 25b7d7d9803..45429b1b157 100644 --- a/src/test/lokalisation/french.test.ts +++ b/src/test/lokalisation/french.test.ts @@ -1,7 +1,7 @@ import {afterEach, beforeAll, describe, expect, it} from "vitest"; import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; -import {Species} from "#app/data/enums/species"; +import {Species} from "#enums/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 9a6e13f06a3..4e5add26207 100644 --- a/src/test/moves/growth.test.ts +++ b/src/test/moves/growth.test.ts @@ -2,8 +2,6 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, @@ -11,10 +9,12 @@ 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"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Moves - Growth", () => { diff --git a/src/test/moves/spikes.test.ts b/src/test/moves/spikes.test.ts index df1df016de5..0544442f31e 100644 --- a/src/test/moves/spikes.test.ts +++ b/src/test/moves/spikes.test.ts @@ -2,12 +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} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; import { CommandPhase } from "#app/phases"; -import {Moves} from "#app/data/enums/moves"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Moves - Spikes", () => { diff --git a/src/test/moves/tackle.test.ts b/src/test/moves/tackle.test.ts index ca3f95731f2..dabf7db5f7e 100644 --- a/src/test/moves/tackle.test.ts +++ b/src/test/moves/tackle.test.ts @@ -2,16 +2,16 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Species} from "#app/data/enums/species"; import { CommandPhase, EnemyCommandPhase, 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"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Moves - Tackle", () => { diff --git a/src/test/moves/tail_whip.test.ts b/src/test/moves/tail_whip.test.ts index 2d6789102d1..3e89e9cb14e 100644 --- a/src/test/moves/tail_whip.test.ts +++ b/src/test/moves/tail_whip.test.ts @@ -2,18 +2,18 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it, vi} from "vitest import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; import * as overrides from "#app/overrides"; -import {Abilities} from "#app/data/enums/abilities"; -import {Species} from "#app/data/enums/species"; import { 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"; +import { Abilities } from "#enums/abilities"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; describe("Moves - Tail whip", () => { diff --git a/src/test/settingMenu/rebinding_setting.test.ts b/src/test/settingMenu/rebinding_setting.test.ts index dee29cd42a2..010ad427d6e 100644 --- a/src/test/settingMenu/rebinding_setting.test.ts +++ b/src/test/settingMenu/rebinding_setting.test.ts @@ -1,5 +1,4 @@ import {beforeEach, describe, expect, it} from "vitest"; -import {Button} from "#app/enums/buttons"; import {deepCopy} from "#app/utils"; import { getKeyWithKeycode, @@ -7,10 +6,11 @@ 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"; +import { Device } from "#enums/devices"; +import { Button } from "#enums/buttons"; describe("Test Rebinding", () => { diff --git a/src/test/ui/starter-select.test.ts b/src/test/ui/starter-select.test.ts index 9f323a2839c..2b5df315a70 100644 --- a/src/test/ui/starter-select.test.ts +++ b/src/test/ui/starter-select.test.ts @@ -1,7 +1,6 @@ import {afterEach, beforeAll, beforeEach, describe, expect, it} from "vitest"; import Phaser from "phaser"; import GameManager from "#app/test/utils/gameManager"; -import {Species} from "#app/data/enums/species"; import { EncounterPhase, SelectStarterPhase, @@ -10,14 +9,15 @@ import { import {Mode} from "#app/ui/ui"; import {GameModes} from "#app/game-mode"; import StarterSelectUiHandler from "#app/ui/starter-select-ui-handler"; -import {Button} from "#app/enums/buttons"; import OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handler"; import SaveSlotSelectUiHandler from "#app/ui/save-slot-select-ui-handler"; import {OptionSelectItem} from "#app/ui/abstact-option-select-ui-handler"; import {Gender} from "#app/data/gender"; import {allSpecies} from "#app/data/pokemon-species"; import {Nature} from "#app/data/nature"; -import {Abilities} from "#app/data/enums/abilities"; +import { Button } from "#enums/buttons"; +import { Abilities } from "#enums/abilities"; +import { Species } from "#enums/species"; describe("UI - Starter select", () => { diff --git a/src/test/utils/gameManager.ts b/src/test/utils/gameManager.ts index 418f8236033..e0585395ff9 100644 --- a/src/test/utils/gameManager.ts +++ b/src/test/utils/gameManager.ts @@ -16,19 +16,19 @@ import {GameModes, getGameMode} from "#app/game-mode"; import fs from "fs"; import {AES, enc} from "crypto-js"; import {updateUserInfo} from "#app/account"; -import {Species} from "#app/data/enums/species"; -import {PlayerGender} from "#app/data/enums/player-gender"; -import {GameDataType} from "#app/data/enums/game-data-type"; import InputsHandler from "#app/test/utils/inputsHandler"; -import {ExpNotification} from "#app/enums/exp-notification"; import ErrorInterceptor from "#app/test/utils/errorInterceptor"; import {EnemyPokemon, PlayerPokemon} from "#app/field/pokemon"; import {MockClock} from "#app/test/utils/mocks/mockClock"; import {Command} from "#app/ui/command-ui-handler"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; -import {Button} from "#app/enums/buttons"; import PartyUiHandler, {PartyUiMode} from "#app/ui/party-ui-handler"; import Trainer from "#app/field/trainer"; +import { ExpNotification } from "#enums/exp-notification"; +import { GameDataType } from "#enums/game-data-type"; +import { PlayerGender } from "#enums/player-gender"; +import { Species } from "#enums/species"; +import { Button } from "#enums/buttons"; /** * Class to manage the game state and transitions between phases. diff --git a/src/test/utils/gameManagerUtils.ts b/src/test/utils/gameManagerUtils.ts index 1b7bbdabaf0..db9ba7174a9 100644 --- a/src/test/utils/gameManagerUtils.ts +++ b/src/test/utils/gameManagerUtils.ts @@ -1,7 +1,7 @@ // Function to convert Blob to string import {getDailyRunStarters} from "#app/data/daily-run"; import {Gender} from "#app/data/gender"; -import {Species} from "#app/data/enums/species"; +import {Species} from "#enums/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 d5a3197f833..9953e99c81a 100644 --- a/src/touch-controls.ts +++ b/src/touch-controls.ts @@ -1,4 +1,4 @@ -import {Button} from "./enums/buttons"; +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 21d0d0841e6..00c88504ef1 100644 --- a/src/ui-inputs.ts +++ b/src/ui-inputs.ts @@ -5,7 +5,7 @@ import MessageUiHandler from "./ui/message-ui-handler"; import StarterSelectUiHandler from "./ui/starter-select-ui-handler"; import {Setting, SettingKeys, settingIndex} from "./system/settings/settings"; import SettingsUiHandler from "./ui/settings/settings-ui-handler"; -import {Button} from "./enums/buttons"; +import {Button} from "#enums/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 568c8208eac..c4877cfca59 100644 --- a/src/ui/abstact-option-select-ui-handler.ts +++ b/src/ui/abstact-option-select-ui-handler.ts @@ -5,7 +5,7 @@ import UiHandler from "./ui-handler"; import { addWindow } from "./ui-theme"; import * as Utils from "../utils"; import { argbFromRgba } from "@material/material-color-utilities"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/buttons"; export interface OptionSelectConfig { xOffset?: number; diff --git a/src/ui/achv-bar.ts b/src/ui/achv-bar.ts index 9e9b20795e3..05dde03aed7 100644 --- a/src/ui/achv-bar.ts +++ b/src/ui/achv-bar.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import { Achv, getAchievementDescription } from "../system/achv"; import { Voucher } from "../system/voucher"; import { TextStyle, addTextObject } from "./text"; -import { PlayerGender } from "#app/data/enums/player-gender"; +import { PlayerGender } from "#enums/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 464a967cbfd..843ebc4e266 100644 --- a/src/ui/achvs-ui-handler.ts +++ b/src/ui/achvs-ui-handler.ts @@ -1,13 +1,13 @@ import BattleScene from "../battle-scene"; -import { Button } from "../enums/buttons"; +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"; +import { PlayerGender } from "#enums/player-gender"; export default class AchvsUiHandler extends MessageUiHandler { private achvsContainer: Phaser.GameObjects.Container; diff --git a/src/ui/arena-flyout.ts b/src/ui/arena-flyout.ts index 5793582d6c4..0568d1524aa 100644 --- a/src/ui/arena-flyout.ts +++ b/src/ui/arena-flyout.ts @@ -4,9 +4,9 @@ import { ArenaTagSide } from "#app/data/arena-tag.js"; import { WeatherType } from "#app/data/weather.js"; import { TerrainType } from "#app/data/terrain.js"; import { addWindow, WindowVariant } from "./ui-theme"; -import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/field/events/arena"; +import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; import { BattleSceneEventType, TurnEndEvent } from "../events/battle-scene"; -import { ArenaTagType } from "#app/data/enums/arena-tag-type.js"; +import { ArenaTagType } from "#enums/arena-tag-type"; import TimeOfDayWidget from "./time-of-day-widget"; import * as Utils from "../utils"; diff --git a/src/ui/awaitable-ui-handler.ts b/src/ui/awaitable-ui-handler.ts index 22a21069acb..18635b132f9 100644 --- a/src/ui/awaitable-ui-handler.ts +++ b/src/ui/awaitable-ui-handler.ts @@ -1,7 +1,7 @@ import BattleScene from "../battle-scene"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 b96dd799b18..70349444647 100644 --- a/src/ui/ball-ui-handler.ts +++ b/src/ui/ball-ui-handler.ts @@ -6,7 +6,7 @@ import { Command } from "./command-ui-handler"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import { addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 812969a988d..5b34a6b5411 100644 --- a/src/ui/battle-flyout.ts +++ b/src/ui/battle-flyout.ts @@ -2,11 +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 } from "#app/data/enums/berry-type.js"; -import { Moves } from "#app/data/enums/moves.js"; +import { BerryType } from "#enums/berry-type"; +import { Moves } from "#enums/moves"; +import { UiTheme } from "#enums/ui-theme"; /** Container for info about a {@linkcode Move} */ interface MoveInfo { diff --git a/src/ui/battle-message-ui-handler.ts b/src/ui/battle-message-ui-handler.ts index 0f856cbb390..6edb359746a 100644 --- a/src/ui/battle-message-ui-handler.ts +++ b/src/ui/battle-message-ui-handler.ts @@ -6,7 +6,7 @@ import MessageUiHandler from "./message-ui-handler"; import { getStatName, Stat } from "../data/pokemon-stat"; import { addWindow } from "./ui-theme"; import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 84d1c2f70e7..3a9f180dd59 100644 --- a/src/ui/candy-bar.ts +++ b/src/ui/candy-bar.ts @@ -2,7 +2,7 @@ import BattleScene, { starterColors } from "../battle-scene"; import { TextStyle, addTextObject } from "./text"; import { argbFromRgba } from "@material/material-color-utilities"; import * as Utils from "../utils"; -import { Species } from "#app/data/enums/species"; +import { Species } from "#enums/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 092d954eae7..ae613c69a4d 100644 --- a/src/ui/challenges-select-ui-handler.ts +++ b/src/ui/challenges-select-ui-handler.ts @@ -3,7 +3,7 @@ import { TextStyle, addTextObject } from "./text"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import { addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 7c21d5cc142..67b587fd076 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -5,7 +5,7 @@ import PartyUiHandler, { PartyUiMode } from "./party-ui-handler"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import i18next from "../plugins/i18n"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/buttons"; export enum Command { FIGHT = 0, diff --git a/src/ui/confirm-ui-handler.ts b/src/ui/confirm-ui-handler.ts index 4e4e0f9bb8c..953ed4972ac 100644 --- a/src/ui/confirm-ui-handler.ts +++ b/src/ui/confirm-ui-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import AbstractOptionSelectUiHandler, { OptionSelectConfig } from "./abstact-option-select-ui-handler"; import { Mode } from "./ui"; import i18next from "i18next"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 96874f439ff..4d987ee8fcc 100644 --- a/src/ui/egg-gacha-ui-handler.ts +++ b/src/ui/egg-gacha-ui-handler.ts @@ -8,9 +8,9 @@ import { VoucherType, getVoucherTypeIcon } from "../system/voucher"; import { getPokemonSpecies } from "../data/pokemon-species"; import { addWindow } from "./ui-theme"; import { Tutorial, handleTutorial } from "../tutorial"; -import { EggTier } from "../data/enums/egg-type"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/buttons"; import i18next from "../plugins/i18n"; +import { EggTier } from "#enums/egg-type"; export default class EggGachaUiHandler extends MessageUiHandler { private eggGachaContainer: Phaser.GameObjects.Container; diff --git a/src/ui/egg-hatch-scene-handler.ts b/src/ui/egg-hatch-scene-handler.ts index 94affc2e751..0e247da60ab 100644 --- a/src/ui/egg-hatch-scene-handler.ts +++ b/src/ui/egg-hatch-scene-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import { EggHatchPhase } from "../egg-hatch-phase"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 653789d4a20..8c4621ffb3d 100644 --- a/src/ui/egg-list-ui-handler.ts +++ b/src/ui/egg-list-ui-handler.ts @@ -5,7 +5,7 @@ import { TextStyle, addTextObject } from "./text"; import MessageUiHandler from "./message-ui-handler"; import { Egg, getEggGachaTypeDescriptor, getEggHatchWavesMessage, getEggDescriptor } from "../data/egg"; import { addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/buttons"; import i18next from "../plugins/i18n"; export default class EggListUiHandler extends MessageUiHandler { diff --git a/src/ui/evolution-scene-handler.ts b/src/ui/evolution-scene-handler.ts index 12b6ccc93d1..64d190c4d3f 100644 --- a/src/ui/evolution-scene-handler.ts +++ b/src/ui/evolution-scene-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../battle-scene"; import MessageUiHandler from "./message-ui-handler"; import { TextStyle, addTextObject } from "./text"; import { Mode } from "./ui"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 657c8b7e311..217f4d75820 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -8,7 +8,7 @@ import * as Utils from "../utils"; import { CommandPhase } from "../phases"; import { MoveCategory } from "#app/data/move.js"; import i18next from "../plugins/i18n"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 e55b8514642..4c60a3bad9b 100644 --- a/src/ui/form-modal-ui-handler.ts +++ b/src/ui/form-modal-ui-handler.ts @@ -6,7 +6,7 @@ import { WindowVariant, addWindow } from "./ui-theme"; import InputText from "phaser3-rex-plugins/plugins/inputtext"; import * as Utils from "../utils"; import i18next from "../plugins/i18n"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 42fb6d9cf81..4a9c62ca012 100644 --- a/src/ui/game-stats-ui-handler.ts +++ b/src/ui/game-stats-ui-handler.ts @@ -7,7 +7,7 @@ import { addWindow } from "./ui-theme"; import * as Utils from "../utils"; import { DexAttr, GameData } from "../system/game-data"; import { speciesStarters } from "../data/pokemon-species"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 a0b0c5da66b..b068080bdda 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -4,12 +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} from "../enums/buttons"; +import {Button} from "#enums/buttons"; +import { GameDataType } from "#enums/game-data-type"; export enum MenuOptions { GAME_SETTINGS, @@ -156,6 +156,7 @@ export default class MenuUiHandler extends MessageUiHandler { manageDataOptions.push({ label: i18next.t("menuUiHandler:importData"), handler: () => { + ui.revertMode(); this.scene.gameData.importData(GameDataType.SYSTEM); return true; }, diff --git a/src/ui/modal-ui-handler.ts b/src/ui/modal-ui-handler.ts index b521ec43759..85b20e423c3 100644 --- a/src/ui/modal-ui-handler.ts +++ b/src/ui/modal-ui-handler.ts @@ -3,7 +3,7 @@ import { TextStyle, addTextObject } from "./text"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; import { WindowVariant, addWindow } from "./ui-theme"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 9a17f6e344d..09f73ac2749 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -6,7 +6,7 @@ import AwaitableUiHandler from "./awaitable-ui-handler"; import { Mode } from "./ui"; import { LockModifierTiersModifier, PokemonHeldItemModifier } from "../modifier/modifier"; import { handleTutorial, Tutorial } from "../tutorial"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 d965345d3de..fadbb2ff7e9 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -8,7 +8,6 @@ import { Mode } from "./ui"; import * as Utils from "../utils"; import { PokemonFormChangeItemModifier, PokemonHeldItemModifier, SwitchEffectTransferModifier } from "../modifier/modifier"; import { allMoves } from "../data/move"; -import { Moves } from "../data/enums/moves"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { StatusEffect } from "../data/status-effect"; import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; @@ -16,10 +15,11 @@ import { pokemonEvolutions } from "../data/pokemon-evolutions"; import { addWindow } from "./ui-theme"; import { SpeciesFormChangeItemTrigger } from "../data/pokemon-forms"; import { getVariantTint } from "#app/data/variant"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/buttons"; import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; import MoveInfoOverlay from "./move-info-overlay"; import i18next from "i18next"; +import { Moves } from "#enums/moves"; const defaultMessage = "Choose a Pokémon."; diff --git a/src/ui/save-slot-select-ui-handler.ts b/src/ui/save-slot-select-ui-handler.ts index e5417f83596..47c61011f8c 100644 --- a/src/ui/save-slot-select-ui-handler.ts +++ b/src/ui/save-slot-select-ui-handler.ts @@ -1,6 +1,6 @@ import i18next from "i18next"; import BattleScene from "../battle-scene"; -import { Button } from "../enums/buttons"; +import { Button } from "#enums/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 fe0736ce101..1cc59c13035 100644 --- a/src/ui/settings/abstract-binding-ui-handler.ts +++ b/src/ui/settings/abstract-binding-ui-handler.ts @@ -3,7 +3,7 @@ import BattleScene from "../../battle-scene"; import {Mode} from "../ui"; import {addWindow} from "../ui-theme"; import {addTextObject, TextStyle} from "../text"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums/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 b8165d41980..4abc19f9087 100644 --- a/src/ui/settings/abstract-control-settings-ui-handler.ts +++ b/src/ui/settings/abstract-control-settings-ui-handler.ts @@ -4,10 +4,10 @@ import {Mode} from "../ui"; import {InterfaceConfig} from "../../inputs-controller"; import {addWindow} from "../ui-theme"; import {addTextObject, TextStyle} from "../text"; -import {Button} from "../../enums/buttons"; import {getIconWithSettingName} from "#app/configs/inputs/configHandler"; import NavigationMenu, {NavigationManager} from "#app/ui/settings/navigationMenu"; -import { Device } from "#app/enums/devices.js"; +import { Device } from "#enums/devices"; +import { Button } from "#enums/buttons"; 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 17d21ec6293..dad797d43a5 100644 --- a/src/ui/settings/abstract-settings-ui-handler.ts +++ b/src/ui/settings/abstract-settings-ui-handler.ts @@ -4,7 +4,7 @@ import { TextStyle, addTextObject } from "../text"; import { Mode } from "../ui"; import UiHandler from "../ui-handler"; import { addWindow } from "../ui-theme"; -import {Button} from "../../enums/buttons"; +import {Button} from "#enums/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 1ab705d3278..70291da15a2 100644 --- a/src/ui/settings/gamepad-binding-ui-handler.ts +++ b/src/ui/settings/gamepad-binding-ui-handler.ts @@ -1,7 +1,7 @@ import BattleScene from "../../battle-scene"; import AbstractBindingUiHandler from "./abstract-binding-ui-handler"; import {Mode} from "../ui"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums/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 ca490857200..2a92bb0fa6c 100644 --- a/src/ui/settings/keyboard-binding-ui-handler.ts +++ b/src/ui/settings/keyboard-binding-ui-handler.ts @@ -2,7 +2,7 @@ import BattleScene from "../../battle-scene"; import AbstractBindingUiHandler from "./abstract-binding-ui-handler"; import {Mode} from "../ui"; import { getKeyWithKeycode} from "#app/configs/inputs/configHandler"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums/devices"; import {addTextObject, TextStyle} from "#app/ui/text"; diff --git a/src/ui/settings/navigationMenu.ts b/src/ui/settings/navigationMenu.ts index c35e60d3ac7..eb65ea95e0c 100644 --- a/src/ui/settings/navigationMenu.ts +++ b/src/ui/settings/navigationMenu.ts @@ -3,7 +3,7 @@ import {Mode} from "#app/ui/ui"; import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler.js"; import {addTextObject, setTextStyle, TextStyle} from "#app/ui/text"; import {addWindow} from "#app/ui/ui-theme"; -import {Button} from "#app/enums/buttons"; +import {Button} from "#enums/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 20a713012ae..18ebde962f1 100644 --- a/src/ui/settings/settings-gamepad-ui-handler.ts +++ b/src/ui/settings/settings-gamepad-ui-handler.ts @@ -13,7 +13,7 @@ import pad_dualshock from "#app/configs/inputs/pad_dualshock"; import pad_unlicensedSNES from "#app/configs/inputs/pad_unlicensedSNES"; import {InterfaceConfig} from "#app/inputs-controller"; import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control-settings-ui-handler.js"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums/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 59b409fe990..7eb1e4f6c60 100644 --- a/src/ui/settings/settings-keyboard-ui-handler.ts +++ b/src/ui/settings/settings-keyboard-ui-handler.ts @@ -13,7 +13,7 @@ import AbstractControlSettingsUiHandler from "#app/ui/settings/abstract-control- import {InterfaceConfig} from "#app/inputs-controller"; import {addTextObject, TextStyle} from "#app/ui/text"; import {deleteBind} from "#app/configs/inputs/configHandler"; -import {Device} from "#app/enums/devices"; +import {Device} from "#enums/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 58d053ac14e..0fcded90372 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -7,8 +7,6 @@ import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext"; import BattleScene, { starterColors } from "../battle-scene"; import { allAbilities } from "../data/ability"; import { speciesEggMoves } from "../data/egg-moves"; -import { Moves } from "../data/enums/moves"; -import { Species } from "../data/enums/species"; import { GrowthRate, getGrowthRateColor } from "../data/exp"; import { Gender, getGenderColor, getGenderSymbol } from "../data/gender"; import { allMoves } from "../data/move"; @@ -17,11 +15,9 @@ import { pokemonFormChanges } from "../data/pokemon-forms"; import { LevelMoves, pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "../data/pokemon-level-moves"; import PokemonSpecies, { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from "../data/pokemon-species"; import { Type } from "../data/type"; -import { Button } from "../enums/buttons"; import { GameModes } from "../game-mode"; import { SelectChallengePhase, TitlePhase } from "../phases"; import { AbilityAttr, DexAttr, DexAttrProps, DexEntry, StarterFormMoveData, StarterMoveset } from "../system/game-data"; -import { Passive as PassiveAttr } from "#app/data/enums/passive"; import { Tutorial, handleTutorial } from "../tutorial"; import * as Utils from "../utils"; import { OptionSelectItem } from "./abstact-option-select-ui-handler"; @@ -32,10 +28,14 @@ import { TextStyle, addBBCodeTextObject, addTextObject } from "./text"; import { Mode } from "./ui"; import { addWindow } from "./ui-theme"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; -import {Device} from "#app/enums/devices"; +import {Passive as PassiveAttr} from "#enums/passive"; import * as Challenge from "../data/challenge"; import MoveInfoOverlay from "./move-info-overlay"; import { getEggTierForSpecies } from "#app/data/egg.js"; +import { Device } from "#enums/devices"; +import { Moves } from "#enums/moves"; +import { Species } from "#enums/species"; +import {Button} from "#enums/buttons"; export type StarterSelectCallback = (starters: Starter[]) => void; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index fb788f2c9c0..5b4dc2cf84f 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -17,12 +17,12 @@ import { StatusEffect } from "../data/status-effect"; import { getBiomeName } from "../data/biomes"; import { Nature, getNatureStatMultiplier } from "../data/nature"; import { loggedInUser } from "../account"; -import { PlayerGender } from "#app/data/enums/player-gender"; import { Variant, getVariantTint } from "#app/data/variant"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/buttons"; import { Ability } from "../data/ability.js"; import i18next from "i18next"; import {modifierSortFunc} from "../modifier/modifier"; +import { PlayerGender } from "#enums/player-gender"; enum Page { diff --git a/src/ui/target-select-ui-handler.ts b/src/ui/target-select-ui-handler.ts index c69284fe64e..772500e8901 100644 --- a/src/ui/target-select-ui-handler.ts +++ b/src/ui/target-select-ui-handler.ts @@ -1,11 +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} from "../enums/buttons"; +import {Button} from "#enums/buttons"; +import { Moves } from "#enums/moves"; export type TargetSelectCallback = (cursor: integer) => void; diff --git a/src/ui/text.ts b/src/ui/text.ts index 79d64c57fad..b74742fef74 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -1,10 +1,10 @@ import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; import InputText from "phaser3-rex-plugins/plugins/inputtext"; import BattleScene from "../battle-scene"; -import { EggTier } from "../data/enums/egg-type"; -import { UiTheme } from "../enums/ui-theme"; import { ModifierTier } from "../modifier/modifier-tier"; import Phaser from "phaser"; +import { EggTier } from "#enums/egg-type"; +import { UiTheme } from "#enums/ui-theme"; export enum TextStyle { MESSAGE, diff --git a/src/ui/time-of-day-widget.ts b/src/ui/time-of-day-widget.ts index da3503fb573..e71839a84c5 100644 --- a/src/ui/time-of-day-widget.ts +++ b/src/ui/time-of-day-widget.ts @@ -1,8 +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 } from "./enums/ease-type"; +import { EaseType } from "#enums/ease-type"; +import { TimeOfDay } from "#enums/time-of-day"; /** A small self contained UI element that displays the time of day as an icon */ export default class TimeOfDayWidget extends Phaser.GameObjects.Container { diff --git a/src/ui/ui-handler.ts b/src/ui/ui-handler.ts index e74853276ea..8336109847e 100644 --- a/src/ui/ui-handler.ts +++ b/src/ui/ui-handler.ts @@ -1,7 +1,7 @@ import BattleScene from "../battle-scene"; import { TextStyle, getTextColor } from "./text"; import { Mode } from "./ui"; -import {Button} from "../enums/buttons"; +import {Button} from "#enums/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 3351efffa1d..b2992d049cb 100644 --- a/src/ui/ui-theme.ts +++ b/src/ui/ui-theme.ts @@ -1,4 +1,4 @@ -import { UiTheme } from "#app/enums/ui-theme"; +import { UiTheme } from "#enums/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 366be949374..55982d049cf 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -37,14 +37,14 @@ import SavingIconHandler from "./saving-icon-handler"; import UnavailableModalUiHandler from "./unavailable-modal-ui-handler"; import OutdatedModalUiHandler from "./outdated-modal-ui-handler"; import SessionReloadModalUiHandler from "./session-reload-modal-ui-handler"; -import {Button} from "../enums/buttons"; +import {Button} 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"; import SettingsDisplayUiHandler from "./settings/settings-display-ui-handler"; import SettingsAudioUiHandler from "./settings/settings-audio-ui-handler"; +import { PlayerGender } from "#enums/player-gender"; export enum Mode { MESSAGE, diff --git a/src/ui/vouchers-ui-handler.ts b/src/ui/vouchers-ui-handler.ts index 4508a5be193..a57a5dda9e7 100644 --- a/src/ui/vouchers-ui-handler.ts +++ b/src/ui/vouchers-ui-handler.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import { Button } from "../enums/buttons"; +import { Button } from "#enums/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 6f2c9cd0c65..7c1a24a6d5e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,5 +1,5 @@ import i18next from "i18next"; -import { MoneyFormat } from "./enums/money-format"; +import { MoneyFormat } from "#enums/money-format"; export const MissingTextureKey = "__MISSING"; diff --git a/tsconfig.json b/tsconfig.json index ec0b5e95ac2..2df676d8433 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2020", "module": "ES2020", - "moduleResolution": "Bundler", + "moduleResolution": "bundler", "resolveJsonModule": true, "esModuleInterop": true, "strictNullChecks": false, @@ -11,6 +11,7 @@ "rootDir": "./src", "baseUrl": "./src", "paths": { + "#enums/*": ["./enums/*.ts"], "#app/*": ["*.ts"], "#app": ["."], "#test/*": ["./test/*.ts"] diff --git a/vite.config.js b/vite.config.js index 220747b98e3..d0fff2e428b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,14 +1,30 @@ +import { resolve } from 'path'; import { defineConfig } from 'vite'; +import tsconfigPaths from 'vite-tsconfig-paths'; // import fs from 'vite-plugin-fs'; export default defineConfig(({ mode }) => { return { - plugins: [/*fs()*/], + plugins: [tsconfigPaths()], server: { host: '0.0.0.0', port: 8000 }, clearScreen: false, build: { minify: 'esbuild', - sourcemap: false + sourcemap: false, + }, + rollupOptions: { + onwarn(warning, warn) { + // Suppress "Module level directives cause errors when bundled" warnings + if (warning.code === "MODULE_LEVEL_DIRECTIVE") { + return; + } + warn(warning); + }, + }, + resolve: { + alias: { + "#enums": resolve('./src/enums') + } }, esbuild: { pure: mode === 'production' ? [ 'console.log' ] : [], diff --git a/vitest.config.js b/vitest.config.js index 5dcb326e1ea..d68ce4d52fe 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,4 +1,5 @@ import { defineConfig } from 'vite'; +import path from 'path'; // import fs from 'vite-plugin-fs'; export default defineConfig(({ mode }) => { @@ -34,6 +35,11 @@ export default defineConfig(({ mode }) => { minify: 'esbuild', sourcemap: true }, + resolve: { + alias: { + "#enums": path.resolve('./src/enums') + } + }, esbuild: { pure: mode === 'production' ? [ 'console.log' ] : [], keepNames: true,