Run config parsing after MM is done running

MM is now a hard dependency
feature-multiSDF
Andrew Cassidy 4 years ago
parent fccf52ae6e
commit 5ddf973a76

@ -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<string> _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<string>();
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);
}

Loading…
Cancel
Save