[Refactor] Move enums from game-data into their respective files in `src/data/enums` (#1837)
* move PlayerGender enum into src/data/enums/player-gender.ts this is necessary to avoid circular dependencies which did crash tests in the past (in PRs) * Update settings.ts * Update game-data.ts * Update summary-ui-handler.ts * Update ui.ts * move Passive & GameDataType enums into own files
This commit is contained in:
parent
46dc7e9b01
commit
283714bd0f
|
@ -11,7 +11,8 @@ import { Phase } from "./phase";
|
|||
import { initGameSpeed } from "./system/game-speed";
|
||||
import { Biome } from "./data/enums/biome";
|
||||
import { Arena, ArenaBase } from "./field/arena";
|
||||
import { GameData, PlayerGender } from "./system/game-data";
|
||||
import { GameData } from "./system/game-data";
|
||||
import { PlayerGender } from "./data/enums/player-gender";
|
||||
import { TextStyle, addTextObject } from "./ui/text";
|
||||
import { Moves } from "./data/enums/moves";
|
||||
import { allMoves } from "./data/move";
|
||||
|
|
|
@ -8,7 +8,7 @@ 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 "./system/game-data";
|
||||
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";
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* enum for the game data types
|
||||
*/
|
||||
export enum GameDataType {
|
||||
SYSTEM,
|
||||
SESSION,
|
||||
SETTINGS,
|
||||
TUTORIALS,
|
||||
SEEN_DIALOGUES
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* enum for passive
|
||||
*/
|
||||
export enum Passive {
|
||||
UNLOCKED = 1,
|
||||
ENABLED = 2
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* enum for the players gender
|
||||
*/
|
||||
export enum PlayerGender {
|
||||
UNSET,
|
||||
MALE,
|
||||
FEMALE
|
||||
}
|
|
@ -43,7 +43,8 @@ import { EggHatchPhase } from "./egg-hatch-phase";
|
|||
import { Egg } from "./data/egg";
|
||||
import { vouchers } from "./system/voucher";
|
||||
import { loggedInUser, updateUserInfo } from "./account";
|
||||
import { PlayerGender, SessionSaveData } from "./system/game-data";
|
||||
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";
|
||||
|
|
|
@ -36,28 +36,11 @@ import { TerrainChangedEvent, WeatherChangedEvent } from "#app/field/arena-event
|
|||
import { Device } from "#app/enums/devices.js";
|
||||
import { EnemyAttackStatusEffectChanceModifier } from "../modifier/modifier";
|
||||
import { StatusEffect } from "#app/data/status-effect.js";
|
||||
import { PlayerGender } from "#app/data/enums/player-gender";
|
||||
import { GameDataType } from "#app/data/enums/game-data-type";
|
||||
|
||||
const saveKey = "x0i2O7WRiANTqPmZ"; // Temporary; secure encryption is not yet necessary
|
||||
|
||||
export enum GameDataType {
|
||||
SYSTEM,
|
||||
SESSION,
|
||||
SETTINGS,
|
||||
TUTORIALS,
|
||||
SEEN_DIALOGUES
|
||||
}
|
||||
|
||||
export enum PlayerGender {
|
||||
UNSET,
|
||||
MALE,
|
||||
FEMALE
|
||||
}
|
||||
|
||||
export enum Passive {
|
||||
UNLOCKED = 1,
|
||||
ENABLED = 2
|
||||
}
|
||||
|
||||
export function getDataTypeKey(dataType: GameDataType, slotId: integer = 0): string {
|
||||
switch (dataType) {
|
||||
case GameDataType.SYSTEM:
|
||||
|
|
|
@ -3,7 +3,7 @@ import i18next from "i18next";
|
|||
import BattleScene from "../../battle-scene";
|
||||
import { hasTouchscreen } from "../../touch-controls";
|
||||
import { updateWindowType } from "../../ui/ui-theme";
|
||||
import { PlayerGender } from "../game-data";
|
||||
import { PlayerGender } from "#app/data/enums/player-gender";
|
||||
import { CandyUpgradeNotificationChangedEvent } from "#app/battle-scene-events.js";
|
||||
import { MoneyFormat } from "../../enums/money-format";
|
||||
import SettingsUiHandler from "#app/ui/settings/settings-ui-handler";
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Mode } from "./ui";
|
|||
import * as Utils from "../utils";
|
||||
import { addWindow } from "./ui-theme";
|
||||
import MessageUiHandler from "./message-ui-handler";
|
||||
import { GameDataType } from "../system/game-data";
|
||||
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";
|
||||
|
|
|
@ -20,7 +20,8 @@ import { Type } from "../data/type";
|
|||
import { Button } from "../enums/buttons";
|
||||
import { GameModes, gameModes } from "../game-mode";
|
||||
import { TitlePhase } from "../phases";
|
||||
import { AbilityAttr, DexAttr, DexAttrProps, DexEntry, Passive as PassiveAttr, StarterFormMoveData, StarterMoveset } from "../system/game-data";
|
||||
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";
|
||||
|
@ -403,7 +404,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
this.valueLimitLabel.setOrigin(0.5, 0);
|
||||
this.starterSelectContainer.add(this.valueLimitLabel);
|
||||
|
||||
const startLabel = addTextObject(this.scene, 124, 162, i18next.t("starterSelectUiHandler:start"), TextStyle.TOOLTIP_CONTENT);
|
||||
//TODO: back to translated version
|
||||
const startLabel = addTextObject(this.scene, 124, 162, "Random", TextStyle.TOOLTIP_CONTENT);
|
||||
startLabel.setOrigin(0.5, 0);
|
||||
this.starterSelectContainer.add(startLabel);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import { StatusEffect } from "../data/status-effect";
|
|||
import { getBiomeName } from "../data/biomes";
|
||||
import { Nature, getNatureStatMultiplier } from "../data/nature";
|
||||
import { loggedInUser } from "../account";
|
||||
import { PlayerGender } from "../system/game-data";
|
||||
import { PlayerGender } from "#app/data/enums/player-gender";
|
||||
import { Variant, getVariantTint } from "#app/data/variant";
|
||||
import {Button} from "../enums/buttons";
|
||||
import { Ability } from "../data/ability.js";
|
||||
|
|
|
@ -38,7 +38,7 @@ import OutdatedModalUiHandler from "./outdated-modal-ui-handler";
|
|||
import SessionReloadModalUiHandler from "./session-reload-modal-ui-handler";
|
||||
import {Button} from "../enums/buttons";
|
||||
import i18next, {ParseKeys} from "i18next";
|
||||
import {PlayerGender} from "#app/system/game-data";
|
||||
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";
|
||||
|
|
Loading…
Reference in New Issue