Exemplo n.º 1
0
        private static void addWindowFuelTypeControls(ContainerDefinition container)
        {
            GUILayout.Label("Fuel Types -- Click to add ratio, CTRL click to set ratio, SHIFT click to subtract ratio");
            ContainerFuelPreset[] presets = container.fuelPresets;
            ContainerFuelPreset   preset;

            GUILayout.BeginHorizontal();
            for (int i = 0; i < presets.Length; i++)
            {
                preset = presets[i];
                if (i > 0 && i % 4 == 0)
                {
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                }
                if (GUILayout.Button(preset.name, GUILayout.Width(175)))
                {
                    if (ctrlPressed())//ctrl == set fuel type
                    {
                        container.setFuelPreset(presets[i]);
                    }
                    else if (shiftPressed())
                    {
                        container.subtractPresetRatios(presets[i]);
                    }
                    else
                    {
                        container.addPresetRatios(presets[i]);
                    }
                }
            }
            GUILayout.EndHorizontal();
        }
Exemplo n.º 2
0
 public void addPresetRatios(ContainerDefinition container, ContainerFuelPreset preset, bool updateSymmetry)
 {
     container.addPresetRatios(preset);
     if (updateSymmetry)
     {
         foreach (Part p in part.symmetryCounterparts)
         {
             SSTUVolumeContainer symmetryModule          = p.GetComponent <SSTUVolumeContainer>();
             ContainerDefinition symmetryModuleContainer = symmetryModule.getContainer(container.name);
             ContainerFuelPreset symmetryModulePreset    = symmetryModuleContainer.internalGetFuelPreset(preset.name);
             symmetryModule.addPresetRatios(symmetryModuleContainer, symmetryModulePreset, false);
         }
     }
 }
Exemplo n.º 3
0
 public void containerFuelTypeAdded(ContainerDefinition container, ContainerFuelPreset fuelType)
 {
     container.addPresetRatios(fuelType);
     updateFuelSelections();
 }