SSTUTools.TankSet.getTankDescriptions C# (CSharp) Method

getTankDescriptions() public method

public getTankDescriptions ( ) : string[]
return string[]
        public string[] getTankDescriptions()
        {
            int len = modelData.Count;
            string[] names = new string[len];
            for (int i = 0; i < len; i++)
            {
                names[i] = String.IsNullOrEmpty(modelData[i].variantName) ? modelData[i].name : modelData[i].variantName;
            }
            return names;
        }

Usage Example

Example #1
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            initialize();

            string[] groupNames = TankSet.getSetNames(tankSets);
            this.updateUIChooseOptionControl("currentTankSet", groupNames, groupNames, true, currentTankSet);

            string[] names = currentTankSetModule.getModelNames();
            string[] descs = currentTankSetModule.getTankDescriptions();
            this.updateUIChooseOptionControl("currentTankType", names, descs, true, currentTankType);

            if (maxTankDiameter == minTankDiameter)
            {
                Fields["currentTankDiameter"].guiActiveEditor = false;
            }
            else
            {
                this.updateUIFloatEditControl("currentTankDiameter", minTankDiameter, maxTankDiameter, tankDiameterIncrement * 2, tankDiameterIncrement, tankDiameterIncrement * 0.05f, true, currentTankDiameter);
            }
            updateAvailableVariants();
            updateUIScaleControls();

            currentNoseModule.updateTextureUIControl(this, "currentNoseTexture", currentNoseTexture);
            currentMainTankModule.updateTextureUIControl(this, "currentTankTexture", currentTankTexture);
            currentMountModule.updateTextureUIControl(this, "currentMountTexture", currentMountTexture);

            bool useModelSelectionGUI = HighLogic.CurrentGame.Parameters.CustomParams <SSTUGameSettings>().useModelSelectGui;

            Events["selectNoseEvent"].guiActiveEditor  = useModelSelectionGUI;
            Events["selectMountEvent"].guiActiveEditor = useModelSelectionGUI;

            Fields["currentTankDiameter"].uiControlEditor.onFieldChanged      = tankDiameterUpdated;
            Fields["currentTankVerticalScale"].uiControlEditor.onFieldChanged = tankHeightScaleUpdated;
            Fields["currentTankSet"].uiControlEditor.onFieldChanged           = tankSetUpdated;
            Fields["currentTankType"].uiControlEditor.onFieldChanged          = tankTypeUpdated;
            Fields["currentNoseType"].uiControlEditor.onFieldChanged          = noseTypeUpdated;
            Fields["currentMountType"].uiControlEditor.onFieldChanged         = mountTypeUpdated;

            Fields["currentNoseTexture"].uiControlEditor.onFieldChanged  = onNoseTextureUpdated;
            Fields["currentTankTexture"].uiControlEditor.onFieldChanged  = onTankTextureUpdated;
            Fields["currentMountTexture"].uiControlEditor.onFieldChanged = onMountTextureUpdated;

            Fields["currentTankSet"].guiActiveEditor   = tankSets.Length > 1;
            Fields["currentTankType"].guiActiveEditor  = currentTankSetModule.Length > 1;
            Fields["currentNoseType"].guiActiveEditor  = !useModelSelectionGUI && noseModules.Length > 1;
            Fields["currentMountType"].guiActiveEditor = !useModelSelectionGUI && mountModules.Length > 1;

            SSTUStockInterop.fireEditorUpdate();
            SSTUModInterop.onPartGeometryUpdate(part, true);
            if (HighLogic.LoadedSceneIsEditor)
            {
                GameEvents.onEditorShipModified.Add(new EventData <ShipConstruct> .OnEvent(onEditorVesselModified));
            }
        }
All Usage Examples Of SSTUTools.TankSet::getTankDescriptions