Пример #1
0
 private void applyTextureSet(string setName, bool useDefaultColors)
 {
     if (!model.isValidTextureSet(setName))
     {
         setName    = model.getDefaultTextureSet();
         textureSet = setName;
     }
     if (useDefaultColors)
     {
         TextureSet ts = Array.Find(model.modelDefinition.textureSets, m => m.name == setName);
         if (ts != null && ts.maskColors != null && ts.maskColors.Length > 0)
         {
             customColors    = new RecoloringData[3];
             customColors[0] = ts.maskColors[0];
             customColors[1] = ts.maskColors[1];
             customColors[2] = ts.maskColors[2];
         }
         else
         {
             RecoloringData dummy = new RecoloringData(Color.white, 0, 0);
             customColors = new RecoloringData[] { dummy, dummy, dummy };
         }
         saveColors(customColors);
     }
     model.enableTextureSet(textureSet, customColors);
     if (textureField != null)
     {
         model.updateTextureUIControl(partModule, textureField.name, textureSet);
     }
     SSTUModInterop.onPartTextureUpdated(part);
 }
Пример #2
0
        private void updateTextureSet(bool useDefaults)
        {
            if (mpf == null)
            {
                return;
            }
            TextureSet s = TexturesUnlimitedLoader.getTextureSet(currentTextureSet);

            RecoloringData[] colors = useDefaults ? s.maskColors : getSectionColors(string.Empty);
            Material         fm     = mpf.FairingMaterial;

            s.textureData[0].apply(fm);//TODO -- bit of an ugly hack; should at least pull a ref to whatever index that slot goes to
            s.textureData[0].apply(mpf.FairingMaterial);
            s.textureData[0].applyRecoloring(mpf.FairingMaterial, colors);
            s.textureData[0].apply(mpf.FairingConeMaterial);
            s.textureData[0].applyRecoloring(mpf.FairingConeMaterial, colors);
            List <Transform> trs = new List <Transform>();

            foreach (ProceduralFairings.FairingPanel fp in mpf.Panels)
            {
                s.enable(fp.go.transform, colors);
            }
            if (useDefaults)
            {
                recolorHandler.setColorData(colors);
            }
            SSTUModInterop.onPartTextureUpdated(part);
        }
Пример #3
0
        private void updateTextureSet(bool useDefaults)
        {
            if (mpf == null)
            {
                return;
            }
            TextureSet s = KSPShaderLoader.getTextureSet(currentTextureSet);

            RecoloringData[] colors = useDefaults ? s.maskColors : getSectionColors(string.Empty);
            Material         fm     = mpf.FairingMaterial;

            if (fm != null)
            {
                s.textureData[0].enable(fm, colors);
            }
            foreach (ProceduralFairings.FairingPanel fp in mpf.Panels)
            {
                s.enable(fp.go, colors);
            }
            if (useDefaults)
            {
                recolorHandler.setColorData(colors);
            }
            SSTUModInterop.onPartTextureUpdated(part);
        }
Пример #4
0
        private void updateTextureSet(bool useDefaults)
        {
            TextureSet s = KSPShaderLoader.getTextureSet(currentTextureSet);

            RecoloringData[] colors = useDefaults ? s.maskColors : getSectionColors(string.Empty);
            model.enableTextureSet(currentTextureSet, colors);
            if (useDefaults)
            {
                recolorHandler.setColorData(colors);
            }
            SSTUModInterop.onPartTextureUpdated(part);
        }
Пример #5
0
        private void updateFairingTextureSet(bool useDefaults)
        {
            TextureSet s = TexturesUnlimitedLoader.getTextureSet(currentTextureSet);

            RecoloringData[] colors = useDefaults ? s.maskColors : getSectionColors("Decoupler");
            fairingBase.enableTextureSet(currentTextureSet, colors);
            if (useDefaults)
            {
                recolorHandler.setColorData(colors);
            }
            SSTUModInterop.onPartTextureUpdated(part);
        }
Пример #6
0
        private void updateTextureSet(bool useDefaults)
        {
            TextureSet s = KSPShaderLoader.getTextureSet(currentTextureSet);

            RecoloringData[] colors = useDefaults ? s.maskColors : getSectionColors(string.Empty);
            int len = fairingParts.Length;

            for (int i = 0; i < len; i++)
            {
                fairingParts[i].fairingBase.enableTextureSet(currentTextureSet, colors);
            }
            if (useDefaults)
            {
                recolorHandler.setColorData(colors);
            }
            updateOpacity();
            SSTUModInterop.onPartTextureUpdated(part);
        }