void Handle_DiePopModified(object sender, NumberModifyEventArgs args) { DieStep step = state._DieSteps[lastSelectedIndex]; step.Die = args.ModifyValue(step.Die, 0, int.MaxValue).Value; state.UpdateDieRoll(); }
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(); }
void Handle_NumberPopNumberModified(object sender, NumberModifyEventArgs args) { if (args.Set) { _Mod = (int)args.Value; } else { _Mod += (int)args.Value; } _NumberPop.Value = _Mod; UpdateModButton(); }
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; }
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; }
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; }
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; }
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()); }