diff --git a/src/def.d.ts b/src/def.d.ts index 90e9e98..f420ae0 100644 --- a/src/def.d.ts +++ b/src/def.d.ts @@ -125,6 +125,7 @@ interface Theme { interface Settings { debuggerUrl: string; developerSettings: boolean; + flip: boolean; } interface ApplicationCommand { diff --git a/src/index.ts b/src/index.ts index 1ef2bc8..a8b19e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,10 +2,12 @@ import { patchLogHook } from "@lib/debug"; import { patchCommands } from "@lib/commands"; import { initPlugins } from "@lib/plugins"; import { patchAssets } from "@ui/assets"; +import { awaitSyncWrapper } from "@lib/storage"; import initSettings from "@ui/settings"; import initFixes from "@lib/fixes"; import logger from "@lib/logger"; import windowObject from "@lib/windowObject"; +import settings from "@lib/settings"; export default async () => { // Load everything in parallel @@ -23,6 +25,10 @@ export default async () => { // Once done, load plugins unloads.push(await initPlugins()); + // :trolley: + await awaitSyncWrapper(settings) + settings.flip ??= true; + // We good :) logger.log("Vendetta is ready!"); } diff --git a/src/ui/settings/components/SettingsSection.tsx b/src/ui/settings/components/SettingsSection.tsx index 69d9f3b..7662d91 100644 --- a/src/ui/settings/components/SettingsSection.tsx +++ b/src/ui/settings/components/SettingsSection.tsx @@ -1,4 +1,4 @@ -import { NavigationNative } from "@metro/common"; +import { ReactNative as RN, NavigationNative } from "@metro/common"; import { ErrorBoundary, Forms } from "@ui/components"; import { getAssetIDByName } from "@ui/assets"; import { useProxy } from "@lib/storage"; @@ -12,43 +12,45 @@ export default function SettingsSection() { return ( - - } - trailing={FormRow.Arrow} - onPress={() => navigation.push("VendettaSettings")} - /> - - } - trailing={FormRow.Arrow} - onPress={() => navigation.push("VendettaPlugins")} - /> - {window.__vendetta_loader?.features.themes && ( - <> - - } - trailing={FormRow.Arrow} - onPress={() => navigation.push("VendettaThemes")} - /> - - )} - {settings.developerSettings && ( - <> - - } - trailing={FormRow.Arrow} - onPress={() => navigation.push("VendettaDeveloper")} - /> - - )} - + + + } + trailing={FormRow.Arrow} + onPress={() => navigation.push("VendettaSettings")} + /> + + } + trailing={FormRow.Arrow} + onPress={() => navigation.push("VendettaPlugins")} + /> + {window.__vendetta_loader?.features.themes && ( + <> + + } + trailing={FormRow.Arrow} + onPress={() => navigation.push("VendettaThemes")} + /> + + )} + {settings.developerSettings && ( + <> + + } + trailing={FormRow.Arrow} + onPress={() => navigation.push("VendettaDeveloper")} + /> + + )} + + ) } \ No newline at end of file diff --git a/src/ui/settings/pages/AssetBrowser.tsx b/src/ui/settings/pages/AssetBrowser.tsx index c621ccd..55b5b2a 100644 --- a/src/ui/settings/pages/AssetBrowser.tsx +++ b/src/ui/settings/pages/AssetBrowser.tsx @@ -1,6 +1,8 @@ +import { useProxy } from "@/lib/storage"; import { ReactNative as RN, stylesheet } from "@metro/common"; import { all } from "@ui/assets"; import { Forms, Search } from "@ui/components"; +import settings from "@lib/settings"; import ErrorBoundary from "@ui/components/ErrorBoundary"; import AssetDisplay from "@ui/settings/components/AssetDisplay"; @@ -18,10 +20,11 @@ const styles = stylesheet.createThemedStyleSheet({ export default function AssetBrowser() { const [search, setSearch] = React.useState(""); + useProxy(settings); return ( - + setSearch(v)} diff --git a/src/ui/settings/pages/Developer.tsx b/src/ui/settings/pages/Developer.tsx index 618df83..96dceea 100644 --- a/src/ui/settings/pages/Developer.tsx +++ b/src/ui/settings/pages/Developer.tsx @@ -16,7 +16,7 @@ export default function Developer() { return ( - + - + RN.NativeModules.BundleUpdaterManager.reload()} /> + } + value={settings.flip} + onValueChange={(v: boolean) => { + settings.flip = v; + }} + style={{ transform: [{ rotate: "180deg" }] }} + /> } diff --git a/src/ui/settings/pages/Plugins.tsx b/src/ui/settings/pages/Plugins.tsx index 53c4ef3..3dbee58 100644 --- a/src/ui/settings/pages/Plugins.tsx +++ b/src/ui/settings/pages/Plugins.tsx @@ -1,15 +1,17 @@ import { ReactNative as RN } from "@metro/common"; import { useProxy } from "@lib/storage"; import { plugins } from "@lib/plugins"; +import settings from "@lib/settings"; import PluginCard from "@ui/settings/components/PluginCard"; import ErrorBoundary from "@ui/components/ErrorBoundary"; export default function Plugins() { useProxy(plugins); + useProxy(settings) return ( - + } diff --git a/src/ui/settings/pages/Themes.tsx b/src/ui/settings/pages/Themes.tsx index eb58464..15f6552 100644 --- a/src/ui/settings/pages/Themes.tsx +++ b/src/ui/settings/pages/Themes.tsx @@ -1,15 +1,17 @@ import { themes } from "@/lib/themes"; import { useProxy } from "@lib/storage"; import { ReactNative as RN } from "@metro/common"; +import settings from "@lib/settings"; import ErrorBoundary from "@ui/components/ErrorBoundary"; import ThemeCard from "@ui/settings/components/ThemeCard"; export default function Themes() { useProxy(themes); + useProxy(settings) return ( - + }