示例#1
0
        private async Task SaveAsConfigAsync(string name, string description)
        {
            //Check if a file with this name already exist
            var hwDefs = await _client.GetAllHardwareDef();

            if (hwDefs.Any(hwdef => hwdef.Name == name))
            {
                NotifySystem.Default.ShowWarning("A save file with this name already exist on the server.");
                return;
            }

            var hwDef = new HardwareDefinitionDto
            {
                Name         = name,
                Description  = description,
                CreationTime = DateTime.UtcNow
            };

            await _client.SaveCurrentHardwareDef(hwDef);

            UnsavedChanges = false;

            _current           = hwDef;
            NameTextBlock.Text = GetDisplayFileName();
            _diagManager.CloseDialog();
        }
    void StartStage()
    {
        // if relevant, sets up inner dialog
        Stage stage = stageList[currentStage];

        if (stage.skippable)
        {
            dialogManager.OpenDialog(stage.dialogHeader, stage.doItText, stage.dialogMode);
        }
        else
        {
            dialogManager.CloseDialog();
            SetupStage(); // non-skippable stage, just setup stuff
        }
    }
示例#3
0
    public void CloseLoadingDialog()
    {
        if (_loadingDialog == null)
        {
            return;
        }

        _dialogManager.CloseDialog(_loadingDialog as IView);
        _loadingDialog = null;
    }
示例#4
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        DialogManager dialogManager = Globals.instance.components.dialogManager;

        foreach (DialogManager.Dialog x in System.Enum.GetValues(typeof(DialogManager.Dialog)))
        {
            if (GUILayout.Button(x.ToString()))
            {
                dialogManager.ShowDialog(x);
            }
        }

        if (GUILayout.Button("Close [X]"))
        {
            dialogManager.CloseDialog();
        }
    }
    private void OnTriggerExit2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            _keySign.MoveUp = 2;

            if (_dialogManager.IsDialogOpen)
            {
                if (_dialogManager.CurrentSentenceIndex < _dialogManager.CurrentDialog.Sentences.Length)
                {
                    _dialogManager.LeaveLine();
                }
                else
                {
                    _dialogManager.CloseDialog();
                }
            }
        }
    }
示例#6
0
        private void Update()
        {
            if (m_skipUpdate)
            {
                m_skipUpdate = false;
                return;
            }

            if (!m_editor.IsInputFieldActive)
            {
                if (m_dialogManager.IsDialogOpened)
                {
                    if (m_editor.Input.GetKeyDown(KeyCode.Escape))
                    {
                        m_dialogManager.CloseDialog();
                    }
                }
            }

            m_editor.UpdateCurrentInputField();
            EnableOrDisableRaycasts();

            bool mwheel = false;

            if (m_zAxis != Mathf.CeilToInt(Mathf.Abs(Input.GetAxis(InputAxis.Z))))
            {
                mwheel  = m_zAxis == 0;
                m_zAxis = Mathf.CeilToInt(Mathf.Abs(Input.GetAxis(InputAxis.Z)));
            }

            bool pointerDownOrUp = Input.GetPointerDown(0) ||
                                   Input.GetPointerDown(1) ||
                                   Input.GetPointerDown(2) ||
                                   Input.GetPointerUp(0);

            bool canActivate = pointerDownOrUp ||
                               mwheel ||
                               Input.IsAnyKeyDown() && (CurrentInputField == null || !CurrentInputField.isFocused);

            if (canActivate)
            {
                PointerEventData pointerEventData = new PointerEventData(m_editor.EventSystem);
                pointerEventData.position = Input.GetPointerXY(0);

                List <RaycastResult> results = new List <RaycastResult>();
                Raycaster.Raycast(pointerEventData, results);

                RectTransform activeRectTransform             = GetRegionTransform(ActiveWindow);
                bool          activeWindowContainsScreenPoint = activeRectTransform != null && RectTransformUtility.RectangleContainsScreenPoint(activeRectTransform, Input.GetPointerXY(0), Raycaster.eventCamera);


                if (!results.Any(r => r.gameObject.GetComponent <Menu>()))
                {
                    foreach (Region region in results.Select(r => r.gameObject.GetComponentInParent <Region>()).Where(r => r != null).OrderBy(r => r.transform.localPosition.z))
                    {
                        RuntimeWindow window = region.ActiveContent != null?region.ActiveContent.GetComponentInChildren <RuntimeWindow>() : region.ContentPanel.GetComponentInChildren <RuntimeWindow>();

                        if (window != null && (!activeWindowContainsScreenPoint || window.Depth >= ActiveWindow.Depth))
                        {
                            if (m_editor.Contains(window))
                            {
                                if (pointerDownOrUp || window.ActivateOnAnyKey)
                                {
                                    if (window != null && window.WindowType == RuntimeWindowType.Scene)
                                    {
                                        IEnumerable <Selectable> selectables = results.Select(r => r.gameObject.GetComponent <Selectable>()).Where(s => s != null);
                                        int count = selectables.Count();
                                        if (count >= 1)
                                        {
                                            RuntimeSelectionComponentUI selectionComponentUI = selectables.First() as RuntimeSelectionComponentUI;
                                            if (selectionComponentUI != null)
                                            {
                                                selectionComponentUI.Select();
                                            }
                                        }
                                    }

                                    if (window != ActiveWindow)
                                    {
                                        m_editor.ActivateWindow(window);
                                        region.MoveRegionToForeground();
                                    }
                                }
                                break;
                            }
                        }
                    }
                }
            }
        }
示例#7
0
 private IEnumerator CloseDialogBox()
 {
     yield return(StartCoroutine(mDialogManager.CloseDialog()));
 }
示例#8
0
 public void DestroyDialogWindow()
 {
     m_dialogManager.CloseDialog();
 }