From 49e7f823ceedc3e665f06d2dd289caba4f4f6dad Mon Sep 17 00:00:00 2001 From: neoapps-dev Date: Mon, 15 Jun 2026 18:04:47 +0300 Subject: [PATCH] feat: customization saving --- src-tauri/src/config.rs | 1 + src-tauri/src/types.rs | 8 ++++++++ src/context/LauncherContext.tsx | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index b5295d6..db1b23e 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -21,6 +21,7 @@ pub fn load_config_raw(app: AppHandle) -> AppConfig { theme_palette_id: None, apple_silicon_performance_boost: None, custom_editions: None, + customizations: None, profile: Some("legacy_evolved".into()), animations_enabled: Some(true), vfx_enabled: Some(true), diff --git a/src-tauri/src/types.rs b/src-tauri/src/types.rs index ba3ea98..5f85a59 100644 --- a/src-tauri/src/types.rs +++ b/src-tauri/src/types.rs @@ -25,6 +25,13 @@ pub struct CustomEdition { pub logo: Option, } +#[derive(Serialize, Deserialize, Clone, Debug)] +#[serde(rename_all = "camelCase")] +pub struct CustomizationEntry { + pub title_image: Option, + pub panorama: Option, +} + #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(rename_all = "camelCase")] pub struct AppConfig { @@ -36,6 +43,7 @@ pub struct AppConfig { pub theme_palette_id: Option, pub apple_silicon_performance_boost: Option, pub custom_editions: Option>, + pub customizations: Option>, pub profile: Option, pub animations_enabled: Option, pub vfx_enabled: Option, diff --git a/src/context/LauncherContext.tsx b/src/context/LauncherContext.tsx index e85202e..856b523 100644 --- a/src/context/LauncherContext.tsx +++ b/src/context/LauncherContext.tsx @@ -64,6 +64,7 @@ export function LauncherProvider({ children }: { children: React.ReactNode }) { configRaw.username, configRaw.theme, configRaw.layout, configRaw.vfxEnabled, configRaw.rpcEnabled, configRaw.musicVol, configRaw.sfxVol, configRaw.isDayTime, configRaw.profile, configRaw.linuxRunner, configRaw.perfBoost, configRaw.customEditions, + configRaw.customizations, configRaw.legacyMode, configRaw.animationsEnabled, configRaw.mangohudEnabled, configRaw.extraLaunchArgs, configRaw.launchPrefix, configRaw.launchEnvVars, configRaw.startFullscreen, configRaw.skipIntro, @@ -125,6 +126,7 @@ export function LauncherProvider({ children }: { children: React.ReactNode }) { appleSiliconPerformanceBoost: config.perfBoost, profile: config.profile, customEditions: config.customEditions, + customizations: config.customizations, animationsEnabled: config.animationsEnabled, vfxEnabled: config.vfxEnabled, rpcEnabled: config.rpcEnabled, @@ -142,7 +144,7 @@ export function LauncherProvider({ children }: { children: React.ReactNode }) { }, [ config.username, skinSync.skinBase64, config.theme, config.linuxRunner, config.perfBoost, config.customEditions, config.profile, - config.vfxEnabled, config.animationsEnabled, + config.customizations, config.vfxEnabled, config.animationsEnabled, config.rpcEnabled, config.musicVol, config.sfxVol, config.legacyMode, config.mangohudEnabled, config.extraLaunchArgs, config.launchPrefix, config.launchEnvVars, config.isLoaded, config.startFullscreen,