Ejemplo n.º 1
0
 protected void OnConfirmDelete(YesNoCancelDialogResult result, IGUIChildEditor <YesNoCancelDialogResult> childEditor)
 {
     if (result.Result == DialogResult.Yes)
     {
         StartCoroutine(DeleteSaveGameOverTime(GameCreateResult.text));
     }
 }
Ejemplo n.º 2
0
        public IEnumerator DeleteProfileOverTime(string profileName)
        {
            YesNoCancelDialogResult result = new YesNoCancelDialogResult();

            result.CancelButton = false;
            result.Message      = "Delete Profile";
            result.Message      = "Are you SURE you want to delete the profile '" + profileName + "'? " +
                                  "All the save games and mods associated with it will be lost. " +
                                  "I mean, it's your profile, so do what you like. I'm just saying.";

            GameObject           childEditorGameObject = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.NGUIYesNoCancelDialog);
            GUIYesNoCancelDialog childEditor           = childEditorGameObject.GetComponent <GUIYesNoCancelDialog>();

            childEditor.ReceiveFromParentEditor(result);

            while (!childEditor.IsFinished)
            {
                yield return(null);
            }

            if (result.Result == DialogResult.Yes)
            {
                Profile.Get.DeleteProfile(profileName);
                //wait a tick for this to go through
                yield return(null);

                ClearBrowserObjects();
                yield return(null);

                PushEditObjectToNGUIObject();
            }
            mDeletingProfile = false;
            yield break;
        }
Ejemplo n.º 3
0
        public void OnClickControlsButton()
        {
            GameObject dialog = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.Dialog("NGUIControlsCheatSheetDialog"), false);
            YesNoCancelDialogResult editObject = new YesNoCancelDialogResult();

            GUIManager.SendEditObjectToChildEditor <YesNoCancelDialogResult>(new ChildEditorCallback <YesNoCancelDialogResult>(ControlDialogCallback), dialog, editObject);
            DisableInput();
        }
Ejemplo n.º 4
0
 public void ConfirmCancel(GUI.YesNoCancelDialogResult result, IGUIChildEditor <GUI.YesNoCancelDialogResult> childEditor)
 {
     if (result.Result == DialogResult.Yes)
     {
         OnFinished();
     }
     mConfirmationDialog = null;
 }
Ejemplo n.º 5
0
 public void OnClickDeleteButton()
 {
     if (mChildEditor == null && !Profile.Get.CurrentPreferences.HideDialogs.Contains("DeleteGameWarning"))
     {
         YesNoCancelDialogResult result = new YesNoCancelDialogResult();
         result.DontShowInFutureCheckbox = true;
         result.DialogName   = "DeleteGameWarning";
         result.Message      = "Are you sure you want to delete this game? This cannot be undone";
         result.MessageType  = "Delete " + GameCreateResult.text;
         result.CancelButton = false;
         mChildEditor        = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.NGUIYesNoCancelDialog);
         GUIManager.SendEditObjectToChildEditor <YesNoCancelDialogResult>(new ChildEditorCallback <YesNoCancelDialogResult>(OnConfirmDelete), mChildEditor, result);
     }
     else
     {
         StartCoroutine(DeleteSaveGameOverTime(GameCreateResult.text));
     }
 }
Ejemplo n.º 6
0
        protected void ControlDialogCallback(YesNoCancelDialogResult editObject, IGUIChildEditor <YesNoCancelDialogResult> childEditor)
        {
            if (mDestroyed)
            {
                return;
            }

            GUIManager.ScaleDownEditor(childEditor.gameObject).Proceed(true);
            //if the result is yes, open up the options dialog
            if (editObject.Result == DialogResult.Yes)
            {
                GUIOptionsDialog optionsDialog = OnClickOptionsButton();
                optionsDialog.Tabs.DefaultPanel = "Controls";
                optionsDialog.Tabs.SetSelection("Controls");
            }
            else
            {
                EnableInput();
            }
        }
Ejemplo n.º 7
0
        public bool ActionCancel(double timeStamp)
        {
            if (mDestroyed)
            {
                return(true);
            }

            if (!(WaitingForFade || StartSuspended))
            {
                if (RequireConfirmationToExit)
                {
                    bool spawnDialog = false;
                    switch (State)
                    {
                    case CutsceneState.Idling:
                        spawnDialog = RequireConfirmationDuringIdle;
                        break;

                    case CutsceneState.Finishing:
                        spawnDialog = RequireConfirmationDuringEnd;
                        break;

                    case CutsceneState.Starting:
                        spawnDialog = RequireConfirmationDuringStart;
                        break;

                    default:
                        break;
                    }

                    if (spawnDialog)
                    {
                        Debug.Log("Requires confirmation to exit");
                        if (mConfirmationDialog == null)
                        {
                            Debug.Log("Spawning NGUI manager");
                            mConfirmationDialog = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.NGUIYesNoCancelDialog);
                            GUI.YesNoCancelDialogResult result = new GUI.YesNoCancelDialogResult();
                            result.CancelButton = false;
                            result.Message      = ConfirmationMessage;
                            result.MessageType  = "Skip Cutscene";
                            //see if our top interface is using custom vr settings
                            if (VRManager.VRMode && HasActiveInterfaces)
                            {
                                GUIYesNoCancelDialog dialog = mConfirmationDialog.GetComponent <GUIYesNoCancelDialog>();
                                dialog.CustomVRSettings = InterfaceList[0].CustomVRSettings;
                                dialog.AxisLock         = InterfaceList[0].AxisLock;
                                dialog.CursorLock       = InterfaceList[0].CursorLock;
                                dialog.LockOffset       = InterfaceList[0].LockOffset;
                            }
                            GUIManager.SendEditObjectToChildEditor <GUI.YesNoCancelDialogResult>(new ChildEditorCallback <GUI.YesNoCancelDialogResult>(ConfirmCancel), mConfirmationDialog, result);
                        }
                    }
                    else
                    {
                        OnFinished();
                    }
                }
                else
                {
                    OnFinished();
                }
            }
            return(true);
        }