parent
21fc6e86a8
commit
3082c840c8
8 changed files with 43 additions and 69 deletions
1
src/def.d.ts
vendored
1
src/def.d.ts
vendored
|
@ -125,7 +125,6 @@ interface Theme {
|
|||
interface Settings {
|
||||
debuggerUrl: string;
|
||||
developerSettings: boolean;
|
||||
flip: boolean;
|
||||
}
|
||||
|
||||
interface ApplicationCommand {
|
||||
|
|
|
@ -2,12 +2,10 @@ 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
|
||||
|
@ -25,10 +23,6 @@ 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!");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ReactNative as RN, NavigationNative } from "@metro/common";
|
||||
import { NavigationNative } from "@metro/common";
|
||||
import { ErrorBoundary, Forms } from "@ui/components";
|
||||
import { getAssetIDByName } from "@ui/assets";
|
||||
import { useProxy } from "@lib/storage";
|
||||
|
@ -12,45 +12,43 @@ export default function SettingsSection() {
|
|||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<RN.View style={settings.flip && { transform: [{ rotate: "180deg" }] }}>
|
||||
<FormSection key="Vendetta" title="Vendetta">
|
||||
<FormRow
|
||||
label="General"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("settings")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaSettings")}
|
||||
/>
|
||||
<FormDivider />
|
||||
<FormRow
|
||||
label="Plugins"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("debug")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaPlugins")}
|
||||
/>
|
||||
{window.__vendetta_loader?.features.themes && (
|
||||
<>
|
||||
<FormDivider />
|
||||
<FormRow
|
||||
label="Themes"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("ic_theme_24px")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaThemes")}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{settings.developerSettings && (
|
||||
<>
|
||||
<FormDivider />
|
||||
<FormRow
|
||||
label="Developer"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("ic_progress_wrench_24px")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaDeveloper")}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</FormSection>
|
||||
</RN.View>
|
||||
<FormSection key="Vendetta" title="Vendetta">
|
||||
<FormRow
|
||||
label="General"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("settings")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaSettings")}
|
||||
/>
|
||||
<FormDivider />
|
||||
<FormRow
|
||||
label="Plugins"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("debug")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaPlugins")}
|
||||
/>
|
||||
{window.__vendetta_loader?.features.themes && (
|
||||
<>
|
||||
<FormDivider />
|
||||
<FormRow
|
||||
label="Themes"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("ic_theme_24px")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaThemes")}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{settings.developerSettings && (
|
||||
<>
|
||||
<FormDivider />
|
||||
<FormRow
|
||||
label="Developer"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("ic_progress_wrench_24px")} />}
|
||||
trailing={FormRow.Arrow}
|
||||
onPress={() => navigation.push("VendettaDeveloper")}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</FormSection>
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
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";
|
||||
|
||||
|
@ -20,11 +18,10 @@ const styles = stylesheet.createThemedStyleSheet({
|
|||
|
||||
export default function AssetBrowser() {
|
||||
const [search, setSearch] = React.useState("");
|
||||
useProxy(settings);
|
||||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<RN.View style={{ flex: 1, ...(settings.flip && { transform: [{ rotate: "180deg" }] }) }}>
|
||||
<RN.View style={{ flex: 1 }}>
|
||||
<Search
|
||||
style={styles.search}
|
||||
onChangeText={(v: string) => setSearch(v)}
|
||||
|
|
|
@ -16,7 +16,7 @@ export default function Developer() {
|
|||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<RN.ScrollView style={{ flex: 1, ...(settings.flip && { transform: [{ rotate: "180deg" }] }) }} contentContainerStyle={{ paddingBottom: 38 }}>
|
||||
<RN.ScrollView style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 38 }}>
|
||||
<FormSection title="Debug" titleStyleType="no_border">
|
||||
<FormInput
|
||||
value={settings.debuggerUrl}
|
||||
|
|
|
@ -82,7 +82,7 @@ export default function General() {
|
|||
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<RN.ScrollView style={{ flex: 1, ...(settings.flip && { transform: [{ rotate: "180deg" }] }) }} contentContainerStyle={{ paddingBottom: 38 }}>
|
||||
<RN.ScrollView style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 38 }}>
|
||||
<FormSection title="Links" titleStyleType="no_border">
|
||||
<FormRow
|
||||
label="Discord Server"
|
||||
|
@ -105,16 +105,6 @@ export default function General() {
|
|||
onPress={() => RN.NativeModules.BundleUpdaterManager.reload()}
|
||||
/>
|
||||
<FormDivider />
|
||||
<FormSwitchRow
|
||||
label="Flip UI"
|
||||
subLabel="April Fools!"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("ic_emoji_24px")} />}
|
||||
value={settings.flip}
|
||||
onValueChange={(v: boolean) => {
|
||||
settings.flip = v;
|
||||
}}
|
||||
style={{ transform: [{ rotate: "180deg" }] }}
|
||||
/>
|
||||
<FormSwitchRow
|
||||
label="Developer Settings"
|
||||
leading={<FormRow.Icon source={getAssetIDByName("ic_progress_wrench_24px")} />}
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
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 (
|
||||
<ErrorBoundary>
|
||||
<RN.View style={{ flex: 1, ...(settings.flip && { transform: [{ rotate: "180deg" }] }) }}>
|
||||
<RN.View style={{ flex: 1 }}>
|
||||
<RN.FlatList
|
||||
data={Object.values(plugins)}
|
||||
renderItem={({ item, index }) => <PluginCard plugin={item} index={index} />}
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
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 (
|
||||
<ErrorBoundary>
|
||||
<RN.View style={{ flex: 1, ...(settings.flip && { transform: [{ rotate: "180deg" }] }) }}>
|
||||
<RN.View style={{ flex: 1 }}>
|
||||
<RN.FlatList
|
||||
data={Object.values(themes)}
|
||||
renderItem={({ item, index }) => <ThemeCard theme={item} index={index} />}
|
||||
|
|
Loading…
Reference in a new issue