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 CustomizeButtonClicked(object sender, EventArgs e) { monsterDialog = new MonsterEditorDialog((Monster)SelectedItem.Clone()); monsterDialog.MonsterEditorComplete += (s, monster) => { MonsterDB.DB.AddMonster(monster); Monster.Monsters.Add(monster); Filter(true); }; MainUI.MainView.AddSubview(monsterDialog.View); }
void NewButtonClicked(object sender, EventArgs e) { monsterDialog = new MonsterEditorDialog((Monster)Monster.BlankMonster()); monsterDialog.MonsterEditorComplete += (s, monster) => { MonsterDB.DB.AddMonster(monster); Monster.Monsters.Add(monster); Filter(true); }; MainUI.MainView.AddSubview(monsterDialog.View); }
void EditButtonClicked(object sender, EventArgs e) { if (SelectedItem.IsCustom) { monsterDialog = new MonsterEditorDialog((Monster)SelectedItem.Clone()); monsterDialog.MonsterEditorComplete += (s, monster) => { MonsterDB.DB.UpdateMonster(monster); Filter(true); }; MainUI.MainView.AddSubview(monsterDialog.View); } }