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(); }
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); } } }
private Task OnClickConfirm() { if (OnConfirm != null) { OnConfirm.Invoke(); } return(Task.CompletedTask); }
private async Task Confirm(MouseEventArgs args) { if (OnConfirm.HasDelegate) { await OnConfirm.InvokeAsync(args); } await base.Hide(); }
//--------------------------------------------------------------------------------------------- public void Accept() { OnConfirm?.Invoke(); canvas.interactable = false; canvas.alpha = 0f; canvas.blocksRaycasts = false; }
private void YesBtn_Click(object sender, RoutedEventArgs e) { OnConfirm?.Invoke(this); if (BrowserFlag == BrowserFlags.CONFIRM) { _ = LoadHeaderAsync(); } }
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(); }
/// <summary> /// 点击确认按钮时回调此方法 /// </summary> private async Task OnClickConfirm() { Value = CurrentTime; if (ValueChanged.HasDelegate) { await ValueChanged.InvokeAsync(Value); } OnConfirm?.Invoke(); }
public void Publish(string sceneName, string sceneDescription) { if (!isValidated) { return; } SetActive(false); OnConfirm?.Invoke(); }
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; }
void OnButtonNo(GameObject go) { OnConfirm callme = mConfirmCallback; UIManager.instance.ModalCloseTop(); if (callme != null) { callme(false); } }
/// <summary> /// Call this when closing the message /// </summary> protected void Click(bool yes) { OnConfirm toCall = mCallback; Manager.instance.ModalCloseTop(); if (toCall != null) { toCall(yes); } }
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); } }
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; }
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; }
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); }
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); } }
private void OnPopupConfirm() { UnregisterEvents(); OnConfirm?.Invoke(_inputMenu.Combination); }
public override void OnClose() { mConfirmCallback = null; }
private void BtnConfirm_Click(object sender, RoutedEventArgs e) { OnConfirm.Invoke(sender, hexColor); Close(); }
public async Task ConfirmAsync() { await OnConfirm.InvokeAsync(Id); Close(); }
private void OnPopupConfirm() { UnregisterEvents(); OnConfirm?.Invoke(_inputMenu.GetInputText()); }
public void Confirm(UIEventArgs e) { this.IsShow = false; OnConfirm.InvokeAsync(e); }
private void AutoConfirm() { OnConfirm?.Invoke(); }
private void Confirm(object parameter) { OnConfirm?.Invoke(Model); }
private void Confirm(object parameter) { OnConfirm?.Invoke(ServerName); }
public void SetOnConfirm(OnConfirm onConfirm) { this.onConfirm = onConfirm; }
private void Internal_onConfirm(VectorComponent p0) { OnConfirm?.Invoke(p0); }
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(); }
private void Confirm(object parameter) { OnConfirm?.Invoke(SelectedItem); }