Exemplo n.º 1
0
    /// <summary>
    /// Updates the password field placeholder text with how many login attempts the user has before being locked out
    /// </summary>
    private void UpdatePlaceHolderText()
    {
        int currentLoginAttempt = SecurePlayerPrefs.GetInt(walletName + PlayerPrefConstants.SETTING_CURRENT_LOGIN_ATTEMPT);
        int attemptsLeft        = SecurePlayerPrefs.GetInt(PlayerPrefConstants.SETTING_MAX_LOGIN_ATTEMPTS) - currentLoginAttempt + 1;

        if (currentLoginAttempt != 1)
        {
            string word = attemptsLeft == 1 ? " try " : " tries ";

            passwordField.SetPlaceholderText("Password (" + attemptsLeft + word + "left)");
        }
    }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the <see cref="AmountManager"/> by assigning the references to the popup, max toggle, and amount input field.
        /// </summary>
        /// <param name="currencyManager"> The active <see cref="CurrencyManager"/>. </param>
        /// <param name="tradableAssetPriceManager"> The active <see cref="TradableAssetPriceManager"/>. </param>
        /// <param name="maxToggle"> The toggle for switching between maximum sendable amount and the entered amount. </param>
        /// <param name="maxText"> The max text header. </param>
        /// <param name="amountInputField"> The input field used for entering the sendable amount. </param>
        /// <param name="currencyText"> The currency text object. </param>
        /// <param name="oppositeCurrencyAmountText"> The opposite currency amount text object. </param>
        /// <param name="currencyButton"> The currency button. </param>
        /// <param name="tokenSymbol"> The token symbol. </param>
        public AmountManager(
            CurrencyManager currencyManager,
            TradableAssetPriceManager tradableAssetPriceManager,
            Toggle maxToggle,
            GameObject maxText,
            HopeInputField amountInputField,
            TMP_Text currencyText,
            TMP_Text oppositeCurrencyAmountText,
            Button currencyButton,
            string tokenSymbol)
        {
            this.maxToggle                  = maxToggle;
            this.maxText                    = maxText;
            this.amountInputField           = amountInputField;
            this.currencyText               = currencyText;
            this.oppositeCurrencyAmountText = oppositeCurrencyAmountText;
            this.currencyButton             = currencyButton;
            this.currencyManager            = currencyManager;
            this.tradableAssetPriceManager  = tradableAssetPriceManager;
            tradableTokenSymbol             = tokenSymbol;

            currencyText.text = currencyManager.ActiveCurrency.ToString();

            amountInputField.SetPlaceholderText("Amount<style=Symbol> (" + tokenSymbol + ")</style>");
            SetupListeners();
        }
    /// <summary>
    /// Sets the various text to ask for the next number
    /// </summary>
    private void SetWordText()
    {
        int[] randomNums = dynamicDataCache.GetData("confirmation numbers");

        HopeInputField inputField = wordInputField.GetComponent <HopeInputField>();

        inputField.SetPlaceholderText("Word #" + randomNums[wordIndex]);
        inputField.Text = string.Empty;
    }
Exemplo n.º 4
0
        /// <summary>
        /// Changes the currency and the inputted text according to the currency.
        /// </summary>
        private void CurrencyChanged()
        {
            usingTokenCurrency = !usingTokenCurrency;

            amountInputField.SetPlaceholderText("Amount<style=Symbol> (" + currencyText.text + ")</style>");
            currencyText.text = usingTokenCurrency ? currencyManager.ActiveCurrency.ToString() : tradableTokenSymbol;

            if (!string.IsNullOrEmpty(amountInputField.Text))
            {
                amountInputField.Text = oppositeCurrencyValue.ToString();
            }

            maxToggle.SetInteractable(usingTokenCurrency);
            maxText.AnimateColor(usingTokenCurrency ? UIColors.White : UIColors.LightGrey, 0.1f);
        }