void OnGUI() { if (HighLogic.LoadedScene != GameScenes.LOADING) { return; } if (string.IsNullOrEmpty(QSaveGame.LastUsed)) { return; } GUI.skin = HighLogic.Skin; QKey.DrawSetKey(); if (WindowSettings) { RectSettings = ClickThruBlocker.GUILayoutWindow(1545177, RectSettings, DrawSettings, RegisterToolbar.MOD + " " + RegisterToolbar.VERSION); } GUILayout.BeginArea(RectGUI); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); GUILayout.Label(StopWatchText); if (QSettings.Instance.Enabled) { if (GUILayout.Button("◄", GUILayout.Width(20), GUILayout.Height(20))) { QSaveGame.Prev(); } GUILayout.Label(!string.IsNullOrEmpty(QSaveGame.LastUsed) ? Localizer.Format("quickstart_lastGame", QSaveGame.LastUsed) : Localizer.Format("quickstart_noLastGame")); if (GUILayout.Button("►", QStyle.Button, GUILayout.Width(20), GUILayout.Height(20))) { QSaveGame.Next(); } } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); if (!string.IsNullOrEmpty(QSaveGame.LastUsed)) { GUILayout.BeginHorizontal(); QSettings.Instance.Enabled = GUILayout.Toggle(QSettings.Instance.Enabled, Localizer.Format("quickstart_enable", RegisterToolbar.MOD), LabelWidth.Enabled); if (QSettings.Instance.Enabled) { if (QSettings.Instance.evenlySpaceToggles) { GUILayout.FlexibleSpace(); } if (GUILayout.Toggle(QSettings.Instance.gameScene == (int)GameScenes.SPACECENTER, Localizer.Format( QSettings.Instance.abbreviations ? "quickstart_sc_abbr" : "quickstart_sc" ), LabelWidth.KSC)) { if (QSettings.Instance.gameScene != (int)GameScenes.SPACECENTER) { QSettings.Instance.gameScene = (int)GameScenes.SPACECENTER; } } if (QSettings.Instance.evenlySpaceToggles) { GUILayout.FlexibleSpace(); } if (GUILayout.Toggle(QSettings.Instance.editorFacility == (int)EditorFacility.VAB && QSettings.Instance.gameScene == (int)GameScenes.EDITOR, Localizer.Format( QSettings.Instance.abbreviations?"quickstart_vab_abbr": "quickstart_vab" ), LabelWidth.VAB)) { if (QSettings.Instance.gameScene != (int)GameScenes.EDITOR || QSettings.Instance.editorFacility != (int)EditorFacility.VAB) { QSettings.Instance.gameScene = (int)GameScenes.EDITOR; QSettings.Instance.editorFacility = (int)EditorFacility.VAB; } } if (QSettings.Instance.evenlySpaceToggles) { GUILayout.FlexibleSpace(); } if (GUILayout.Toggle(QSettings.Instance.editorFacility == (int)EditorFacility.SPH && QSettings.Instance.gameScene == (int)GameScenes.EDITOR, Localizer.Format( QSettings.Instance.abbreviations ? "quickstart_sph_abbr" : "quickstart_sph" ), LabelWidth.SPH)) { if (QSettings.Instance.gameScene != (int)GameScenes.EDITOR || QSettings.Instance.editorFacility != (int)EditorFacility.SPH) { QSettings.Instance.gameScene = (int)GameScenes.EDITOR; QSettings.Instance.editorFacility = (int)EditorFacility.SPH; } } if (QSettings.Instance.evenlySpaceToggles) { GUILayout.FlexibleSpace(); } if (GUILayout.Toggle(QSettings.Instance.gameScene == (int)GameScenes.TRACKSTATION, Localizer.Format("quickstart_ts"), LabelWidth.TrackingStation)) { if (QSettings.Instance.gameScene != (int)GameScenes.TRACKSTATION) { QSettings.Instance.gameScene = (int)GameScenes.TRACKSTATION; } } if (QSettings.Instance.evenlySpaceToggles) { GUILayout.FlexibleSpace(); } GUI.enabled = !string.IsNullOrEmpty(QuickStart_Persistent.vesselID); if (GUILayout.Toggle(QSettings.Instance.gameScene == (int)GameScenes.FLIGHT, (!string.IsNullOrEmpty(QSaveGame.vesselName) ? Localizer.Format("quickstart_lastVessel", QSaveGame.vesselName, QSaveGame.vesselType) : Localizer.Format("quickstart_noVessel")), LabelWidth.Vessel)) { if (QSettings.Instance.gameScene != (int)GameScenes.FLIGHT) { QSettings.Instance.gameScene = (int)GameScenes.FLIGHT; } } GUI.enabled = true; GUILayout.FlexibleSpace(); if (GUILayout.Button(Localizer.Format("quickstart_settings"), QStyle.Button, GUILayout.Height(20))) { Settings(); } } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); GUILayout.EndArea(); }
private void OnGUI() { if (HighLogic.LoadedScene != GameScenes.LOADING) { return; } if (string.IsNullOrEmpty(QSaveGame.LastUsed)) { return; } GUI.skin = HighLogic.Skin; GUILayout.BeginArea(RectGUI); GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); if (QSettings.Instance.Enabled) { GUILayout.Label(string.Format("[{0}] {1}", QuickStart.MOD, (!string.IsNullOrEmpty(QSaveGame.LastUsed) ? "Last game found: <color=white><b>" + QSaveGame.LastUsed + "</b></color>" : "<b><color=#000000>No last game found</color></b>"))); if (GUILayout.Button("►", Button, GUILayout.Width(20), GUILayout.Height(20))) { QSaveGame.Next(); } } GUILayout.EndHorizontal(); if (!string.IsNullOrEmpty(QSaveGame.LastUsed)) { GUILayout.BeginHorizontal(); QSettings.Instance.Enabled = GUILayout.Toggle(QSettings.Instance.Enabled, "Enable " + QuickStart.MOD, GUILayout.Width(250)); if (QSettings.Instance.Enabled) { GUILayout.FlexibleSpace(); if (GUILayout.Toggle(QSettings.Instance.gameScene == (int)GameScenes.SPACECENTER, "Space Center", GUILayout.Width(250))) { if (QSettings.Instance.gameScene != (int)GameScenes.SPACECENTER) { QSettings.Instance.gameScene = (int)GameScenes.SPACECENTER; } } GUILayout.FlexibleSpace(); if (GUILayout.Toggle(QSettings.Instance.editorFacility == (int)EditorFacility.VAB && QSettings.Instance.gameScene == (int)GameScenes.EDITOR, "Vehicle Assembly Building", GUILayout.Width(250))) { if (QSettings.Instance.gameScene != (int)GameScenes.EDITOR || QSettings.Instance.editorFacility != (int)EditorFacility.VAB) { QSettings.Instance.gameScene = (int)GameScenes.EDITOR; QSettings.Instance.editorFacility = (int)EditorFacility.VAB; } } GUILayout.FlexibleSpace(); if (GUILayout.Toggle(QSettings.Instance.editorFacility == (int)EditorFacility.SPH && QSettings.Instance.gameScene == (int)GameScenes.EDITOR, "Space Plane Hangar", GUILayout.Width(250))) { if (QSettings.Instance.gameScene != (int)GameScenes.EDITOR || QSettings.Instance.editorFacility == (int)EditorFacility.SPH) { QSettings.Instance.gameScene = (int)GameScenes.EDITOR; QSettings.Instance.editorFacility = (int)EditorFacility.SPH; } } GUILayout.FlexibleSpace(); if (GUILayout.Toggle(QSettings.Instance.gameScene == (int)GameScenes.TRACKSTATION, "Tracking Station", GUILayout.Width(250))) { if (QSettings.Instance.gameScene != (int)GameScenes.TRACKSTATION) { QSettings.Instance.gameScene = (int)GameScenes.TRACKSTATION; } } GUILayout.FlexibleSpace(); GUI.enabled = !string.IsNullOrEmpty(QuickStart_Persistent.vesselID); if (GUILayout.Toggle(QSettings.Instance.gameScene == (int)GameScenes.FLIGHT, (!string.IsNullOrEmpty(QSaveGame.vesselName) ? string.Format("Last Vessel: {0}({1})", QSaveGame.vesselName, QSaveGame.vesselType) : "No vessel found"), GUILayout.Width(300))) { if (QSettings.Instance.gameScene != (int)GameScenes.FLIGHT) { QSettings.Instance.gameScene = (int)GameScenes.FLIGHT; } } } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); GUILayout.EndArea(); }