public void OnGUI()
        {
            EditorGUILayout.BeginVertical();
            GUILayout.Label(_QuestionText, _WordWrapStyle, GUILayout.ExpandWidth(true));
            GUILayout.FlexibleSpace();

            GUILayout.BeginHorizontal();
            GUILayout.Space(10);
            if (GUILayout.Button("Yes"))
            {
                OnConfirm?.Invoke();
                OnButton?.Invoke(true);
                Close();
            }
            GUILayout.Space(10);

            if (GUILayout.Button("No"))
            {
                OnButton?.Invoke(false);
                Close();
            }
            GUILayout.Space(10);

            GUILayout.EndHorizontal();
            GUILayout.Space(10);
            EditorGUILayout.EndVertical();
        }
Example #2
0
        private void Update()
        {
            if (interactionsEnabled)
            {
                if (interactionsCooling)
                {
                    interactionsCooling = false;
                    return;
                }

                if (Input.GetButtonDown(KeyCodeConsts.Use))
                {
                    OnConfirm?.Invoke(INPUT_TYPE.USE);
                    interactionController.Interact();
                }

                if (Input.GetButtonDown(KeyCodeConsts.Cancel))
                {
                    OnCancel?.Invoke(INPUT_TYPE.CANCEL);
                    interactionController.Cancel();
                }

                if (Input.GetButtonDown(KeyCodeConsts.Inventory))
                {
                    OnInventory?.Invoke(INPUT_TYPE.INVENTORY);
                }
            }
        }
Example #3
0
 private Task OnClickConfirm()
 {
     if (OnConfirm != null)
     {
         OnConfirm.Invoke();
     }
     return(Task.CompletedTask);
 }
Example #4
0
 private async Task Confirm(MouseEventArgs args)
 {
     if (OnConfirm.HasDelegate)
     {
         await OnConfirm.InvokeAsync(args);
     }
     await base.Hide();
 }
Example #5
0
    //---------------------------------------------------------------------------------------------

    public void Accept()
    {
        OnConfirm?.Invoke();

        canvas.interactable   = false;
        canvas.alpha          = 0f;
        canvas.blocksRaycasts = false;
    }
Example #6
0
 private void YesBtn_Click(object sender, RoutedEventArgs e)
 {
     OnConfirm?.Invoke(this);
     if (BrowserFlag == BrowserFlags.CONFIRM)
     {
         _ = LoadHeaderAsync();
     }
 }
Example #7
0
        private void confirmBtn_Click(object sender, EventArgs e)
        {
            //if (MessageBox.Show("Are you sure you want to add this item in cart?","", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
            //    return;
            var i = new InventoryItemDetailArgs(Id, (int)(quantity.Value), price.Value, discount.Value);

            OnConfirm.Invoke(this, i);
            this.Close();
        }
Example #8
0
 /// <summary>
 /// 点击确认按钮时回调此方法
 /// </summary>
 private async Task OnClickConfirm()
 {
     Value = CurrentTime;
     if (ValueChanged.HasDelegate)
     {
         await ValueChanged.InvokeAsync(Value);
     }
     OnConfirm?.Invoke();
 }
Example #9
0
    public void Publish(string sceneName, string sceneDescription)
    {
        if (!isValidated)
        {
            return;
        }

        SetActive(false);
        OnConfirm?.Invoke();
    }
Example #10
0
    public static void Open(string aTitle, string aMessage, OnConfirm callback)
    {
        UIManager.instance.ModalOpen(UIManager.Modal.Confirm);

        //...
        ModalConfirm us = (ModalConfirm)UIManager.instance.uis[(int)UIManager.Modal.Confirm].ui;

        us.title.text = !string.IsNullOrEmpty(aTitle) ? aTitle : us.mDefaultTitle;
        us.message.text = aMessage;
        us.mConfirmCallback = callback;
    }
Example #11
0
    void OnButtonNo(GameObject go)
    {
        OnConfirm callme = mConfirmCallback;

        UIManager.instance.ModalCloseTop();

        if (callme != null)
        {
            callme(false);
        }
    }
Example #12
0
    public static void Open(string aTitle, string aMessage, OnConfirm callback)
    {
        UIManager.instance.ModalOpen(UIManager.Modal.Confirm);

        //...
        ModalConfirm us = (ModalConfirm)UIManager.instance.uis[(int)UIManager.Modal.Confirm].ui;

        us.title.text       = !string.IsNullOrEmpty(aTitle) ? aTitle : us.mDefaultTitle;
        us.message.text     = aMessage;
        us.mConfirmCallback = callback;
    }
Example #13
0
        /// <summary>
        /// Call this when closing the message
        /// </summary>
        protected void Click(bool yes)
        {
            OnConfirm toCall = mCallback;

            Manager.instance.ModalCloseTop();

            if (toCall != null)
            {
                toCall(yes);
            }
        }
Example #14
0
        public virtual void PerformConfirm(Func <object> resultSelector)
        {
            var cont = new ContinuityDelegate();

            OnConfirm?.Invoke(new FormResult(resultSelector(), this), cont);

            if (!string.IsNullOrEmpty(cont.Message))
            {
                ShowMessage(cont.Message, cont.MessageType, cont.Duration);
            }

            if (cont.Close)
            {
                Close();
            }
        }
        public async void MeasurementClicked(SelectableMeasurement m)
        {
            m.SelectedCount++;

            double currentAmount = 0f;

            foreach (var item in MeasurementsOptions.Where(m => m.SelectedCount > 0))
            {
                currentAmount += item.SelectedCount * BaseMeasurement.GetMeasurement(item.Measurement).ConvertTo(MeasurementType);
            }
            CurrentSelectedAmount = currentAmount;

            if (CurrentSelectedAmount >= RequiredAmount)
            {
                await OnConfirm.InvokeAsync(this);
            }
        }
Example #16
0
 public void ShowOkMsg(string text, OnConfirm confirm)
 {
     if (cancelBtn != null)
     {
         cancelBtn.SetActive(false);
     }
     if (okBtn != null)
     {
         Vector3 vec = okBtn.transform.localPosition;
         vec.x = 0;
         okBtn.transform.localPosition = vec;
     }
     if (txt != null)
     {
         txt.GetComponent <UILabel>().text = text;
     }
     m_confirm      = confirm;
     isOkCancelMode = false;
 }
Example #17
0
    public void ShowOkCancelMsg(string text, OnConfirm confirm, OnCancel cancel)
    {
        if (cancelBtn != null)
        {
            cancelBtn.SetActive(true);
        }
        if (okBtn != null)
        {
            Vector3 vec = cancelBtn.transform.localPosition;
            vec.x = -vec.x;
            okBtn.transform.localPosition = vec;
        }
        if (txt != null)
        {
            txt.GetComponent <UILabel>().text = text;
        }

        m_confirm      = confirm;
        m_cancel       = cancel;
        isOkCancelMode = true;
    }
Example #18
0
    public void Confirm()
    {
        StringBuilder userCode = new StringBuilder(password.Length);

        for (int i = 0; i < passwordContainers.Length; i++)
        {
            userCode.Append(passwordContainers[i].text);
        }

        if (password == userCode.ToString())
        {
            Debug.Log("CODE CORRECT");
            for (int i = 0; i < rewards.Length; i++)
            {
                GameController.Instance.NormalInventory.AddToInventory(rewards[i]);
            }
            HidePuzzle();
            OnConfirm?.Invoke(this, true);
            return;
        }

        OnConfirm?.Invoke(this, false);
    }
Example #19
0
        public static void Open(string modalName, string aTitle, string aText, OnConfirm aCallback)
        {
            Manager uiMgr = Manager.instance;

            if (uiMgr.ModalGetTop() == modalName)
            {
                uiMgr.ModalCloseTop();
            }

            Manager.UIData dat = uiMgr.ModalGetData(modalName);

            if (dat != null)
            {
                ConfirmDialogBase uiConfirm = dat.ui as ConfirmDialogBase;
                uiConfirm.OnSetInfo(aTitle, aText);
                uiConfirm.mCallback = aCallback;

                uiMgr.ModalOpen(modalName);
            }
            else if (aCallback != null) //TODO: use default param?
            {
                aCallback(true);
            }
        }
Example #20
0
 private void OnPopupConfirm()
 {
     UnregisterEvents();
     OnConfirm?.Invoke(_inputMenu.Combination);
 }
Example #21
0
 public override void OnClose()
 {
     mConfirmCallback = null;
 }
 private void BtnConfirm_Click(object sender, RoutedEventArgs e)
 {
     OnConfirm.Invoke(sender, hexColor);
     Close();
 }
Example #23
0
        public async Task ConfirmAsync()
        {
            await OnConfirm.InvokeAsync(Id);

            Close();
        }
Example #24
0
 private void OnPopupConfirm()
 {
     UnregisterEvents();
     OnConfirm?.Invoke(_inputMenu.GetInputText());
 }
Example #25
0
 public void Confirm(UIEventArgs e)
 {
     this.IsShow = false;
     OnConfirm.InvokeAsync(e);
 }
 private void AutoConfirm()
 {
     OnConfirm?.Invoke();
 }
Example #27
0
 private void Confirm(object parameter)
 {
     OnConfirm?.Invoke(Model);
 }
 private void Confirm(object parameter)
 {
     OnConfirm?.Invoke(ServerName);
 }
Example #29
0
 public void SetOnConfirm(OnConfirm onConfirm)
 {
     this.onConfirm = onConfirm;
 }
Example #30
0
 private void Internal_onConfirm(VectorComponent p0)
 {
     OnConfirm?.Invoke(p0);
 }
Example #31
0
        public PopupAlertMessage(CompositeSpriteText title, CompositeSpriteText message, AlertMessageType alertMessageType = AlertMessageType.AcceptCancel) : base(true)
        {
            Background = new Sprite("Interface/Popup/Blue/Alert/Background", layerDepth: DepthParameter.InterfacePopupMessageBackground);

            compositeSpriteTextList.Add(title);
            compositeSpriteTextList.Add(message);

            title.PositionOffset   = Background.Position - new Vector2(186, 50);
            message.PositionOffset = Background.Position - new Vector2(186, 50 - title.ElementDimensions.Y - 5);

            buttonList.Add(new Button(ButtonType.Cancel, DepthParameter.InterfacePopupMessageButtons, CloseAction, PositionOffset + new Vector2(160, 65)));

            if (alertMessageType != AlertMessageType.Cancel)
            {
                buttonList.Add(new Button(ButtonType.Accept, DepthParameter.InterfacePopupMessageButtons, (sender) => { OnConfirm?.Invoke(sender); }, PositionOffset + new Vector2(125, 65)));
            }

            ShouldRender = true;

            UpdateAttatchmentPosition();
        }
Example #32
0
 private void Confirm(object parameter)
 {
     OnConfirm?.Invoke(SelectedItem);
 }