public void OptionsMenuCancelButtonClicked()
 {
     if (SaveAndSettingsHelper.CheckForChangesInOptionsMenu())
     {
         ConfirmationBoxScript.AttachCallbackToConfirmationBox(
             mmusGameManagerScript.ReturnToPauseMenu,
             "Unsaved changes will be lost. Are you sure you don't want to save?",
             "Don't Save",
             "Cancel");
     }
     else
     {
         mmusGameManagerScript.ReturnToPauseMenu();
     }
 }
Esempio n. 2
0
    /// <summary>
    /// Method when close is clicked in the options menu, check if any unsaved changes exist
    /// If there are unsaved changes, display a confirmation box to warn player
    /// </summary>
    public void CloseOptionsMenu()
    {
        bool blnUnsavedChanges = SaveAndSettingsHelper.CheckForChangesInOptionsMenu();

        if (blnUnsavedChanges)
        {
            // Unsaved changes, show confirmation
            ConfirmationBoxScript.AttachCallbackToConfirmationBox(
                OpenMainUI,
                "Unsaved changes will be lost. Are you sure you don't want to save?",
                "Don't Save",
                "Cancel");
        }
        else
        {
            // No changes, close normally
            OpenMainUI();
        }
    }
Esempio n. 3
0
 /// <summary>
 /// Check the inputs in the Settings menu state. Only keycode input is to return to pause menu.
 /// </summary>
 private void CheckSettingsMenuStateInputs()
 {
     if (Input.GetKeyDown(mmusHotKeyManager.HotKeys["EscapeKeyCode"]) &&
         muniCurrentKeyDown != mmusHotKeyManager.HotKeys["EscapeKeyCode"])
     {
         // Check for changes in options before closing
         muniCurrentKeyDown = mmusHotKeyManager.HotKeys["EscapeKeyCode"];
         if (SaveAndSettingsHelper.CheckForChangesInOptionsMenu())
         {
             ConfirmationBoxScript.AttachCallbackToConfirmationBox(
                 mmusGameManagerScript.ReturnToPauseMenu,
                 "Unsaved changes will be lost. Are you sure you don't want to save?",
                 "Don't Save",
                 "Cancel");
         }
         else
         {
             mmusGameManagerScript.ReturnToPauseMenu();
         }
     }
 }