コード例 #1
0
            void Handle_DiePopModified(object sender, NumberModifyEventArgs args)
            {
                DieStep step = state._DieSteps[lastSelectedIndex];

                step.Die = args.ModifyValue(step.Die, 0, int.MaxValue).Value;
                state.UpdateDieRoll();
            }
コード例 #2
0
        void HandlePopNumberModified(object sender, NumberModifyEventArgs args)
        {
            NumberModifyPopover pop = (NumberModifyPopover)sender;


            if (args.Set)
            {
                if ((_Property.PropertyType == typeof(int?)))
                {
                    int?val = (int?)args.Value;
                    val   = BoundInt(val, MinIntValue, MaxIntValue);
                    Value = val;
                }
                else
                {
                    int val = ((int?)args.Value).Value;
                    val   = BoundInt(val, MinIntValue, MaxIntValue);
                    Value = val;
                }
            }
            else
            {
                if (Value != null)
                {
                    if ((_Property.PropertyType == typeof(int?)))
                    {
                        int?val = (int?)Value;
                        val  += args.Value.Value;
                        val   = BoundInt(val, MinIntValue, MaxIntValue);
                        Value = val;
                    }
                    else
                    {
                        int val = (int)Value;
                        val  += args.Value.Value;
                        val   = BoundInt(val, MinIntValue, MaxIntValue);
                        Value = val;
                    }
                }
            }

            if (_Property.PropertyType == typeof(int?))
            {
                pop.Value = (int?)Value;
            }
            else
            {
                pop.Value = (int)Value;
            }
            UpdateButton();
        }
コード例 #3
0
        void Handle_NumberPopNumberModified(object sender, NumberModifyEventArgs args)
        {
            if (args.Set)
            {
                _Mod = (int)args.Value;
            }
            else
            {
                _Mod += (int)args.Value;
            }

            _NumberPop.Value = _Mod;
            UpdateModButton();
        }
コード例 #4
0
        void HandleMaxHPPopNumberModified(object sender, NumberModifyEventArgs args)
        {
            NumberModifyPopover pop = (NumberModifyPopover)sender;

            if (args.Set)
            {
                Character.MaxHP = args.Value.Value;
            }
            else
            {
                Character.MaxHP += args.Value.Value;
            }

            pop.Value = Character.MaxHP;
        }
コード例 #5
0
        void HandleInitPopNumberModified(object sender, NumberModifyEventArgs args)
        {
            NumberModifyPopover pop = (NumberModifyPopover)sender;

            if (args.Set)
            {
                Character.Monster.Init = args.Value.Value;
            }
            else
            {
                Character.Monster.Init += args.Value.Value;
            }

            pop.Value = Character.Monster.Init;
        }
コード例 #6
0
        void HandleTempHPPopNumberModified(object sender, NumberModifyEventArgs args)
        {
            NumberModifyPopover pop = (NumberModifyPopover)sender;

            if (args.Set)
            {
                int change = args.Value.Value - Character.TemporaryHP;
                Character.AdjustHP(0, 0, change);
            }
            else
            {
                Character.AdjustHP(0, 0, args.Value.Value);
            }

            pop.Value = Character.TemporaryHP;
        }
コード例 #7
0
        void HandleNonlethalPopNumberModified(object sender, NumberModifyEventArgs args)
        {
            NumberModifyPopover pop = (NumberModifyPopover)sender;

            if (args.Set)
            {
                int change = args.Value.Value - Character.NonlethalDamage;
                Character.AdjustHP(0, change, 0);
            }
            else
            {
                Character.AdjustHP(0, args.Value.Value, 0);
            }

            pop.Value = Character.NonlethalDamage;
        }
コード例 #8
0
        void HandleInitPopNumberModified(object sender, NumberModifyEventArgs args)
        {
            NumberModifyPopover pop = (NumberModifyPopover)sender;
            GradientButton      b   = (GradientButton)pop.ParentView;

            Character ch = (Character)pop.Data;

            if (args.Set)
            {
                ch.CurrentInitiative = args.Value.Value;
            }
            else
            {
                ch.CurrentInitiative += args.Value.Value;
            }

            pop.Value = ch.CurrentInitiative;
            b.SetText(ch.CurrentInitiative.ToString());
        }