Example #1
0
 partial void ModButtonTouchUpInside(Foundation.NSObject sender)
 {
     _NumberPop       = new NumberModifyPopover();
     _NumberPop.Title = "Die Modifier";
     _NumberPop.Data  = "Die Modifier";
     _NumberPop.Value = _Mod;
     _NumberPop.ShowOnView(ModButton);
     _NumberPop.NumberModified += Handle_NumberPopNumberModified;
 }
Example #2
0
        void HandleTempHPButtonTouchUpInside(object sender, EventArgs e)
        {
            NumberModifyPopover pop = new NumberModifyPopover();

            pop.ShowOnView((UIView)sender);
            pop.Value           = Character.TemporaryHP;
            pop.ValueType       = "TempHP";
            pop.ValueFormat     = "Temporary HP: {0}";
            pop.NumberModified += HandleTempHPPopNumberModified;
        }
Example #3
0
        void HandleNonlethalButtonTouchUpInside(object sender, EventArgs e)
        {
            NumberModifyPopover pop = new NumberModifyPopover();

            pop.ShowOnView((UIView)sender);
            pop.Value           = Character.NonlethalDamage;
            pop.ValueType       = "Nonlethal";
            pop.ValueFormat     = "Nonlethal: {0}";
            pop.NumberModified += HandleNonlethalPopNumberModified;
        }
Example #4
0
        void HandleModButtonTouchUpInside(object sender, EventArgs e)
        {
            NumberModifyPopover pop = new NumberModifyPopover();

            pop.ShowOnView((UIView)sender);
            pop.Value           = Character.Monster.Init;
            pop.ValueType       = "Init";
            pop.ValueFormat     = "Init Mod: {0}";
            pop.NumberModified += HandleInitPopNumberModified;
        }
        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();
        }
Example #6
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;
        }
Example #7
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;
        }
Example #8
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;
        }
Example #9
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;
        }
Example #10
0
        private void InitButtonTouchUpInside(object sender, EventArgs e)
        {
            GradientButton b  = (GradientButton)sender;
            Character      ch = (Character)b.Data;

            if (ch != null)
            {
                NumberModifyPopover pop = new NumberModifyPopover();
                pop.ShowOnView((UIView)sender);
                pop.Value           = ch.CurrentInitiative;
                pop.ValueType       = "CurrentInit";
                pop.Data            = ch;
                pop.ValueFormat     = "Initiative: {0}";
                pop.NumberModified += HandleInitPopNumberModified;
            }
        }
 void Handle_ButtonTouchUpInside(object sender, EventArgs e)
 {
     if (_ValueList == null)
     {
         if (_Property.PropertyType == typeof(string))
         {
             _TextBoxDialog            = new TextBoxDialog();
             _TextBoxDialog.HeaderText = DisplayTitle;
             _TextBoxDialog.Value      = (string)Value;
             _TextBoxDialog.SingleLine = !_Multiline;
             _TextBoxDialog.OKClicked += Handle_TextBoxDialogOKClicked;
             _DialogParent.AddSubview(_TextBoxDialog.View);
         }
         else if (_Property.PropertyType == typeof(int) || _Property.PropertyType == typeof(int?))
         {
             NumberModifyPopover pop = new NumberModifyPopover();
             pop.ShowOnView(_Button);
             if (_Property.PropertyType == typeof(int?))
             {
                 pop.Value = (int?)Value;
             }
             else
             {
                 pop.Value = (int)Value;
             }
             pop.ValueType       = DisplayTitle;
             pop.Title           = DisplayTitle;
             pop.Data            = _PropertyObject;
             pop.Nullable        = (_Property.PropertyType == typeof(int?));
             pop.NumberModified += HandlePopNumberModified;
         }
         else if (_Property.PropertyType == typeof(DieRoll))
         {
             _HDDialog            = new HDEditorDialog();
             _HDDialog.HeaderText = DisplayTitle;
             _HDDialog.DieRoll    = (DieRoll)Value;
             DialogParent.AddSubview(_HDDialog.View);
             _HDDialog.OKClicked += Handle_HDDialogOKClicked;
         }
         else if (_Property.PropertyType == typeof(bool))
         {
             Value = !(bool)Value;
             UpdateButton();
         }
     }
 }
Example #12
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());
        }
 public PickerDataSource(NumberModifyPopover parent)
 {
     _Parent = parent;
 }
 public PickerDelegate(NumberModifyPopover parent)
 {
     _Parent = parent;
 }