private void SetupGwenTextures(Dictionary <string, string> dict) { if (dict["stableOption"] == "4") { FilledTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/gwen/overlay_{dict["stableOption"]}_full.png", ContentSource.ModFolder)); } EmptyTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/gwen/overlay_{dict["stableOption"]}.png", ContentSource.ModFolder)); seasonalVersion = SeasonalVersion.Gwen; gwenOption = dict["stableOption"]; }
private void SetStableOverlays() { if (!Config.Water) { return; } seasonalVersion = SeasonalVersion.None; usingMyTextures = false; FilledTroughOverlay = null; if (Helper.ModRegistry.IsLoaded("sonreirblah.JBuildings")) { // seasonal overlays are assigned in LateDayStarted EmptyTroughOverlay = null; seasonalVersion = SeasonalVersion.Sonr; return; } if (Helper.ModRegistry.IsLoaded("Oklinq.CleanStable")) { EmptyTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/overlay_empty.png", ContentSource.ModFolder)); return; } if (Helper.ModRegistry.IsLoaded("Elle.SeasonalBuildings")) { var data = Helper.ModRegistry.Get("Elle.SeasonalBuildings"); var path = data.GetType().GetProperty("DirectoryPath"); if (path != null && path.GetValue(data) != null) { var list = ReadConfigFile("config.json", path.GetValue(data) as string, new[] { "color palette", "stable" }, data.Manifest.Name); if (list["stable"] != "false") { EmptyTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/elle/overlay_empty_{list["color palette"]}.png", ContentSource.ModFolder)); return; } } } if (Helper.ModRegistry.IsLoaded("Elle.SeasonalVanillaBuildings")) { var data = Helper.ModRegistry.Get("Elle.SeasonalVanillaBuildings"); var path = data.GetType().GetProperty("DirectoryPath"); if (path != null && path.GetValue(data) != null) { var list = ReadConfigFile("config.json", path.GetValue(data) as string, new[] { "stable" }, data.Manifest.Name); if (list["stable"] == "true") { FilledTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/overlay_filled_tone.png", ContentSource.ModFolder)); EmptyTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/overlay_empty_tone.png", ContentSource.ModFolder)); return; } } } if (Helper.ModRegistry.IsLoaded("Gweniaczek.Medieval_stables")) { IModInfo data = Helper.ModRegistry.Get("Gweniaczek.Medieval_stables"); var path = data.GetType().GetProperty("DirectoryPath"); if (path != null && path.GetValue(data) != null) { var dict = ReadConfigFile("config.json", path.GetValue(data) as string, new[] { "stableOption" }, data.Manifest.Name); SetupGwenTextures(dict); return; } } if (Helper.ModRegistry.IsLoaded("Gweniaczek.Medieval_buildings")) { var data = Helper.ModRegistry.Get("Gweniaczek.Medieval_buildings"); var path = data.GetType().GetProperty("DirectoryPath"); if (path != null && path.GetValue(data) != null) { var dict = ReadConfigFile("config.json", path.GetValue(data) as string, new[] { "buildingsReplaced", "stableOption" }, data.Manifest.Name); if (dict["buildingsReplaced"].Contains("stable")) { SetupGwenTextures(dict); return; } } } if (Helper.ModRegistry.IsLoaded("magimatica.SeasonalVanillaBuildings")) { EmptyTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/overlay_empty_no_bucket.png", ContentSource.ModFolder)); return; } // no compatible texture mod found so we will use mine usingMyTextures = true; EmptyTroughOverlay = new Lazy <Texture2D>(() => Helper.Content.Load <Texture2D>($"assets/overlay_empty.png", ContentSource.ModFolder)); }