Ejemplo n.º 1
0
    public void Btn_OnItemTypeOpen()
    {
        var labels = EnumUtils.ToStringArray <EquipmentType>();

        for (int i = 0; i < labels.Length; i++)
        {
            if (labels[i] == "None")
            {
                labels[i] = "All";
            }
        }

        ConfirmFilter.Ask("Item Type", null, labels)
        .Then(answer => {
            Debug.Log("Answer is: " + answer);

            if (answer == "All")
            {
                _EquipType = EquipmentType.None;
            }
            else
            {
                _EquipType = answer.AsEnum <EquipmentType>();
            }

            UpdateItemTypeLabel();
            RefreshItems();
        });
    }
Ejemplo n.º 2
0
    ///////////////////////////////////////////////////////////

    public static ConfirmFilter Ask(string title, string confirmMsg, params string[] labels)
    {
        ConfirmFilter confirm = (ConfirmFilter)menuMan.Load("Interface_ConfirmFilter");

        confirm._promise        = new Promise <string>();
        confirm.labelTitle.text = title;
        confirm.CreateButtonsFromLabels(labels);

        return(confirm);
    }
Ejemplo n.º 3
0
        private async void ConfirmButton_Clicked(object sender, EventArgs e)
        {
            Filter.Criteria  = entryFilter.Text;
            Filter.AllFields = switchAllFields.IsToggled;
            if (pickerAccountType.SelectedIndex <= 0)
            {
                Filter.AccountType = null;
            }
            else
            {
                if (AccountTypeOptions.TryGetValue(pickerAccountType.SelectedIndex, out AccountType? account))
                {
                    Filter.AccountType = account;
                }
                else
                {
                    Filter.AccountType = null;
                }
            }
            if (pickerPwdOrder.SelectedIndex <= 0)
            {
                Filter.PassowrdOrder = null;
            }
            else
            {
                if (PasswordOrderOptions.TryGetValue(pickerPwdOrder.SelectedIndex, out PwdOrder? order))
                {
                    Filter.PassowrdOrder = order;
                }
                else
                {
                    Filter.PassowrdOrder = null;
                }
            }
            Filter.InCloud = switchFilterCloud.IsToggled;

            Filter.Issues.Clear();
            if (switchIssueTooOld.IsToggled)
            {
                Filter.Issues.Add(PwdIssue.TooOld);
            }
            if (switchIssueTooWeak.IsToggled)
            {
                Filter.Issues.Add(PwdIssue.TooWeak);
            }

            if (ConfirmFilter != null)
            {
                ConfirmFilter.Invoke(this, e, Filter);
            }
            await Navigation.PopAsync(true);
        }
Ejemplo n.º 4
0
    public void Btn_OnFilterTypeOpen()
    {
        var labels = EnumUtils.ToStringArray <ItemFilterType>();

        ConfirmFilter.Ask("Item Filter", null, labels)
        .Then(answer => {
            Debug.Log("Answer is: " + answer);

            _ITEM_FILTER_TYPE = answer.AsEnum <ItemFilterType>();

            UpdateFilterLabel();
            RefreshItems();
        });
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        _faderAlpha = fader.color.a;
        fader.color = new Color(0, 0, 0, 0);

        panel.localScale = Vector2.zero;

        BtnModal.onClick.AddListener(Btn_OnModalClickAnywhere);
        BtnClose.onClick.AddListener(Btn_OnModalClickAnywhere);

        Show();
    }
Ejemplo n.º 6
0
    public override void CloseTransition()
    {
        fader.DOFade(0, _timeHide);
        panel.DOScale(0, _timeHide)
        .SetEase(Ease.InBack)
        .OnComplete(() => {
            menuMan.Remove(this);
            Instance = null;
        });

        foreach (PromiseButton btnPromise in _buttons)
        {
            btnPromise.btn.onClick.RemoveAllListeners();
        }
    }