From 5d6637df3704af8d7a27e8010bde89988aec042b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnold=20Tak=C3=A1cs?= Date: Wed, 22 Feb 2017 14:16:54 +0200 Subject: [PATCH] [[Synced from revision 549]] -- ThemeSystem. Skinsets are now stored/loaded with relative paths (and only using the base skinset) --- .../Interface/Themes/Editor/ThemeSystem.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Codebase/Systems/Interface/Themes/Editor/ThemeSystem.cs b/Codebase/Systems/Interface/Themes/Editor/ThemeSystem.cs index cdb1102e2..10ea93424 100644 --- a/Codebase/Systems/Interface/Themes/Editor/ThemeSystem.cs +++ b/Codebase/Systems/Interface/Themes/Editor/ThemeSystem.cs @@ -115,19 +115,12 @@ public static void Load(bool lazy=false){ var fontset = lazy ? Utility.GetPref("EditorFontset"+suffix,"Classic") + ".unityFontset" : null; var palette = lazy ? Utility.GetPref("EditorPalette"+suffix,"Classic") + ".unityPalette" : null; var iconset = lazy ? FileManager.Find("Iconsets/"+Utility.GetPref("EditorIconset"+suffix,"Default")) : null; - var skinPaths = Utility.GetPref("EditorSkinset"+suffix,"").Split("|"); + var skinset = lazy ? FileManager.Find("Skinsets/"+Utility.GetPref("EditorSkinset"+suffix,"Default")) : null; var unityTheme = lazy ? theme + ".unitytheme" : null; ThemeFontset.all = ThemeFontset.Import(fontset); ThemePalette.all = ThemePalette.Import(palette); - if(lazy && !skinPaths.IsEmpty()){ - var skinsets = new List(); - foreach(var path in skinPaths){skinsets.Add(ThemeSkinset.Import(path));} - ThemeSkinset.all = skinsets.ToList(); - } - else{ - ThemeSkinset.all = ThemeSkinset.Import(); - } - ThemeIconset.all = lazy && !iconset.IsNull()? ThemeIconset.Import(iconset.path).AsList() : ThemeIconset.Import(); + ThemeSkinset.all = skinset.IsNull() ? ThemeSkinset.Import() : ThemeSkinset.Import(skinset.path).AsList(); + ThemeIconset.all = iconset.IsNull() ? ThemeIconset.Import() : ThemeIconset.Import(iconset.path).AsList(); Theme.all = Theme.Import(unityTheme).OrderBy(x=>x.name!="Default").ToList(); Theme.loaded = true; Theme.lazyLoaded = lazy; @@ -199,12 +192,10 @@ public static void ApplySettings(){ foreach(var variant in Theme.active.defaultVariants){Undo.RecordPref("EditorVariant"+Theme.suffix+"-"+variant,true);} Theme.changed = false; } - var skinsets = theme.skinset.path; foreach(var variant in theme.skinset.variants){ variant.active = Utility.GetPref("EditorVariant"+Theme.suffix+"-"+variant.name,false); - if(variant.active){skinsets += "|" + variant.path;} } - Utility.SetPref("EditorSkinset"+Theme.suffix,skinsets); + Utility.SetPref("EditorSkinset"+Theme.suffix,theme.skinset.name); if(!Utility.HasPref("EditorFontset"+Theme.suffix)){Utility.SetPref("EditorFontset"+Theme.suffix,theme.fontset.name);} if(!Utility.HasPref("EditorPalette"+Theme.suffix)){Utility.SetPref("EditorPalette"+Theme.suffix,theme.palette.name);} if(!Utility.HasPref("EditorIconset"+Theme.suffix)){Utility.SetPref("EditorIconset"+Theme.suffix,theme.iconset.name);}