mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Run config parsing after MM is done running
MM is now a hard dependency
This commit is contained in:
parent
fccf52ae6e
commit
5ddf973a76
Binary file not shown.
@ -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…
Reference in New Issue
Block a user