Пример #1
0
        void Handle_ActionsPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            CharacterActionItem item = (CharacterActionItem)e.Tag;

            if (item.Action != CharacterActionType.None)
            {
                CharacterActionResult res = CharacterActions.TakeAction(_CombatState, item.Action, _Character, new List <Character>()
                {
                    _Character
                }, item.Tag);
                switch (res)
                {
                case CharacterActionResult.NeedConditionDialog:

                    _ConditionView = new ConditionViewController();
                    _ConditionView.ConditionApplied += ConditionApplied;
                    MainUI.MainView.AddSubview(_ConditionView.View);
                    break;

                case CharacterActionResult.NeedNotesDialog:

                    _TextBoxDialog            = new TextBoxDialog();
                    _TextBoxDialog.HeaderText = "Notes";
                    _TextBoxDialog.Value      = _Character.Notes;
                    MainUI.MainView.AddSubview(_TextBoxDialog.View);
                    _TextBoxDialog.OKClicked += Handle_NotesTextBoxDialogOKClicked;
                    break;

                case CharacterActionResult.NeedMonsterEditorDialog:
                    Monster newMonster = (Monster)Character.Monster.Clone();

                    _MonsterEditorDialog = new MonsterEditorDialog(newMonster);
                    _MonsterEditorDialog.MonsterEditorComplete += (sd, monster) =>
                    {
                        Character.Monster.CopyFrom(newMonster);
                    };
                    MainUI.MainView.AddSubview(_MonsterEditorDialog.View);

                    break;

                case CharacterActionResult.RollAttack:
                    DieRollerView.Roller.RollAttack((Attack)item.Tag, _Character);
                    break;

                case CharacterActionResult.RollAttackSet:
                    DieRollerView.Roller.RollAttackSet((AttackSet)item.Tag, _Character);
                    break;

                case CharacterActionResult.RollSave:
                    DieRollerView.Roller.RollSave((Monster.SaveType)item.Tag, _Character);
                    break;

                case CharacterActionResult.RollSkill:
                    var sks = (Tuple <string, string>)item.Tag;
                    DieRollerView.Roller.RollSkill(sks.Item1, sks.Item2, _Character);
                    break;
                }
            }
        }
Пример #2
0
 void DieTextButtonClicked(object sender, EventArgs e)
 {
     _TBDialog            = new TextBoxDialog();
     _TBDialog.SingleLine = true;
     _TBDialog.Value      = _DieText;
     _TBDialog.HeaderText = "Die Roll";
     _TBDialog.OKClicked += (x, ex) =>
     {
         _DieText = _TBDialog.Value;
         _DieTextButton.SetText(_DieText);
     };
     MainUI.MainView.Add(_TBDialog.View);
 }
 void HandleSkillDetailClicked(object sender, EventArgs e)
 {
     _TBDialog            = new TextBoxDialog();
     _TBDialog.HeaderText = "Skill Detail";
     _TBDialog.SingleLine = true;
     _TBDialog.Value      = _DetailText;
     _TBDialog.OKClicked += delegate
     {
         _DetailText = _TBDialog.Value;
         SkillDetailButton.SetText(_DetailText);
     };
     DialogParent.Add(_TBDialog.View);
 }
Пример #4
0
        void HandleNameFieldhandleTouchUpInside(object sender, EventArgs e)
        {
            _TextBoxDialog            = new TextBoxDialog();
            _TextBoxDialog.HeaderText = "Name";
            _TextBoxDialog.Value      = _Character.Name;
            _TextBoxDialog.SingleLine = true;
            _TextBoxDialog.OKClicked += delegate(object s, EventArgs ex)

            {
                _Character.Name = _TextBoxDialog.Value;
            };

            MainUI.MainView.AddSubview(_TextBoxDialog.View);
        }
 private void FeatTextClicked(ParsedFeat f)
 {
     _TextDialog            = new TextBoxDialog();
     _TextDialog.Title      = "Feat Options";
     _TextDialog.Value      = f.Choice;
     _TextDialog.SingleLine = true;
     _TextDialog.OKClicked += (sender, e) =>
     {
         CurrentMonster.FeatsList.Remove(f.Text);
         f.Choice = _TextDialog.Value;
         CurrentMonster.FeatsList.Add(f.Text);
         RebuildFeats();
     };
     DialogParent.Add(_TextDialog.View);
 }
 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();
         }
     }
 }
Пример #7
0
 public TextFieldDelegate(TextBoxDialog owner)
 {
     this._owner = owner;
 }