diff --git a/.gitignore b/.gitignore index 9b1ee42..2c8942c 100644 --- a/.gitignore +++ b/.gitignore @@ -118,7 +118,6 @@ out # Nuxt.js build / generate output .nuxt -dist # Gatsby files diff --git a/src/index.ts b/src/index.ts index 0839045..10a1935 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ import { StreamStats } from "./modules/stream/stream-stats"; import { addCss } from "./utils/css"; import { Toast } from "./utils/toast"; import { setupBxUi, updateVideoPlayerCss } from "./modules/ui/ui"; -import { PrefKey, getPref } from "./modules/preferences"; +import { PrefKey, getPref } from "./utils/preferences"; import { LoadingScreen } from "./modules/loading-screen"; import { MouseCursorHider } from "./modules/mkb/mouse-cursor-hider"; import { TouchController } from "./modules/touch-controller"; diff --git a/src/modules/loading-screen.ts b/src/modules/loading-screen.ts index a22623b..469b884 100644 --- a/src/modules/loading-screen.ts +++ b/src/modules/loading-screen.ts @@ -1,7 +1,7 @@ import { CE } from "../utils/html"; import { getPreferredServerRegion } from "../utils/region"; import { TitlesInfo } from "../utils/titles-info"; -import { PrefKey, getPref } from "./preferences"; +import { PrefKey, getPref } from "../utils/preferences"; import { t } from "../utils/translation"; export class LoadingScreen { diff --git a/src/modules/mkb/mkb-handler.ts b/src/modules/mkb/mkb-handler.ts index 828c42a..f89fca7 100644 --- a/src/modules/mkb/mkb-handler.ts +++ b/src/modules/mkb/mkb-handler.ts @@ -2,7 +2,7 @@ import { MkbPreset } from "./mkb-preset"; import { GamepadKey, MkbPresetKey, GamepadStick, MouseMapTo } from "./definitions"; import { createButton, Icon, ButtonStyle, CE } from "../../utils/html"; import { BxEvent } from "../../utils/bx-event"; -import { PrefKey, getPref } from "../preferences"; +import { PrefKey, getPref } from "../../utils/preferences"; import { Toast } from "../../utils/toast"; import { t } from "../../utils/translation"; import { LocalDb } from "../../utils/local-db"; diff --git a/src/modules/mkb/mkb-preset.ts b/src/modules/mkb/mkb-preset.ts index a084823..2ae1431 100644 --- a/src/modules/mkb/mkb-preset.ts +++ b/src/modules/mkb/mkb-preset.ts @@ -1,5 +1,5 @@ import { t } from "../../utils/translation"; -import { SettingElementType } from "../settings"; +import { SettingElementType } from "../../utils/settings"; import { GamepadKey, MouseButtonCode, MouseMapTo, MkbPresetKey } from "./definitions"; import { MkbHandler } from "./mkb-handler"; import type { MkbPresetData, MkbConvertedPresetData } from "../../types/mkb"; diff --git a/src/modules/mkb/mkb-remapper.ts b/src/modules/mkb/mkb-remapper.ts index eb03155..5f8c4d2 100644 --- a/src/modules/mkb/mkb-remapper.ts +++ b/src/modules/mkb/mkb-remapper.ts @@ -2,14 +2,14 @@ import { GamepadKey } from "./definitions"; import { CE, createButton, ButtonStyle } from "../../utils/html"; import { t } from "../../utils/translation"; import { Dialog } from "../dialog"; -import { getPref, setPref, PrefKey } from "../preferences"; +import { getPref, setPref, PrefKey } from "../../utils/preferences"; import { MkbPresetKey, GamepadKeyName } from "./definitions"; import { KeyHelper } from "./key-helper"; import { MkbPreset } from "./mkb-preset"; import { MkbHandler } from "./mkb-handler"; import { LocalDb } from "../../utils/local-db"; import { Icon } from "../../utils/html"; -import { SettingElement } from "../settings"; +import { SettingElement } from "../../utils/settings"; import type { MkbPresetData, MkbStoredPresets } from "../../types/mkb"; diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index d867412..e2ac409 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -1,6 +1,6 @@ import { STATES } from "../utils/global"; import { BX_FLAGS } from "../utils/bx-flags"; -import { getPref, PrefKey } from "./preferences"; +import { getPref, PrefKey } from "../utils/preferences"; import { VibrationManager } from "./vibration-manager"; const PATCHES = { diff --git a/src/modules/remote-play.ts b/src/modules/remote-play.ts index 007bbca..211c20a 100644 --- a/src/modules/remote-play.ts +++ b/src/modules/remote-play.ts @@ -2,7 +2,7 @@ import { STATES, AppInterface } from "../utils/global"; import { CE, createButton, ButtonStyle, Icon } from "../utils/html"; import { Toast } from "../utils/toast"; import { BxEvent } from "../utils/bx-event"; -import { getPref, PrefKey, setPref } from "./preferences"; +import { getPref, PrefKey, setPref } from "../utils/preferences"; import { t } from "../utils/translation"; import { localRedirect } from "./ui/ui"; diff --git a/src/modules/stream/stream-stats.ts b/src/modules/stream/stream-stats.ts index 177f205..f71f9be 100644 --- a/src/modules/stream/stream-stats.ts +++ b/src/modules/stream/stream-stats.ts @@ -1,6 +1,6 @@ -import { PrefKey } from "../preferences" +import { PrefKey } from "../../utils/preferences" import { BxEvent } from "../../utils/bx-event" -import { getPref } from "../preferences" +import { getPref } from "../../utils/preferences" import { StreamBadges } from "./stream-badges" import { CE } from "../../utils/html" import { t } from "../../utils/translation" diff --git a/src/modules/stream/stream-ui.ts b/src/modules/stream/stream-ui.ts index 1ece398..ca597e7 100644 --- a/src/modules/stream/stream-ui.ts +++ b/src/modules/stream/stream-ui.ts @@ -1,7 +1,7 @@ import { STATES } from "../../utils/global"; import { Icon } from "../../utils/html"; import { BxEvent } from "../../utils/bx-event"; -import { PrefKey, getPref } from "../preferences"; +import { PrefKey, getPref } from "../../utils/preferences"; import { t } from "../../utils/translation"; import { StreamBadges } from "./stream-badges"; import { StreamStats } from "./stream-stats"; diff --git a/src/modules/touch-controller.ts b/src/modules/touch-controller.ts index 02c3309..08d5b7c 100644 --- a/src/modules/touch-controller.ts +++ b/src/modules/touch-controller.ts @@ -3,7 +3,7 @@ import { CE } from "../utils/html"; import { Toast } from "../utils/toast"; import { BxEvent } from "../utils/bx-event"; import { BX_FLAGS } from "../utils/bx-flags"; -import { getPref, PrefKey } from "./preferences"; +import { getPref, PrefKey } from "../utils/preferences"; import { t } from "../utils/translation"; export class TouchController { diff --git a/src/modules/ui/global-settings.ts b/src/modules/ui/global-settings.ts index 1ea8887..b830c63 100644 --- a/src/modules/ui/global-settings.ts +++ b/src/modules/ui/global-settings.ts @@ -2,7 +2,7 @@ import { STATES, AppInterface, SCRIPT_HOME, SCRIPT_VERSION } from "../../utils/g import { CE, createButton, Icon, ButtonStyle } from "../../utils/html"; import { getPreferredServerRegion } from "../../utils/region"; import { UserAgent, UserAgentProfile } from "../../utils/user-agent"; -import { getPref, Preferences, PrefKey, setPref, toPrefElement } from "../preferences"; +import { getPref, Preferences, PrefKey, setPref, toPrefElement } from "../../utils/preferences"; import { t, refreshCurrentLocale } from "../../utils/translation"; const SETTINGS_UI = { diff --git a/src/modules/ui/header.ts b/src/modules/ui/header.ts index e3b674f..221d03a 100644 --- a/src/modules/ui/header.ts +++ b/src/modules/ui/header.ts @@ -1,7 +1,7 @@ import { SCRIPT_VERSION } from "../../utils/global"; import { createButton, Icon, ButtonStyle } from "../../utils/html"; import { getPreferredServerRegion } from "../../utils/region"; -import { PrefKey, getPref } from "../preferences"; +import { PrefKey, getPref } from "../../utils/preferences"; import { RemotePlay } from "../remote-play"; import { t } from "../../utils/translation"; import { setupSettingsUi } from "./global-settings"; diff --git a/src/modules/ui/ui.ts b/src/modules/ui/ui.ts index 0c9ad20..7b8dc08 100644 --- a/src/modules/ui/ui.ts +++ b/src/modules/ui/ui.ts @@ -3,7 +3,7 @@ import { Icon, CE, createButton, ButtonStyle } from "../../utils/html"; import { UserAgent } from "../../utils/user-agent"; import { BxEvent } from "../../utils/bx-event"; import { MkbRemapper } from "../mkb/mkb-remapper"; -import { getPref, PrefKey, toPrefElement } from "../preferences"; +import { getPref, PrefKey, toPrefElement } from "../../utils/preferences"; import { setupScreenshotButton } from "../screenshot"; import { StreamStats } from "../stream/stream-stats"; import { TouchController } from "../touch-controller"; diff --git a/src/modules/vibration-manager.ts b/src/modules/vibration-manager.ts index a941b1b..e2eb2bf 100644 --- a/src/modules/vibration-manager.ts +++ b/src/modules/vibration-manager.ts @@ -1,6 +1,6 @@ import { AppInterface } from "../utils/global"; import { BxEvent } from "../utils/bx-event"; -import { PrefKey, getPref } from "./preferences"; +import { PrefKey, getPref } from "../utils/preferences"; const VIBRATION_DATA_MAP = { 'gamepadIndex': 8, diff --git a/src/utils/css.ts b/src/utils/css.ts index 380acc1..d9cde0d 100644 --- a/src/utils/css.ts +++ b/src/utils/css.ts @@ -1,5 +1,5 @@ import { CE } from "./html"; -import { PrefKey, getPref } from "../modules/preferences"; +import { PrefKey, getPref } from "./preferences"; import { renderStylus } from "../macros/build" with {type: "macro"}; diff --git a/src/utils/gamepad.ts b/src/utils/gamepad.ts index c160a00..7e4113d 100644 --- a/src/utils/gamepad.ts +++ b/src/utils/gamepad.ts @@ -1,5 +1,5 @@ import { MkbHandler } from "../modules/mkb/mkb-handler"; -import { PrefKey, getPref } from "../modules/preferences"; +import { PrefKey, getPref } from "./preferences"; import { t } from "./translation"; import { Toast } from "./toast"; diff --git a/src/utils/local-db.ts b/src/utils/local-db.ts index 93a0cbf..8111ebe 100644 --- a/src/utils/local-db.ts +++ b/src/utils/local-db.ts @@ -1,5 +1,5 @@ import { MkbPreset } from "../modules/mkb/mkb-preset"; -import { PrefKey, setPref } from "../modules/preferences"; +import { PrefKey, setPref } from "./preferences"; import { t } from "./translation"; import type { MkbStoredPreset, MkbStoredPresets } from "../types/mkb"; diff --git a/src/utils/monkey-patches.ts b/src/utils/monkey-patches.ts index 1293935..e3a2fb0 100644 --- a/src/utils/monkey-patches.ts +++ b/src/utils/monkey-patches.ts @@ -1,5 +1,5 @@ import { BxEvent } from "./bx-event"; -import { getPref, PrefKey } from "../modules/preferences"; +import { getPref, PrefKey } from "./preferences"; import { STATES } from "./global"; import { UserAgent } from "./user-agent"; diff --git a/src/utils/network.ts b/src/utils/network.ts index c5d2340..319ef31 100644 --- a/src/utils/network.ts +++ b/src/utils/network.ts @@ -1,7 +1,7 @@ import { BxEvent } from "./bx-event"; import { BX_FLAGS } from "./bx-flags"; import { LoadingScreen } from "../modules/loading-screen"; -import { PrefKey, getPref } from "../modules/preferences"; +import { PrefKey, getPref } from "./preferences"; import { RemotePlay } from "../modules/remote-play"; import { StreamBadges } from "../modules/stream/stream-badges"; import { TouchController } from "../modules/touch-controller"; diff --git a/src/modules/preferences.ts b/src/utils/preferences.ts similarity index 99% rename from src/modules/preferences.ts rename to src/utils/preferences.ts index c70d1f7..9ebe6c8 100644 --- a/src/modules/preferences.ts +++ b/src/utils/preferences.ts @@ -1,10 +1,10 @@ -import { CE } from "../utils/html"; -import { SUPPORTED_LANGUAGES, t } from "../utils/translation"; +import { CE } from "./html"; +import { SUPPORTED_LANGUAGES, t } from "./translation"; import { SettingElement, SettingElementType } from "./settings"; -import { UserAgentProfile } from "../utils/user-agent"; -import { StreamStat } from "./stream/stream-stats"; +import { UserAgentProfile } from "./user-agent"; +import { StreamStat } from "../modules/stream/stream-stats"; import type { PreferenceSettings } from "../types/preferences"; -import { STATES } from "../utils/global"; +import { STATES } from "./global"; export enum PrefKey { LAST_UPDATE_CHECK = 'version_last_check', diff --git a/src/utils/region.ts b/src/utils/region.ts index 743bc6d..dd5a53f 100644 --- a/src/utils/region.ts +++ b/src/utils/region.ts @@ -1,4 +1,4 @@ -import { getPref, PrefKey } from "../modules/preferences"; +import { getPref, PrefKey } from "./preferences"; import { STATES } from "./global"; diff --git a/src/modules/settings.ts b/src/utils/settings.ts similarity index 99% rename from src/modules/settings.ts rename to src/utils/settings.ts index 2baf91e..81ac6de 100644 --- a/src/modules/settings.ts +++ b/src/utils/settings.ts @@ -1,5 +1,5 @@ import type { PreferenceSetting } from "../types/preferences"; -import { CE } from "../utils/html"; +import { CE } from "./html"; type MultipleOptionsParams = { size?: number; diff --git a/src/utils/titles-info.ts b/src/utils/titles-info.ts index 175645e..cffe173 100644 --- a/src/utils/titles-info.ts +++ b/src/utils/titles-info.ts @@ -1,5 +1,5 @@ -import { PrefKey } from "../modules/preferences"; -import { getPref } from "../modules/preferences"; +import { PrefKey } from "./preferences"; +import { getPref } from "./preferences"; import { STATES } from "./global"; import { UserAgent } from "./user-agent"; diff --git a/src/utils/user-agent.ts b/src/utils/user-agent.ts index 464ca76..c6281a9 100644 --- a/src/utils/user-agent.ts +++ b/src/utils/user-agent.ts @@ -1,4 +1,4 @@ -import { PrefKey, getPref } from "../modules/preferences"; +import { PrefKey, getPref } from "./preferences"; export enum UserAgentProfile { EDGE_WINDOWS = 'edge-windows', diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 2217dc8..d559f47 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,4 +1,4 @@ -import { PrefKey, getPref, setPref } from "../modules/preferences"; +import { PrefKey, getPref, setPref } from "./preferences"; import { SCRIPT_VERSION } from "./global"; import { UserAgent } from "./user-agent";