Ejemplo n.º 1
0
    public void SetValueInfo(Range range)
    {
        originalMinimum = range.MinValue;
        originalMaximum = range.MaxValue;

        MinimumInput.text = originalMinimum.ToString();
        MaximumInput.text = originalMaximum.ToString();

        UpdateIsMaximumChanged(MaximumInput.text);
        UpdateIsMinimumChanged(MinimumInput.text);
        progressionEnabled = false;
    }
Ejemplo n.º 2
0
        /// <summary>
        /// Wraps all text boxes for floats in a validator and registers the proper events
        /// </summary>
        private void WrapFloatTextBoxes()
        {
            // Value type single
            var validator = FloatTextBoxValidator.Create(AffixValueTypeSingleMinTextBox, "0");

            validator.TextChanged += textbox =>
            {
                localBaseValueMinSingle = FloatTextBoxValidator.GetValue(textbox);
                CheckAffixValueTypeSingleChanged();
            };

            validator              = FloatTextBoxValidator.Create(AffixValueTypeSingleMaxTextBox, "0");
            validator.TextChanged += textbox =>
            {
                localBaseValueMaxSingle = FloatTextBoxValidator.GetValue(textbox);
                CheckAffixValueTypeSingleChanged();
            };

            // Value type range
            validator              = FloatTextBoxValidator.Create(AffixValueTypeRangeMinMinTextBox, "0");
            validator.TextChanged += textbox =>
            {
                localBaseValueMinRange.MinValue = FloatTextBoxValidator.GetValue(textbox);
                CheckAffixValueTypeRangeMinChanged();
            };

            validator              = FloatTextBoxValidator.Create(AffixValueTypeRangeMinMaxTextBox, "0");
            validator.TextChanged += textbox =>
            {
                localBaseValueMinRange.MaxValue = FloatTextBoxValidator.GetValue(textbox);
                CheckAffixValueTypeRangeMinChanged();
            };

            validator              = FloatTextBoxValidator.Create(AffixValueTypeRangeMaxMinTextBox, "0");
            validator.TextChanged += textbox =>
            {
                localBaseValueMaxRange.MinValue = FloatTextBoxValidator.GetValue(textbox);
                CheckAffixValueTypeRangeMaxChanged();
            };

            validator              = FloatTextBoxValidator.Create(AffixValueTypeRangeMaxMaxTextBox, "0");
            validator.TextChanged += textbox =>
            {
                localBaseValueMaxRange.MaxValue = FloatTextBoxValidator.GetValue(textbox);
                CheckAffixValueTypeRangeMaxChanged();
            };
        }
Ejemplo n.º 3
0
    public override void SetValueInfo(AffixValueInfo info)
    {
        if (!(info.BaseValueMin is AffixValueSingle))
        {
            throw new ArgumentException($"Can only display AffixValueSingle info!", nameof(info));
        }

        originalMinimum = info.BaseValueMin as AffixValueSingle;
        originalMaximum = info.BaseValueMax as AffixValueSingle;

        MinimumInput.text = originalMinimum.ToString();
        MaximumInput.text = originalMaximum.ToString();

        Progression = info.Progression;

        UpdateIsMaximumChanged(MaximumInput.text);
        UpdateIsMinimumChanged(MinimumInput.text);
        UpdateIsProgressionChanged();
    }