void CloseDialog() { Vector3 rt = uiDialog.RTrf.position; geometry = new Rect(rt.x / Screen.width + 0.5f, rt.y / Screen.height + 0.5f, 300, 300); uiDialog.Dismiss(); }
private void SaveCurrentProfile() { if (popup != null) { popup.Dismiss(); } else { editText = ScienceAlertProfileManager.ActiveProfile.name; } // Confirm overwrite an existing non-active profile if (ScienceAlertProfileManager.HaveStoredProfile(editText) && ScienceAlertProfileManager.ActiveProfile.name != editText) { popup = PopupDialog.SpawnPopupDialog(new MultiOptionDialog("", "", $"Profile '{editText}' already exists!", HighLogic.UISkin, new DialogGUIButton("Overwrite", SaveCurrentProfileOverwrite), new DialogGUIButton("Cancel", DismissPopup)), false, HighLogic.UISkin); } else { SaveCurrentProfileOverwrite(); // save to go ahead and save since no existing profile with this key exists } }
private void SaveCurrentProfile() { if (popup != null) { popup.Dismiss(); } else { editText = ScienceAlertProfileManager.ActiveProfile.name; } // Confirm overwrite an existing non-active profile if (ScienceAlertProfileManager.HaveStoredProfile(editText) && ScienceAlertProfileManager.ActiveProfile.name != editText) { popup = PopupDialog.SpawnPopupDialog(new MultiOptionDialog("", "", Localizer.Format("#ScienceAlert_label20", editText), HighLogic.UISkin, //$"Profile '{}' already exists!" new DialogGUIButton(Localizer.Format("#ScienceAlert_button13"), SaveCurrentProfileOverwrite), //"Overwrite" new DialogGUIButton(Localizer.Format("#ScienceAlert_button10"), DismissPopup)), //"Cancel" false, HighLogic.UISkin); } else { SaveCurrentProfileOverwrite(); // save to go ahead and save since no existing profile with this key exists } }
private void OnFalse() { if (_dialog == null) { return; } _dialog.Dismiss(); _dialog = null; }
public void UndisplayData() { if (reportWindow != null) { Vector3 v = reportWindow.RTrf.position; reportPosition = new Rect(v.x / Screen.width + 0.5f, v.y / Screen.height + 0.5f, 420, 50); reportWindow.Dismiss(); } }
/// <summary> /// Hides the Health Monitor window /// </summary> public void UndisplayData() { if (monitorWindow != null) { Vector3 v = monitorWindow.RTrf.position; monitorPosition = new Rect(v.x / Screen.width + 0.5f, v.y / Screen.height + 0.5f, gridWidthMain + 20, 50); monitorWindow.Dismiss(); } }
public void ShowDialog() { if (dialog != null) { dialog.Dismiss(); } Rect windowRect = new Rect(0.5f, 0.5f, 350f, 500f); MultiOptionDialog missionList = new MultiOptionDialog("Start mission", string.Empty, "Start mission", skin, windowRect, this.CreateMissionListDialog()); dialog = PopupDialog.SpawnPopupDialog(missionList, false, skin, true, string.Empty); }
internal static void Reload() { if (dialog != null) { WindowManager2.SavePosition(dialog); dialog.Dismiss(); } dialog = null; optionDialog = null; Open(); }
/* * void Circularize() { * var maneuver = new Maneuver.Circularize(FlightGlobals.ActiveVessel, FlightGlobals.ActiveVessel.orbit, Planetarium.GetUniversalTime()); * maneuver.PlaceManeuverNode(); * } * * void Ellipticize() { * var maneuver = new Maneuver.Ellipticize(FlightGlobals.ActiveVessel, FlightGlobals.ActiveVessel.orbit, Planetarium.GetUniversalTime(), ellip_PeA, ellip_ApA); * maneuver.PlaceManeuverNode(); * } * * void Periapsis() { * var maneuver = new Maneuver.Periapsis(FlightGlobals.ActiveVessel, FlightGlobals.ActiveVessel.orbit, Planetarium.GetUniversalTime(), periap_PeA); * maneuver.PlaceManeuverNode(); * } * * void Apoapsis() { * var maneuver = new Maneuver.Apoapsis(FlightGlobals.ActiveVessel, FlightGlobals.ActiveVessel.orbit, Planetarium.GetUniversalTime(), apoap_ApA); * maneuver.PlaceManeuverNode(); * } */ public void DismissWindow() { if (window != null) { window.Dismiss(); } }
public void Close() { if (_activePopup != null) { _activePopup.Dismiss(); _activePopup = null; Unhide(); } else if (_miniSettings != null) { // WTF SQUAD? _miniSettings.GetType().GetMethod("Dismiss", BindingFlags.NonPublic | BindingFlags.Instance); } else { isOpen = false; //_display = false; InputLockManager.RemoveControlLock("KRASHSimPauseMenu"); Log.Info("Close: FlightDriver.SetPause (false)"); FlightDriver.SetPause(false); Log.Info("FlightDriver.Pause: " + FlightDriver.Pause.ToString()); } }
private void popupDismiss() { if (transferDialog != null) { transferDialog.Dismiss(); } }
void CloseDialog() { if (_uiDialog != null) { _uiDialog.Dismiss(); } }
internal static void Close() { if (dialog != null) { dialog.Dismiss(); } dialog = null; }
private void SwitchMode() { if (uiDialog != null) { uiDialog.Dismiss(); } if (!invokingUi) { randomKerbals = !randomKerbals; invokingUi = true; Invoke(nameof(SwitchMode), SwitchWindowTime); return; } uiDialog = randomKerbals ? RandomKerbalDialog() : CustomKerbalDialog(); invokingUi = false; }
public static void OnDestroy() { if (popup_dialog != null) { popup_dialog.Dismiss(); popup_dialog = null; } }
public void Hide() { if (popupDialog != null) { SaveWindowPosition(); popupDialog.Dismiss(); popupDialog = null; } }
private void DeSpawn() { if (popup_dialog != null) { popup_dialog.Dismiss(); } popup_dialog = null; }
/// <summary>Creates a simple modal dialog.</summary> /// <param name="title">The title of the dialog.</param> /// <param name="msg">The string to present in the dialog.</param> void ShowCompletionDialog(string title, string msg) { if (currentDialog != null) { currentDialog.Dismiss(); } currentDialog = PopupDialog.SpawnPopupDialog( new MultiOptionDialog( "StringsExportedDlg", msg, title, null, new DialogGUIButton(CloseDialogBtnTxt, () => { currentDialog.Dismiss(); currentDialog = null; })), false, null); }
/// <summary> /// Save the settings and close the visible dialog, if any. /// </summary> public void Dismiss() { if (dialog != null) { Settings.Instance.Save(); dialog.Dismiss(); dialog = null; } }
/// <summary> /// Close and deallocate the dialog /// </summary> public void dismiss() { if (popupDialog != null) { OnPreDismiss(); popupDialog.Dismiss(); popupDialog = null; } }
public void DismissConfirmDialog() { confirmDeleteDialog.Dismiss(); confirmDeleteDialog = null; if (dialog != null) { dialog.gameObject.SetActive(true); } }
internal static void Close() { if (dialog != null) { dialog.Dismiss(); } dialog = null; selectedSite = null; staticInstance = null; }
private void onAppLauncherHide() { guiVisible = false; ToggleIcon(); if (settingsMenu != null) { settingsMenu.Dismiss(); settingsMenu = null; } }
private void DismissDialog() { if (_dialog == null) { return; } _dialog.Dismiss(); _dialog = null; }
public void DismissSaveDialog() { if (saveDialog != null) { saveDialog.Dismiss(); saveDialog = null; } onDismissCallback(); Destroy(base.gameObject); }
internal static void Close() { if (dialog != null) { WindowManager.SavePosition(dialog); dialog.Dismiss(); } dialog = null; optionDialog = null; }
internal static void Close() { if (dialog != null) { WindowManager2.SavePosition(dialog); dialog.Dismiss(); } dialog = null; optionDialog = null; InputLockManager.RemoveControlLock("KK_KSC"); }
private void ButtonOnFalse() { if (showgui && drewgui) { position = gui.GetComponent <RectTransform>().position; position.x = (position.x + posInitOffset.x) / Screen.width + 0.5f; position.y = (position.y + posInitOffset.y) / Screen.height + 0.5f; Util.Log("Save GUI pos: " + position.ToString()); } showgui = false; gui.Dismiss(); }
private static void UpsertDialog(string message) { if (string.IsNullOrEmpty(message) || allMessages.Contains(message)) { return; } if (allMessages.Count < MAX_MESSAGE_COUNT) { allMessages.Add(message); } else if (allMessages.Count == MAX_MESSAGE_COUNT) { Log.error("[FatalExceptionHandler] Not displaying fatal error because too many errors have already been added:"); Log.error(message); allMessages.Add("(too many error messages to display)"); } else { Log.error("[FatalExceptionHandler] Not displaying fatal error because too many errors have already been added:"); Log.error(message); return; } if (dialog != null) { dialog.Dismiss(); } string errorMsg = $"B9PartSwitch has encountered a fatal error and KSP needs to close.\n\n{string.Join("\n\n", allMessages.ToArray())}\n\nPlease see KSP's log for additional details"; Log.error(errorMsg); dialog = PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new MultiOptionDialog( "B9PartSwitchFatalError", errorMsg, "B9PartSwitch - Fatal Error", HighLogic.UISkin, new Rect(0.5f, 0.5f, 500f, 60f), new DialogGUIFlexibleSpace(), new DialogGUIHorizontalLayout( new DialogGUIFlexibleSpace(), new DialogGUIButton("Quit", Application.Quit, 140.0f, 30.0f, true), new DialogGUIFlexibleSpace() ) ), true, HighLogic.UISkin); }
private void SaveCurrentProfile() { if (popup != null) { popup.Dismiss(); } else { editText = ProfileManager.ActiveProfile.name; // if there was no popup, SaveCurrentProfile was called directly } if (ProfileManager.HaveStoredProfile(editText)) { Log.Warning("Existing profile named '{0}' found! Asking user for overwrite permission.", editText); popup = PopupDialog.SpawnPopupDialog(new MultiOptionDialog("Overwrite existing profile?", string.Format("Profile '{0}' already exists!", editText), HighLogic.Skin, new DialogOption[] { new DialogOption("Overwrite", new Callback(SaveCurrentProfileOverwrite)), new DialogOption("Cancel", new Callback(DismissPopup)) }) { dialogRect = popupRect }, false, HighLogic.Skin); } else { SaveCurrentProfileOverwrite(); // save to go ahead and save since no existing profile with this key exists } }