コード例 #1
0
        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();
        }
コード例 #2
0
        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
            }
        }
コード例 #3
0
        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
            }
        }
コード例 #4
0
 private void OnFalse()
 {
     if (_dialog == null)
     {
         return;
     }
     _dialog.Dismiss();
     _dialog = null;
 }
コード例 #5
0
 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();
     }
 }
コード例 #6
0
 /// <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();
     }
 }
コード例 #7
0
        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);
        }
コード例 #8
0
 internal static void Reload()
 {
     if (dialog != null)
     {
         WindowManager2.SavePosition(dialog);
         dialog.Dismiss();
     }
     dialog       = null;
     optionDialog = null;
     Open();
 }
コード例 #9
0
ファイル: Window.cs プロジェクト: lamont-granquist/MechJim
        /*
         * 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();
            }
        }
コード例 #10
0
ファイル: FlightModule.cs プロジェクト: RCrockford/KRASH
        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());

            }
        }
コード例 #11
0
 private void popupDismiss()
 {
     if (transferDialog != null)
     {
         transferDialog.Dismiss();
     }
 }
コード例 #12
0
 void CloseDialog()
 {
     if (_uiDialog != null)
     {
         _uiDialog.Dismiss();
     }
 }
コード例 #13
0
 internal static void Close()
 {
     if (dialog != null)
     {
         dialog.Dismiss();
     }
     dialog = null;
 }
コード例 #14
0
        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;
        }
コード例 #15
0
 public static void OnDestroy()
 {
     if (popup_dialog != null)
     {
         popup_dialog.Dismiss();
         popup_dialog = null;
     }
 }
コード例 #16
0
 public void Hide()
 {
     if (popupDialog != null)
     {
         SaveWindowPosition();
         popupDialog.Dismiss();
         popupDialog = null;
     }
 }
コード例 #17
0
        private void DeSpawn()
        {
            if (popup_dialog != null)
            {
                popup_dialog.Dismiss();
            }

            popup_dialog = null;
        }
コード例 #18
0
 /// <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);
 }
コード例 #19
0
 /// <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;
     }
 }
コード例 #20
0
 /// <summary>
 /// Close and deallocate the dialog
 /// </summary>
 public void dismiss()
 {
     if (popupDialog != null)
     {
         OnPreDismiss();
         popupDialog.Dismiss();
         popupDialog = null;
     }
 }
コード例 #21
0
 public void DismissConfirmDialog()
 {
     confirmDeleteDialog.Dismiss();
     confirmDeleteDialog = null;
     if (dialog != null)
     {
         dialog.gameObject.SetActive(true);
     }
 }
コード例 #22
0
 internal static void Close()
 {
     if (dialog != null)
     {
         dialog.Dismiss();
     }
     dialog         = null;
     selectedSite   = null;
     staticInstance = null;
 }
コード例 #23
0
 private void onAppLauncherHide()
 {
     guiVisible = false;
     ToggleIcon();
     if (settingsMenu != null)
     {
         settingsMenu.Dismiss();
         settingsMenu = null;
     }
 }
        private void DismissDialog()
        {
            if (_dialog == null)
            {
                return;
            }

            _dialog.Dismiss();
            _dialog = null;
        }
コード例 #25
0
 public void DismissSaveDialog()
 {
     if (saveDialog != null)
     {
         saveDialog.Dismiss();
         saveDialog = null;
     }
     onDismissCallback();
     Destroy(base.gameObject);
 }
コード例 #26
0
 internal static void Close()
 {
     if (dialog != null)
     {
         WindowManager.SavePosition(dialog);
         dialog.Dismiss();
     }
     dialog       = null;
     optionDialog = null;
 }
コード例 #27
0
 internal static void Close()
 {
     if (dialog != null)
     {
         WindowManager2.SavePosition(dialog);
         dialog.Dismiss();
     }
     dialog       = null;
     optionDialog = null;
     InputLockManager.RemoveControlLock("KK_KSC");
 }
コード例 #28
0
 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();
 }
コード例 #29
0
        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);
        }
コード例 #30
0
 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
     }
 }