private static void load()
        {
            MonoBehaviour.print("KSPShaderLoader - Initializing shader and texture set data.");
            ConfigNode config = GameDatabase.Instance.GetConfigNodes("TEXTURES_UNLIMITED")[0];

            logReplacements = config.GetBoolValue("logReplacements", logReplacements);
            logErrors       = config.GetBoolValue("logErrors", logErrors);
            Dictionary <string, Shader> dict = new Dictionary <string, Shader>();

            loadBundles(dict);
            buildShaderSets(dict);
            PresetColor.loadColors();
            loadTextureSets();
            applyToModelDatabase();
            MonoBehaviour.print("KSPShaderLoader - Calling PostLoad handlers");
            foreach (Action act in postLoadCallbacks)
            {
                act.Invoke();
            }
            dumpUVMaps();
        }
Esempio n. 2
0
        private void load()
        {
            //clear any existing data in case of module-manager reload
            loadedShaders.Clear();
            loadedModelShaderSets.Clear();
            iconShaders.Clear();
            loadedTextureSets.Clear();
            textureColors.Clear();
            transparentShaderData.Clear();
            Log.log("TexturesUnlimited - Initializing shader and texture set data.");
            ConfigNode[] allTUNodes = GameDatabase.Instance.GetConfigNodes("TEXTURES_UNLIMITED");
            ConfigNode   config     = Array.Find(allTUNodes, m => m.GetStringValue("name") == "default");

            configurationNode = config;

            logAll                  = config.GetBoolValue("logAll", logAll);
            logReplacements         = config.GetBoolValue("logReplacements", logReplacements);
            logErrors               = config.GetBoolValue("logErrors", logErrors);
            recolorGUIWidth         = config.GetIntValue("recolorGUIWidth");
            recolorGUITotalHeight   = config.GetIntValue("recolorGUITotalHeight");
            recolorGUISectionHeight = config.GetIntValue("recolorGUISectionHeight");
            if (config.GetBoolValue("displayDX9Warning", true))
            {
                //disable API check as long as using stock reflection system
                //doAPICheck();
            }
            loadBundles();
            buildShaderSets();
            PresetColor.loadColors();
            loadTextureSets();
            applyToModelDatabase();
            Log.log("TexturesUnlimited - Calling PostLoad handlers");
            foreach (Action act in postLoadCallbacks)
            {
                act.Invoke();
            }
            dumpUVMaps();
            fixStockBumpMaps();
            //NormMaskCreation.processBatch();
        }