From d9d455f3175c44e5543495f1087bfa67b3f6724a Mon Sep 17 00:00:00 2001 From: Greenlamp Date: Sun, 12 May 2024 16:51:18 +0200 Subject: [PATCH] create folder for settings in ui folder --- src/battle-scene.ts | 3 --- src/inputs-controller.ts | 2 +- src/system/settings-gamepad.ts | 4 ++-- src/system/settings.ts | 4 ++-- src/ui-inputs.ts | 4 ++-- .../{ => settings}/gamepad-binding-ui-handler.ts | 10 +++++----- .../keyboard-binding-ui-handler.ts | 8 ++++---- .../{ => settings}/option-select-ui-handler.ts | 6 +++--- .../settings-gamepad-ui-handler.ts | 16 ++++++++-------- .../settings-keyboard-ui-handler.ts | 8 ++++---- src/ui/{ => settings}/settings-ui-handler.ts | 16 ++++++++-------- src/ui/title-ui-handler.ts | 2 +- src/ui/ui.ts | 12 ++++++------ 13 files changed, 46 insertions(+), 49 deletions(-) rename src/ui/{ => settings}/gamepad-binding-ui-handler.ts (97%) rename src/ui/{ => settings}/keyboard-binding-ui-handler.ts (94%) rename src/ui/{ => settings}/option-select-ui-handler.ts (59%) rename src/ui/{ => settings}/settings-gamepad-ui-handler.ts (98%) rename src/ui/{ => settings}/settings-keyboard-ui-handler.ts (94%) rename src/ui/{ => settings}/settings-ui-handler.ts (96%) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c62525595..8590ae479 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -33,9 +33,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 { Setting, settingOptions } from './system/settings'; -import SettingsUiHandler from './ui/settings-ui-handler'; -import MessageUiHandler from './ui/message-ui-handler'; import { Species } from './data/enums/species'; import InvertPostFX from './pipelines/invert'; import { Achv, ModifierAchv, MoneyAchv, achvs } from './system/achv'; diff --git a/src/inputs-controller.ts b/src/inputs-controller.ts index 744a03447..0ea1ee5f3 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -6,7 +6,7 @@ import pad_xbox360 from "./configs/pad_xbox360"; import pad_dualshock from "./configs/pad_dualshock"; import {Button} from "./enums/buttons"; import {Mode} from "./ui/ui"; -import SettingsGamepadUiHandler from "./ui/settings-gamepad-ui-handler"; +import SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler"; import {SettingGamepad} from "./system/settings-gamepad"; import { getCurrenlyAssignedIconFromInputIndex, getCurrentlyAssignedIconToSettingName, diff --git a/src/system/settings-gamepad.ts b/src/system/settings-gamepad.ts index 7c32d5763..488d8ecfa 100644 --- a/src/system/settings-gamepad.ts +++ b/src/system/settings-gamepad.ts @@ -1,7 +1,7 @@ import BattleScene from "../battle-scene"; import {SettingDefaults, SettingOptions} from "./settings"; -import SettingsGamepadUiHandler from "../ui/settings-gamepad-ui-handler"; -import {Mode} from "#app/ui/ui"; +import SettingsGamepadUiHandler from "../ui/settings/settings-gamepad-ui-handler"; +import {Mode} from "../ui/ui"; import {truncateString} from "../utils"; import {Button} from "../enums/buttons"; diff --git a/src/system/settings.ts b/src/system/settings.ts index 017ff2f40..7fee9cc6b 100644 --- a/src/system/settings.ts +++ b/src/system/settings.ts @@ -3,8 +3,8 @@ import BattleScene from "../battle-scene"; import { hasTouchscreen } from "../touch-controls"; import { updateWindowType } from "../ui/ui-theme"; import { PlayerGender } from "./game-data"; -import { Mode } from "#app/ui/ui"; -import SettingsUiHandler from "#app/ui/settings-ui-handler"; +import { Mode } from "../ui/ui"; +import SettingsUiHandler from "../ui/settings/settings-ui-handler"; export enum Setting { Game_Speed = "GAME_SPEED", diff --git a/src/ui-inputs.ts b/src/ui-inputs.ts index e08f05d38..99210b8a4 100644 --- a/src/ui-inputs.ts +++ b/src/ui-inputs.ts @@ -4,9 +4,9 @@ import {InputsController} from "./inputs-controller"; import MessageUiHandler from "./ui/message-ui-handler"; import StarterSelectUiHandler from "./ui/starter-select-ui-handler"; import {Setting, settingOptions} from "./system/settings"; -import SettingsUiHandler from "./ui/settings-ui-handler"; +import SettingsUiHandler from "./ui/settings/settings-ui-handler"; import {Button} from "./enums/buttons"; -import SettingsGamepadUiHandler from "#app/ui/settings-gamepad-ui-handler"; +import SettingsGamepadUiHandler from "./ui/settings/settings-gamepad-ui-handler"; export interface ActionKeys { [key in Button]: () => void; diff --git a/src/ui/gamepad-binding-ui-handler.ts b/src/ui/settings/gamepad-binding-ui-handler.ts similarity index 97% rename from src/ui/gamepad-binding-ui-handler.ts rename to src/ui/settings/gamepad-binding-ui-handler.ts index 864a63cba..a84ea9cbb 100644 --- a/src/ui/gamepad-binding-ui-handler.ts +++ b/src/ui/settings/gamepad-binding-ui-handler.ts @@ -1,11 +1,11 @@ -import UiHandler from "./ui-handler"; +import UiHandler from "../ui-handler"; import BattleScene from "#app/battle-scene"; -import {Mode} from "./ui"; -import {Button} from "../enums/buttons"; -import {addWindow} from "./ui-theme"; +import {Mode} from "../ui"; +import {Button} from "../../enums/buttons"; +import {addWindow} from "../ui-theme"; import {addTextObject, TextStyle} from "#app/ui/text"; import Phaser from "phaser"; -import {SettingGamepad} from "../system/settings-gamepad"; +import {SettingGamepad} from "../../system/settings-gamepad"; export default class GamepadBindingUiHandler extends UiHandler { diff --git a/src/ui/keyboard-binding-ui-handler.ts b/src/ui/settings/keyboard-binding-ui-handler.ts similarity index 94% rename from src/ui/keyboard-binding-ui-handler.ts rename to src/ui/settings/keyboard-binding-ui-handler.ts index ba237215b..469de1605 100644 --- a/src/ui/keyboard-binding-ui-handler.ts +++ b/src/ui/settings/keyboard-binding-ui-handler.ts @@ -1,7 +1,7 @@ -import UiHandler from "#app/ui/ui-handler"; -import BattleScene from "#app/battle-scene"; -import {Mode} from "#app/ui/ui"; -import {Button} from "#app/enums/buttons"; +import UiHandler from "../ui-handler"; +import BattleScene from "../../battle-scene"; +import {Mode} from "../ui"; +import {Button} from "../../enums/buttons"; export default class KeyboardBindingUiHandler extends UiHandler { diff --git a/src/ui/option-select-ui-handler.ts b/src/ui/settings/option-select-ui-handler.ts similarity index 59% rename from src/ui/option-select-ui-handler.ts rename to src/ui/settings/option-select-ui-handler.ts index 824fa1535..18979dca1 100644 --- a/src/ui/option-select-ui-handler.ts +++ b/src/ui/settings/option-select-ui-handler.ts @@ -1,6 +1,6 @@ -import BattleScene from "../battle-scene"; -import AbstractOptionSelectUiHandler from "./abstact-option-select-ui-handler"; -import { Mode } from "./ui"; +import BattleScene from "../../battle-scene"; +import AbstractOptionSelectUiHandler from "../abstact-option-select-ui-handler"; +import { Mode } from "../ui"; export default class OptionSelectUiHandler extends AbstractOptionSelectUiHandler { constructor(scene: BattleScene, mode: Mode = Mode.OPTION_SELECT) { diff --git a/src/ui/settings-gamepad-ui-handler.ts b/src/ui/settings/settings-gamepad-ui-handler.ts similarity index 98% rename from src/ui/settings-gamepad-ui-handler.ts rename to src/ui/settings/settings-gamepad-ui-handler.ts index f78888238..f7cadc5d1 100644 --- a/src/ui/settings-gamepad-ui-handler.ts +++ b/src/ui/settings/settings-gamepad-ui-handler.ts @@ -1,15 +1,15 @@ -import BattleScene from "../battle-scene"; -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 BattleScene from "../../battle-scene"; +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 { SettingGamepad, settingGamepadDefaults, settingGamepadOptions -} from "../system/settings-gamepad"; -import {truncateString} from "../utils"; +} from "../../system/settings-gamepad"; +import {truncateString} from "../../utils"; import { getCurrentlyAssignedIconToSettingName, getKeyForSettingName diff --git a/src/ui/settings-keyboard-ui-handler.ts b/src/ui/settings/settings-keyboard-ui-handler.ts similarity index 94% rename from src/ui/settings-keyboard-ui-handler.ts rename to src/ui/settings/settings-keyboard-ui-handler.ts index 6b01be325..88bff862c 100644 --- a/src/ui/settings-keyboard-ui-handler.ts +++ b/src/ui/settings/settings-keyboard-ui-handler.ts @@ -1,7 +1,7 @@ -import UiHandler from "#app/ui/ui-handler"; -import BattleScene from "#app/battle-scene"; -import {Mode} from "#app/ui/ui"; -import {Button} from "#app/enums/buttons"; +import UiHandler from "../ui-handler"; +import BattleScene from "../../battle-scene"; +import {Mode} from "../ui"; +import {Button} from "../../enums/buttons"; export default class SettingsKeyboardUiHandler extends UiHandler { diff --git a/src/ui/settings-ui-handler.ts b/src/ui/settings/settings-ui-handler.ts similarity index 96% rename from src/ui/settings-ui-handler.ts rename to src/ui/settings/settings-ui-handler.ts index 691e5cb8f..fdc94724e 100644 --- a/src/ui/settings-ui-handler.ts +++ b/src/ui/settings/settings-ui-handler.ts @@ -1,11 +1,11 @@ -import BattleScene from "../battle-scene"; -import { Setting, reloadSettings, settingDefaults, settingOptions } from "../system/settings"; -import { hasTouchscreen, isMobile } from "../touch-controls"; -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 BattleScene from "../../battle-scene"; +import { Setting, reloadSettings, settingDefaults, settingOptions } from "../../system/settings"; +import { hasTouchscreen, isMobile } from "../../touch-controls"; +import { TextStyle, addTextObject } from "../text"; +import { Mode } from "../ui"; +import UiHandler from "../ui-handler"; +import { addWindow } from "../ui-theme"; +import {Button} from "../../enums/buttons"; export default class SettingsUiHandler extends UiHandler { private settingsContainer: Phaser.GameObjects.Container; diff --git a/src/ui/title-ui-handler.ts b/src/ui/title-ui-handler.ts index c808611b0..eeba02d0f 100644 --- a/src/ui/title-ui-handler.ts +++ b/src/ui/title-ui-handler.ts @@ -1,6 +1,6 @@ import BattleScene from "../battle-scene"; import { DailyRunScoreboard } from "./daily-run-scoreboard"; -import OptionSelectUiHandler from "./option-select-ui-handler"; +import OptionSelectUiHandler from "./settings/option-select-ui-handler"; import { Mode } from "./ui"; import * as Utils from "../utils"; import { TextStyle, addTextObject } from "./text"; diff --git a/src/ui/ui.ts b/src/ui/ui.ts index 2f23a6035..28acad9b5 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -12,13 +12,13 @@ import SummaryUiHandler from './summary-ui-handler'; import StarterSelectUiHandler from './starter-select-ui-handler'; import EvolutionSceneHandler from './evolution-scene-handler'; import TargetSelectUiHandler from './target-select-ui-handler'; -import SettingsUiHandler from './settings-ui-handler'; -import SettingsGamepadUiHandler from "./settings-gamepad-ui-handler"; +import SettingsUiHandler from './settings/settings-ui-handler'; +import SettingsGamepadUiHandler from "./settings/settings-gamepad-ui-handler"; import { TextStyle, addTextObject } from './text'; import AchvBar from './achv-bar'; import MenuUiHandler from './menu-ui-handler'; import AchvsUiHandler from './achvs-ui-handler'; -import OptionSelectUiHandler from './option-select-ui-handler'; +import OptionSelectUiHandler from './settings/option-select-ui-handler'; import EggHatchSceneHandler from './egg-hatch-scene-handler'; import EggListUiHandler from './egg-list-ui-handler'; import EggGachaUiHandler from './egg-gacha-ui-handler'; @@ -37,9 +37,9 @@ 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 GamepadBindingUiHandler from "./gamepad-binding-ui-handler"; -import SettingsKeyboardUiHandler from "#app/ui/settings-keyboard-ui-handler"; -import KeyboardBindingUiHandler from "#app/ui/keyboard-binding-ui-handler"; +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"; export enum Mode { MESSAGE,