From e81851df64fb2429e6a17edda2cda0b2e3967da4 Mon Sep 17 00:00:00 2001 From: Marinlestylo <45563298+Marinlestylo@users.noreply.github.com> Date: Fri, 17 Jan 2020 09:11:00 +0100 Subject: [PATCH] Fixed duplicate options changes --- ThemePacker/MainForm.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ThemePacker/MainForm.cs b/ThemePacker/MainForm.cs index e9df09d..2a5d9b3 100644 --- a/ThemePacker/MainForm.cs +++ b/ThemePacker/MainForm.cs @@ -265,17 +265,9 @@ public void Generate() tfs.Deserialize(); JObject theme = tfs.JSON; theme["Theme"]["DisplayName"] = fileName; - theme["Control Panel_Desktop"]["TileWallpaper"] = "0"; - theme["Control Panel_Desktop"]["WallpaperStyle"] = "2"; - theme["Slideshow"]["Interval"] = "60000"; - - //read and replace - string text = File.ReadAllText("temp\\super.theme"); - text = text.Replace("DisplayName=Tinderspirobot", "DisplayName=" + fileName); - text = text.Replace("Interval=1000", "Interval=" + _opb.TimeChange); - text = text.Replace("TileWallpaper=1", "TileWallpaper="+ _opb.TileWallpaper); - text = text.Replace("WallpaperStyle=0", "WallpaperStyle=" + _opb.WallPaperStyle); - File.WriteAllText("temp\\super.theme", text); + theme["Control Panel_Desktop"]["TileWallpaper"] = _opb.TileWallpaper; + theme["Control Panel_Desktop"]["WallpaperStyle"] = _opb.WallPaperStyle; + theme["Slideshow"]["Interval"] = _opb.TimeChange; tfs.JSON = theme; tfs.JsonSerialize($"temp\\themepack\\{fileName}.theme");