void HandleAttackItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { Weapon w = (Weapon)e.Tag; _WeaponItem.Weapon = (Weapon)w.Clone(); UpdateWeaponDamageText(); }
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(); }
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(); }
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); } } } }
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; } } }
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; }
void HandleTypePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { string newFilter = (string)e.Tag; if (newFilter != typeFilter) { typeFilter = (string)e.Tag; UpdateSubtypeFilterBox(); Filter(); } }
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(); }
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); } }
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); }
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(); }
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(); }
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(); }
void HandleSimpleSizePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { simpleSize = (int)e.Tag; HandleChange(); }
void HandleSimpleOutsiderPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { simpleOutsiderType = (Monster.HalfOutsiderType?)e.Tag; HandleChange(); }
void HandleAugmentSummoningPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { augmentSummoning = (bool)e.Tag; HandleChange(); }
void HandleRacialHitDiePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { racialHDChange = (int)e.Tag; HandleChange(); }
void HandleRacialSizePopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { racialSizeChange = (bool)e.Tag; HandleChange(); }
void HandleRacialBonusPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { racialBonusStat = (Stat)e.Tag; HandleChange(); }
void HandleCLFilterItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { _CLFilterValue = (int?)e.Tag; Filter(); }
void HandleLevelFilterPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { levelFilter = (int?)e.Tag; Filter(); }
void HandleSkillDetailItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { _DetailText = (string)e.Tag; SkillDetailButton.SetText(_DetailText); UpdateSkillButtons(); }
void HandleSetFilterPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { npcFilter = (int)e.Tag; Filter(); }
void HandleLevelPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { ((ButtonStringPopover)sender).Button.Tag = (int)e.Tag; }
void HandleAdvancedPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { advancedLevel = (int)e.Tag; HandleChange(); }
void HandleTypeFilterPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { typeFilter = (string)e.Tag; Filter(); }
void HandleOtherTemplateItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e) { template = (AdvancerTemplate)e.Tag; HandleChange(); }