private void DebugAndDataTab(GUIStyle thisStyle)
        {
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical();
            GUILayout.Label("Part Right-Click Menu");
            FARDebugValues.displayForces       = GUILayout.Toggle(FARDebugValues.displayForces, "Display Aero Forces", thisStyle);
            FARDebugValues.displayCoefficients = GUILayout.Toggle(FARDebugValues.displayCoefficients, "Display Coefficients", thisStyle);
            FARDebugValues.displayShielding    = GUILayout.Toggle(FARDebugValues.displayShielding, "Display Shielding", thisStyle);
            GUILayout.Label("Debug / Cheat Options");
            FARDebugValues.useSplinesForSupersonicMath = GUILayout.Toggle(FARDebugValues.useSplinesForSupersonicMath, "Use Splines for Supersonic Math", thisStyle);
            FARDebugValues.allowStructuralFailures     = GUILayout.Toggle(FARDebugValues.allowStructuralFailures, "Allow Aero-structural Failures", thisStyle);
            GUILayout.Label("Editor GUI Graph Colors");
            ChangeColor("Cl", ref FAREditorGUI.clColor, ref cLTexture);
            ChangeColor("Cd", ref FAREditorGUI.cdColor, ref cDTexture);
            ChangeColor("Cm", ref FAREditorGUI.cmColor, ref cMTexture);
            ChangeColor("L_D", ref FAREditorGUI.l_DColor, ref l_DTexture);


            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Other Options"); // DaMichel: put it above the toolbar toggle
            GUILayout.BeginVertical();
            FARDebugValues.aeroFailureExplosions = GUILayout.Toggle(FARDebugValues.aeroFailureExplosions, "Aero Failures Create Explosions", thisStyle);
            if (ToolbarManager.ToolbarAvailable)
            {
                FARDebugValues.useBlizzyToolbar = GUILayout.Toggle(FARDebugValues.useBlizzyToolbar, "Use Blizzy78 Toolbar instead of Stock AppManager", thisStyle);
                bool tmp = FARDebugValues.useBlizzyToolbar;

                if (tmp != FARDebugValues.useBlizzyToolbar)
                {
                    if (FARDebugButtonStock != null)
                    {
                        ApplicationLauncher.Instance.RemoveModApplication(FARDebugButtonStock);
                    }

                    if (FARDebugButtonBlizzy != null)
                    {
                        FARDebugButtonBlizzy.Destroy();
                    }

                    if (FARDebugValues.useBlizzyToolbar)
                    {
                        FARDebugButtonBlizzy             = ToolbarManager.Instance.add("ferram4", "FARDebugButtonBlizzy");
                        FARDebugButtonBlizzy.TexturePath = "FerramAerospaceResearch/Textures/icon_button_blizzy";
                        FARDebugButtonBlizzy.ToolTip     = "FAR Debug Options";
                        FARDebugButtonBlizzy.OnClick    += (e) => debugMenu = !debugMenu;
                    }
                    else
                    {
                        GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady);
                    }
                }
            }
            FARActionGroupConfiguration.DrawGUI();
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }
Пример #2
0
        public static void LoadConfigs()
        {
            config = KSP.IO.PluginConfiguration.CreateForType <FARDebugOptions>();
            config.load();
            FARDebugValues.displayForces               = Convert.ToBoolean(config.GetValue("displayForces", "false"));
            FARDebugValues.displayCoefficients         = Convert.ToBoolean(config.GetValue("displayCoefficients", "false"));
            FARDebugValues.displayShielding            = Convert.ToBoolean(config.GetValue("displayShielding", "false"));
            FARDebugValues.useSplinesForSupersonicMath = Convert.ToBoolean(config.GetValue("useSplinesForSupersonicMath", "true"));
            FARDebugValues.allowStructuralFailures     = Convert.ToBoolean(config.GetValue("allowStructuralFailures", "true"));

            FARDebugValues.useBlizzyToolbar = Convert.ToBoolean(config.GetValue("useBlizzyToolbar", "false"));

            FARAeroStress.LoadStressTemplates();
            FARPartClassification.LoadClassificationTemplates();
            FARAeroUtil.LoadAeroDataFromConfig();
            FARActionGroupConfiguration.LoadConfiguration();
        }
Пример #3
0
        public static void SaveConfigs()
        {
            config.SetValue("displayForces", FARDebugValues.displayForces.ToString());
            config.SetValue("displayCoefficients", FARDebugValues.displayCoefficients.ToString());
            config.SetValue("displayShielding", FARDebugValues.displayShielding.ToString());

            config.SetValue("useSplinesForSupersonicMath", FARDebugValues.useSplinesForSupersonicMath.ToString());
            config.SetValue("allowStructuralFailures", FARDebugValues.allowStructuralFailures.ToString());

            config.SetValue("useBlizzyToolbar", FARDebugValues.useBlizzyToolbar.ToString());

            FARDebugValues.useBlizzyToolbar &= ToolbarManager.ToolbarAvailable;

            FARAeroUtil.SaveCustomAeroDataToConfig();
            FARPartClassification.SaveCustomClassificationTemplates();
            FARAeroStress.SaveCustomStressTemplates();
            FARActionGroupConfiguration.SaveConfigruration();
            config.save();
        }
 // Is constructed each time a part module instance is created.
 // The current AG seems to be stored elsewhere so base.actionGroup
 // is only used for the initial assignment.
 public FARAction(string guiName, int actionIdentifier)
     : base(guiName)
 {
     base.actionGroup = FARActionGroupConfiguration.map(actionIdentifier);
 }