private void WindowLayout_SettingsIcons() { Boolean blnTemp = false; GUILayout.Label("Common Toolbar Integration (By Blizzy78)", KACResources.styleAddSectionHeading); GUILayout.BeginVertical(KACResources.styleAddFieldAreas); if (parentBehaviour.BlizzyToolbarIsAvailable) { if (DrawCheckbox(ref Settings.UseBlizzyToolbarIfAvailable, "Use Toolbar Button instead of KAC Button")) { parentBehaviour.DestroyToolbarButton(btnToolbarKAC); if (Settings.UseBlizzyToolbarIfAvailable) { parentBehaviour.InitToolbarButton(); } Settings.Save(); } } else { GUILayout.BeginHorizontal(); GUILayout.Label("Get the Common Toolbar:", KACResources.styleAddHeading); GUILayout.FlexibleSpace(); if (GUILayout.Button("Click here", KACResources.styleContent)) { Application.OpenURL("http://forum.kerbalspaceprogram.com/threads/60863"); } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); int MinimalDisplayChoice = (int)Settings.WindowMinimizedType; GUILayout.Label("Minimal Mode", KACResources.styleAddSectionHeading); GUILayout.BeginVertical(KACResources.styleAddFieldAreas); GUILayout.BeginHorizontal(); GUILayout.Label("Display What:", KACResources.styleAddHeading, GUILayout.Width(120)); if (DrawRadioList(ref MinimalDisplayChoice, "Next Alarm", "Oldest Alarm")) { Settings.WindowMinimizedType = (MiminalDisplayType)MinimalDisplayChoice; Settings.SaveConfig(); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); DrawIconPos("Flight Mode", false, ref blnTemp, ref Settings.IconPos, ref Settings.WindowVisible); DrawIconPos("Space Center", true, ref Settings.IconShow_SpaceCenter, ref Settings.IconPos_SpaceCenter, ref Settings.WindowVisible_SpaceCenter); DrawIconPos("Tracking Station", true, ref Settings.IconShow_TrackingStation, ref Settings.IconPos_TrackingStation, ref Settings.WindowVisible_TrackingStation); }
private void WindowLayout_SettingsGlobal() { //Preferences GUILayout.Label("Plugin Preferences", KACResources.styleAddSectionHeading); GUILayout.BeginVertical(KACResources.styleAddFieldAreas); //two columns GUILayout.BeginHorizontal(); if (DrawTextBox(ref Settings.AlarmListMaxAlarms, KACResources.styleAddField, GUILayout.Width(45))) { Settings.Save(); } GUILayout.Label("Max alarms before scrolling the list", KACResources.styleAddHeading); GUILayout.EndHorizontal(); if (DrawCheckbox(ref Settings.HideOnPause, "Hide Alarm Clock when game is paused")) { Settings.Save(); } if (DrawCheckbox(ref Settings.ShowTooltips, "Show Tooltips on Mouse Hover")) { Settings.Save(); } int intTimeFormat = (int)Settings.TimeFormat; GUILayout.BeginHorizontal(); GUILayout.Label("Time Format:", KACResources.styleAddHeading, GUILayout.Width(90)); if (DrawRadioList(ref intTimeFormat, new String[] { "UT", "KSP Time", "Normal Time" })) { Settings.TimeFormat = (KACTime.PrintTimeFormat)intTimeFormat; Settings.SaveConfig(); } GUILayout.EndHorizontal(); if (DrawCheckbox(ref Settings.AllowJumpFromViewOnly, "Allow Ship Jump in Space Center and Tracking Station")) { Settings.Save(); } if (DrawCheckbox(ref Settings.AllowJumpToAsteroid, "Allow Ship Jump to Asteroids")) { Settings.Save(); } //if (DrawCheckbox(ref Settings.TimeAsUT, "Display Times as UT (instead of Date/Time)")) // Settings.Save(); GUILayout.EndVertical(); GUIContent Saveheader = new GUIContent("Save File Backups", "This option will save your persistent and quicksave files prior to switching ships using the KAC Jump buttons"); GUILayout.Label(Saveheader, KACResources.styleAddSectionHeading); GUILayout.BeginVertical(KACResources.styleAddFieldAreas, GUILayout.Height(64)); if (DrawCheckbox(ref Settings.BackupSaves, "Backup Saves on Ship Jump")) { Settings.Save(); } if (DrawCheckbox(ref Settings.CancelFlightModeJumpOnBackupFailure, "Cancel Jump if Backup Fails (Flight Mode Only)")) { Settings.Save(); } GUILayout.BeginHorizontal(); GUILayout.Label("Backups to Keep:", KACResources.styleAddHeading, GUILayout.Width(110)); GUILayout.Label(Settings.BackupSavesToKeep.ToString(), KACResources.styleAddXferName, GUILayout.Width(25)); Settings.BackupSavesToKeep = (int)Math.Floor(GUILayout.HorizontalSlider((float)Settings.BackupSavesToKeep, 3, 50)); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Label("Time Warp/Math Checks", KACResources.styleAddSectionHeading); GUILayout.BeginVertical(KACResources.styleAddFieldAreas); GUILayout.BeginHorizontal(); GUILayout.Label("Checks per Sec:", KACResources.styleAddHeading, GUILayout.Width(100)); if (DrawButtonList(ref intChecksPerSecChoice, contChecksPerSecChoices)) { switch (intChecksPerSecChoice) { case 0: Settings.BehaviourChecksPerSec = 10; break; case 1: Settings.BehaviourChecksPerSec = 20; break; case 2: Settings.BehaviourChecksPerSec = 50; break; case 3: Settings.BehaviourChecksPerSec = 100; break; default: Settings.BehaviourChecksPerSec = Settings.BehaviourChecksPerSec_Custom; break; } parentBehaviour.SetupRepeatingFunction_BehaviourUpdate(Settings.BehaviourChecksPerSec); Settings.SaveConfig(); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Label("Alarm Defaults", KACResources.styleAddSectionHeading); GUILayout.BeginVertical(KACResources.styleAddFieldAreas, GUILayout.Height(intAlarmDefaultsBoxheight)); //Alarm position GUILayout.BeginHorizontal(); GUILayout.Label("Alarm Position:", KACResources.styleAddHeading, GUILayout.Width(90)); if (DrawRadioList(ref Settings.AlarmPosition, "Left", "Center", "Right")) { Settings.Save(); } GUILayout.EndHorizontal(); //Default Alarm Action if (DrawAlarmActionChoice(ref Settings.AlarmDefaultAction, "Default Action:", 90)) { Settings.Save(); } if (DrawTimeEntry(ref timeDefaultMargin, KACTimeStringArray.TimeEntryPrecisionEnum.Hours, "Default Margin:", 100)) { //convert it and save it in the settings Settings.AlarmDefaultMargin = timeDefaultMargin.UT; Settings.Save(); } if (DrawCheckbox(ref Settings.AlarmDeleteOnClose, "Delete Alarm On Close")) { Settings.Save(); } GUILayout.EndVertical(); }