コード例 #1
0
        void HandleAttackItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            Weapon w = (Weapon)e.Tag;

            _WeaponItem.Weapon = (Weapon)w.Clone();
            UpdateWeaponDamageText();
        }
コード例 #2
0
        void Handle_ValueListPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            if (StringList)
            {
                List <String> values = ((String)Value).Tokenize(',');

                String clicked = (String)e.Tag;
                if (values.Contains(clicked))
                {
                    if (values.Count > 1 || AllowEmptyStringList)
                    {
                        values.Remove(clicked);
                    }
                }
                else
                {
                    values.Add(clicked);
                }
                Value = values.ToTokenString(',');
            }
            else
            {
                Value = e.Tag;
            }

            UpdateButton();
        }
コード例 #3
0
        void HandleOtherPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            ButtonStringPopover popover = (ButtonStringPopover)sender;
            GradientButton      b       = (GradientButton)popover.Button;

            switch (template)
            {
            case AdvancerTemplate.HalfDragon:
                _DragonColor = (string)e.Tag;
                break;

            case AdvancerTemplate.Skeleton:
                _SelectedSkeletonTypes[b.Tag] = (bool)e.Tag;
                break;

            case AdvancerTemplate.HalfCelestial:
            case AdvancerTemplate.HalfFiend:
                _SelectedStats[b.Tag] = (bool)e.Tag;
                break;

            case AdvancerTemplate.Zombie:
                _ZombieType = (Monster.ZombieType)e.Tag;
                break;
            }
            HandleChange();
        }
コード例 #4
0
        void HandleConditionMenuItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            ButtonStringPopover p  = (ButtonStringPopover)sender;
            ActiveCondition     ac = (ActiveCondition)p.Data;

            if (e.Tag is int)
            {
                int turns = (int)e.Tag;

                if (turns > 0)
                {
                    _CombatState.AddConditionTurns(_Character, ac, turns);
                }
                else
                {
                    _CombatState.RemoveConditionTurns(_Character, ac, -turns);
                }
            }
            else if (e.Tag is string)
            {
                string text = (string)e.Tag;
                if (text == "delete")
                {
                    _Character.Monster.RemoveCondition(ac);
                }
                else if (text == "deleteall")
                {
                    foreach (Character ch in _CombatState.Characters)
                    {
                        ch.RemoveConditionByName(ac.Condition.Name);
                    }
                }
            }
        }
コード例 #5
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;
                }
            }
        }
コード例 #6
0
        void HandleItemLevelClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            ((ButtonStringPopover)sender).Button.Tag = (int)e.Tag;
            ItemLevel level = (ItemLevel)e.Tag;

            _RodButton.Enabled   = level != ItemLevel.Minor;
            _StaffButton.Enabled = level != ItemLevel.Minor;
        }
コード例 #7
0
        void HandleTypePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            string newFilter = (string)e.Tag;

            if (newFilter != typeFilter)
            {
                typeFilter = (string)e.Tag;
                UpdateSubtypeFilterBox();
                Filter();
            }
        }
コード例 #8
0
        void HandleDamageItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            DieStep die = (DieStep)e.Tag;

            _WeaponItem.Step = new DieStep(die.Count, die.Die);

            DieStep step = DieRoll.StepDie(_WeaponItem.Weapon.DamageDie.Step,
                                           -SizeMods.StepsFromMedium(SizeMods.GetSize(_Monster.Size)));


            _WeaponItem.Weapon.DmgM = step.Text;
            _WeaponItem.Weapon.DmgS = DieRoll.StepDie(step, -1).Text;
            UpdateWeaponDamageText();
        }
コード例 #9
0
            void HandleActionsPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
            {
                Character ch = (Character)((ButtonStringPopover)sender).Data;

                CharacterActionItem item = (CharacterActionItem)e.Tag;

                if (item.Action != CharacterActionType.None)
                {
                    CharacterActions.TakeAction(state._CombatState, item.Action, ch, new List <Character>()
                    {
                        ch
                    }, item.Tag);
                }
            }
コード例 #10
0
        void HandleSpecialItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            var v = (Tuple <bool, WeaponSpecialAbility>)e.Tag;

            if (v.Item1)
            {
                _WeaponItem.SpecialAbilitySet.Remove(v.Item2.Name);
            }
            else
            {
                _WeaponItem.SpecialAbilitySet.Add(v.Item2.Name, v.Item2.Name);
            }
            _WeaponItem.SpecialAbilitySet = _WeaponItem.SpecialAbilitySet;
            SpecialButton.SetText(_WeaponItem.SpecialAbilities);
        }
コード例 #11
0
        void HandleAddAttackItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            Weapon w = (Weapon)e.Tag;

            WeaponItem item = new WeaponItem(w);


            if (SetCount() == 0)
            {
                item.MainHand = true;
            }
            AddSetItem(item);
            UpdateAttackStrings();
            PrepareAttackItems();
        }
コード例 #12
0
 void HandleBonusItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     if (e.Tag == null)
     {
         _WeaponItem.MagicBonus       = 0;
         _WeaponItem.Masterwork       = true;
         _WeaponItem.SpecialAbilities = "";
     }
     else
     {
         int bonus = (int)e.Tag;
         _WeaponItem.Masterwork = false;
         _WeaponItem.MagicBonus = bonus;
         if (bonus == 0)
         {
             _WeaponItem.SpecialAbilities = "";
         }
     }
     BonusButton.SetText(BonusText);
     SpecialButton.SetText(_WeaponItem.SpecialAbilities);
     EnableButtons();
 }
コード例 #13
0
        void Handle_AddDiePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            int die = (int)e.Tag;

            bool found = false;

            foreach (DieStep step in _DieSteps)
            {
                if (step.Die == die)
                {
                    step.Count++;
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                DieStep step = new DieStep(1, die);
                _DieSteps.Add(step);
            }

            UpdateDieRoll();
        }
コード例 #14
0
 void HandleSimpleSizePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     simpleSize = (int)e.Tag;
     HandleChange();
 }
コード例 #15
0
 void HandleSimpleOutsiderPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     simpleOutsiderType = (Monster.HalfOutsiderType?)e.Tag;
     HandleChange();
 }
コード例 #16
0
 void HandleAugmentSummoningPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     augmentSummoning = (bool)e.Tag;
     HandleChange();
 }
コード例 #17
0
 void HandleRacialHitDiePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     racialHDChange = (int)e.Tag;
     HandleChange();
 }
コード例 #18
0
 void HandleRacialSizePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     racialSizeChange = (bool)e.Tag;
     HandleChange();
 }
コード例 #19
0
 void HandleRacialBonusPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     racialBonusStat = (Stat)e.Tag;
     HandleChange();
 }
コード例 #20
0
 void HandleCLFilterItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     _CLFilterValue = (int?)e.Tag;
     Filter();
 }
コード例 #21
0
ファイル: SpellsTab.cs プロジェクト: wwpowers01/combatmanager
 void HandleLevelFilterPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     levelFilter = (int?)e.Tag;
     Filter();
 }
コード例 #22
0
 void HandleSkillDetailItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     _DetailText = (string)e.Tag;
     SkillDetailButton.SetText(_DetailText);
     UpdateSkillButtons();
 }
コード例 #23
0
 void HandleSetFilterPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     npcFilter = (int)e.Tag;
     Filter();
 }
コード例 #24
0
 void HandleLevelPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     ((ButtonStringPopover)sender).Button.Tag = (int)e.Tag;
 }
コード例 #25
0
 void HandleAdvancedPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     advancedLevel = (int)e.Tag;
     HandleChange();
 }
コード例 #26
0
ファイル: FeatsTab.cs プロジェクト: KyleADOlson/CombatManager
        void HandleTypeFilterPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            typeFilter = (string)e.Tag;

            Filter();
        }
コード例 #27
0
 void HandleOtherTemplateItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
 {
     template = (AdvancerTemplate)e.Tag;
     HandleChange();
 }