From 5268435693473a6d7b49c9772377f118a9cb8c42 Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Tue, 2 Jun 2020 17:14:52 -0700 Subject: [PATCH] Run config parsing after MM is done running MM is now a hard dependency --- .../GameData/ConformalDecals/Plugins/ConformalDecals.dll | 4 ++-- Source/ConformalDecals/ConformalDecalConfig.cs | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll index 7781107..60ad6c4 100644 --- a/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll +++ b/Distribution/GameData/ConformalDecals/Plugins/ConformalDecals.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:134bc69201f8ed0b03f147552f6b8cd080a9e9e715a0355209f27afdfae16432 -size 28160 +oid sha256:b382a49057472d4ba44cb722cd3a1e6956800b06e085e967e17708721dd11be2 +size 28672 diff --git a/Source/ConformalDecals/ConformalDecalConfig.cs b/Source/ConformalDecals/ConformalDecalConfig.cs index 7a0f27e..d1e990c 100644 --- a/Source/ConformalDecals/ConformalDecalConfig.cs +++ b/Source/ConformalDecals/ConformalDecalConfig.cs @@ -2,8 +2,7 @@ using System.Collections.Generic; using UnityEngine; namespace ConformalDecals { - [KSPAddon(KSPAddon.Startup.Instantly, true)] - public class ConformalDecalConfig : MonoBehaviour { + public static class ConformalDecalConfig { private static List _shaderBlacklist; public static bool IsBlacklisted(Shader shader) { @@ -14,7 +13,7 @@ namespace ConformalDecals { return _shaderBlacklist.Contains(shaderName); } - private void ParseConfig(ConfigNode node) { + private static void ParseConfig(ConfigNode node) { foreach (var blacklist in node.GetNodes("SHADERBLACKLIST")) { foreach (var shaderName in blacklist.GetValuesList("shader")) { _shaderBlacklist.Add(shaderName); @@ -22,13 +21,13 @@ namespace ConformalDecals { } } - private void Start() { + public static void ModuleManagerPostLoad() { _shaderBlacklist = new List(); var configs = GameDatabase.Instance.GetConfigs("CONFORMALDECALS"); if (configs.Length > 0) { - Debug.Log("DecalConfig loading config"); + Debug.Log("ConformalDecals: loading config"); foreach (var config in configs) { ParseConfig(config.config); }