示例#1
0
 public override string GetInfo()
 {
     if (showInfo)
     {
         List <string> variantList;
         if (textureNames.Length > 0)
         {
             variantList = FTTools.parseNames(textureNames);
         }
         else
         {
             variantList = FTTools.parseNames(mapNames);
         }
         textureDisplayList = FTTools.parseNames(textureDisplayNames);
         StringBuilder info = new StringBuilder();
         info.AppendLine("Alternate textures available:");
         if (variantList.Count == 0)
         {
             if (variantList.Count == 0)
             {
                 info.AppendLine("None");
             }
         }
         for (int i = 0; i < variantList.Count; i++)
         {
             if (i > textureDisplayList.Count - 1)
             {
                 info.AppendLine(getTextureDisplayName(variantList[i]));
             }
             else
             {
                 info.AppendLine(textureDisplayList[i]);
             }
         }
         info.AppendLine("\nUse the DCK Next button on the right click menu or DCK Paintshop in the lower right of the screen.");
         return(info.ToString());
     }
     else
     {
         return(string.Empty);
     }
 }
示例#2
0
        // runs the kind of commands that would normally be in OnStart, if they have not already been run. In case a method is called upon externally, but values have not been set up yet
        private void initializeData()
        {
            if (!initialized)
            {
                // you can't have fuel switching without symmetry, it breaks the editor GUI.
                if (useFuelSwitchModule)
                {
                    updateSymmetry = true;
                }

                objectList         = FTTools.parseNames(objectNames, true);
                texList            = FTTools.parseNames(textureNames, true, true, textureRootFolder);
                mapList            = FTTools.parseNames(mapNames, true, true, textureRootFolder);
                textureDisplayList = FTTools.parseNames(textureDisplayNames);
                fuelTankSetupList  = FTTools.parseIntegers(fuelTankSetups);


                foreach (String targetObjectName in objectList)
                {
                    Transform[]     targetObjectTransformArray = part.FindModelTransforms(targetObjectName);
                    List <Material> matList = new List <Material>();
                    foreach (Transform t in targetObjectTransformArray)
                    {
                        if (t != null && t.gameObject.GetComponent <Renderer>() != null) // check for if the object even has a mesh. otherwise part list loading crashes
                        {
                            Material targetMat = t.gameObject.GetComponent <Renderer>().material;
                            if (targetMat != null)
                            {
                                if (!matList.Contains(targetMat))
                                {
                                    matList.Add(targetMat);
                                }
                            }
                        }
                    }
                    targetMats.Add(matList);
                }
                initialized = true;
            }
        }