public static void SaveConfigs(ConfigNode node) { node.AddValue("allowStructuralFailures", FARDebugValues.allowStructuralFailures); node.AddValue("showMomentArrows", FARDebugValues.showMomentArrows); node.AddValue("useBlizzyToolbar", FARDebugValues.useBlizzyToolbar & ToolbarManager.ToolbarAvailable); node.AddValue("aeroFailureExplosions", FARDebugValues.aeroFailureExplosions); FARActionGroupConfiguration.SaveConfiguration(); // save in off thread so that it doesn't delay scene changes MainThread.StartCoroutine(ConfigAdapter.SaveAll); config.save(); }
public static void SaveConfigs(ConfigNode node) { node.AddValue("allowStructuralFailures", FARDebugValues.allowStructuralFailures); node.AddValue("showMomentArrows", FARDebugValues.showMomentArrows); node.AddValue("useBlizzyToolbar", FARDebugValues.useBlizzyToolbar & ToolbarManager.ToolbarAvailable); node.AddValue("aeroFailureExplosions", FARDebugValues.aeroFailureExplosions); FARAeroUtil.SaveCustomAeroDataToConfig(); FARAeroStress.SaveCustomStressTemplates(); FARActionGroupConfiguration.SaveConfigruration(); GUIColors.Instance.SaveColors(); config.save(); }
public static void LoadConfigs(ConfigNode node) { config = KSP.IO.PluginConfiguration.CreateForType <FARSettingsScenarioModule>(); config.load(); bool tmp; if (node.HasValue("allowStructuralFailures") && bool.TryParse(node.GetValue("allowStructuralFailures"), out tmp)) { FARDebugValues.allowStructuralFailures = tmp; } else { FARDebugValues.allowStructuralFailures = true; } if (node.HasValue("showMomentArrows") && bool.TryParse(node.GetValue("showMomentArrows"), out tmp)) { FARDebugValues.showMomentArrows = tmp; } else { FARDebugValues.showMomentArrows = false; } if (node.HasValue("useBlizzyToolbar") && bool.TryParse(node.GetValue("useBlizzyToolbar"), out tmp)) { FARDebugValues.useBlizzyToolbar = tmp; } else { FARDebugValues.useBlizzyToolbar = false; } if (node.HasValue("aeroFailureExplosions") && bool.TryParse(node.GetValue("aeroFailureExplosions"), out tmp)) { FARDebugValues.aeroFailureExplosions = tmp; } else { FARDebugValues.aeroFailureExplosions = true; } FARAeroStress.LoadStressTemplates(); FARAeroUtil.LoadAeroDataFromConfig(); FARActionGroupConfiguration.LoadConfiguration(); FARAnimOverrides.LoadAnimOverrides(); hasScenarioChanged = true; }
private void DebugAndDataTab(GUIStyle thisStyle) { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(250)); GUILayout.Label("Debug / Cheat Options"); FARDebugValues.allowStructuralFailures = GUILayout.Toggle(FARDebugValues.allowStructuralFailures, "Allow Aero-structural Failures", thisStyle); GUILayout.Label("Editor GUI Graph Colors"); Color tmpColor = GUIColors.Instance[0]; ChangeColor("Cl", ref tmpColor, ref cLTexture); GUIColors.Instance[0] = tmpColor; tmpColor = GUIColors.Instance[1]; ChangeColor("Cd", ref tmpColor, ref cDTexture); GUIColors.Instance[1] = tmpColor; tmpColor = GUIColors.Instance[2]; ChangeColor("Cm", ref tmpColor, ref cMTexture); GUIColors.Instance[2] = tmpColor; tmpColor = GUIColors.Instance[3]; ChangeColor("L_D", ref tmpColor, ref l_DTexture); GUIColors.Instance[3] = tmpColor; FARActionGroupConfiguration.DrawGUI(); GUILayout.Label("Other Options"); // DaMichel: put it above the toolbar toggle FARDebugValues.aeroFailureExplosions = GUILayout.Toggle(FARDebugValues.aeroFailureExplosions, "Aero Failures Create Explosions", thisStyle); FARDebugValues.showMomentArrows = GUILayout.Toggle(FARDebugValues.showMomentArrows, "Show Torque Arrows in Aero Overlay", thisStyle); if (ToolbarManager.ToolbarAvailable) { bool tmp = FARDebugValues.useBlizzyToolbar; FARDebugValues.useBlizzyToolbar = GUILayout.Toggle(FARDebugValues.useBlizzyToolbar, "Use Blizzy78 Toolbar instead of Stock AppManager", thisStyle); if (tmp != FARDebugValues.useBlizzyToolbar) { 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; } } } GUILayout.EndVertical(); GUILayout.BeginVertical(); FARSettingsScenarioModule.Instance.DisplaySelection(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); }
public static void LoadConfigs(ConfigNode node) { config = KSP.IO.PluginConfiguration.CreateForType <FARSettingsScenarioModule>(); config.load(); bool tmp; if (node.HasValue("allowStructuralFailures") && bool.TryParse(node.GetValue("allowStructuralFailures"), out tmp)) { FARDebugValues.allowStructuralFailures = tmp; } else { FARDebugValues.allowStructuralFailures = true; } if (node.HasValue("showMomentArrows") && bool.TryParse(node.GetValue("showMomentArrows"), out tmp)) { FARDebugValues.showMomentArrows = tmp; } else { FARDebugValues.showMomentArrows = false; } if (node.HasValue("useBlizzyToolbar") && bool.TryParse(node.GetValue("useBlizzyToolbar"), out tmp)) { FARDebugValues.useBlizzyToolbar = tmp; } else { FARDebugValues.useBlizzyToolbar = false; } if (node.HasValue("aeroFailureExplosions") && bool.TryParse(node.GetValue("aeroFailureExplosions"), out tmp)) { FARDebugValues.aeroFailureExplosions = tmp; } else { FARDebugValues.aeroFailureExplosions = true; } FARAeroStress.LoadStressTemplates(); FARAeroUtil.LoadAeroDataFromConfig(); FARActionGroupConfiguration.LoadConfiguration(); FARAnimOverrides.LoadAnimOverrides(); Color tmpColor = GUIColors.Instance[0]; ReColorTexture(ref tmpColor, ref cLTexture); GUIColors.Instance[0] = tmpColor; tmpColor = GUIColors.Instance[1]; ReColorTexture(ref tmpColor, ref cDTexture); GUIColors.Instance[1] = tmpColor; tmpColor = GUIColors.Instance[2]; ReColorTexture(ref tmpColor, ref cMTexture); GUIColors.Instance[2] = tmpColor; tmpColor = GUIColors.Instance[3]; ReColorTexture(ref tmpColor, ref l_DTexture); GUIColors.Instance[3] = tmpColor; }