Пример #1
0
    /// <summary>
    /// Opens the corresponding popup
    /// </summary>
    /// <param name="index"> The index of the button being pressed </param>
    private void ButtonClicked(int index)
    {
        PopupBase popup = null;

        switch (index)
        {
        case 0:
            if (lockedPRPSManager.UnfulfilledItems?.Count > 0)
            {
                popup = popupManager.GetPopup <LockedPRPSPopup>();
            }
            else
            {
                popup = popupManager.GetPopup <LockPRPSPopup>();
            }
            break;

        case 1:
            popup = popupManager.GetPopup <SendAssetPopup>();
            break;

        case 2:
            popup = popupManager.GetPopup <ReceiveAssetPopup>();
            break;
        }

        buttons[index].interactable = false;
        popup.OnPopupClose(() => buttons[index].interactable = true);
    }
Пример #2
0
    /// <summary>
    /// A button in the dropdown has been clicked
    /// </summary>
    /// <param name="num"> The number of the button in the dropdown hiearchy </param>
    private void DropdownButtonClicked(int num)
    {
        PopupBase popup = null;

        switch (num)
        {
        case 0:
            popup = popupManager.GetPopup <HelpPopup>();
            break;

        case 1:
            popup = popupManager.GetPopup <AboutPopup>();
            break;

        case 2:
            popup = popupManager.GetPopup <SettingsPopup>();
            break;

        case 3:
            popup = popupManager
                    .GetPopup <GeneralOkCancelPopup>()
                    .SetSubText("Are you sure you want to logout?")
                    .OnOkClicked(logoutHandler.Logout);
            break;
        }

        if (popup == null)
        {
            return;
        }

        popupIsOpen = true;
        subButtons[num].interactable = false;
        popup.OnPopupClose(() => { subButtons[num].interactable = true; popupIsOpen = false; });
    }