feat: customization saving

This commit is contained in:
neoapps-dev
2026-06-15 18:04:47 +03:00
parent dbe68e4c6c
commit 49e7f823ce
3 changed files with 12 additions and 1 deletions

View File

@@ -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),

View File

@@ -25,6 +25,13 @@ pub struct CustomEdition {
pub logo: Option<String>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct CustomizationEntry {
pub title_image: Option<String>,
pub panorama: Option<String>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct AppConfig {
@@ -36,6 +43,7 @@ pub struct AppConfig {
pub theme_palette_id: Option<String>,
pub apple_silicon_performance_boost: Option<bool>,
pub custom_editions: Option<Vec<CustomEdition>>,
pub customizations: Option<std::collections::HashMap<String, CustomizationEntry>>,
pub profile: Option<String>,
pub animations_enabled: Option<bool>,
pub vfx_enabled: Option<bool>,

View File

@@ -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,