Example #1
0
 public static void UnitSelectionGrid <T>(ref GUIUnits.Units <T> units)
 {
     GUILayout.BeginVertical();
     GUILayout.Box(units.UnitTypeName + " Units:", LeftLabel, normalWidth);
     units = GUIUnits.UnitsAtIndexGUI <T>(GUILayout.SelectionGrid(units.IndexGUI, GUIUnits.UnitNamesGUI <T>(), GUIUnits.UnitsCountGUI <T>(), ButtonToggle, wideWidth));
     GUILayout.EndHorizontal();
 }
Example #2
0
        public static void LoadSettings(ref KSP.IO.PluginConfiguration config)
        {
            UnitsSettingsWindowPos = config.GetValue("unitsSettingsWindowPos", new Rect());

            PressureUnits    = GUIUnits.UnitsFromConfig <GUIUnits.Pressure>(ref config, GUIUnits.Pressure.kPa);
            TemperatureUnits = GUIUnits.UnitsFromConfig <GUIUnits.Temperature>(ref config, GUIUnits.Temperature.kelvin);
            ForceUnits       = GUIUnits.UnitsFromConfig <GUIUnits.Force>(ref config, GUIUnits.Force.kN);
            IspUnits         = GUIUnits.UnitsFromConfig <GUIUnits.Isp>(ref config, GUIUnits.Isp.s);
            TSFCUnits        = GUIUnits.UnitsFromConfig <GUIUnits.TSFC>(ref config, GUIUnits.TSFC.kg__kgf_h);
        }