private void RebuildFeats() { _CurrentFeats.Clear(); foreach (string f in CurrentMonster.FeatsList) { ParsedFeat p = new ParsedFeat(f); _CurrentFeats.Add(p); } CurrentFeatsView.ReloadData(); }
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); }
public override void ViewDidLoad() { base.ViewDidLoad(); CurrentFeatsView.DataSource = new CurrentViewDataSource(this); CurrentFeatsView.Delegate = new CurrentViewDelegate(this); AvailableFeatsView.DataSource = new AvailableViewDataSource(this); AvailableFeatsView.Delegate = new AvailableViewDelegate(this); FilterTextView.AllEditingEvents += (sender, e) => FilterFeats(); foreach (string f in CurrentMonster.FeatsList) { ParsedFeat p = new ParsedFeat(f); _CurrentFeats.Add(p); } FilterFeats(); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { DataListViewCell cell = (DataListViewCell)tableView.DequeueReusableCell("CurrentFeatsViewCell"); if (cell == null) { cell = new DataListViewCell(UITableViewCellStyle.Default, "CurrentFeatsViewCell"); } ParsedFeat f = state._CurrentFeats[indexPath.Row]; cell.TextLabel.Text = f.Name; cell.TextLabel.Font = UIFont.SystemFontOfSize(15); GradientButton b = new GradientButton(); b.Frame = new CGRect(0, 3, 160, 22); b.TitleLabel.Font = UIFont.SystemFontOfSize(15); CMStyles.TextFieldStyle(b); b.SetText(f.Choice.NullToEmpty()); b.TouchUpInside += (sender, e) => state.FeatTextClicked(f); UIView view = new UIView(); UIButton x = new UIButton(); UIImage redx = UIImage.FromFile("Images/External/redx.png"); x.SetImage(redx, UIControlState.Normal); x.Frame = new CGRect(165, 0, redx.Size.Width, redx.Size.Height); x.TouchUpInside += (sender, e) => state.DeleteButtonClicked(f); view.Bounds = new CGRect(0, 0, x.Frame.Right, x.Frame.Bottom); view.Add(b); view.Add(x); cell.AccessoryView = view; return(cell); }
private void DeleteButtonClicked(ParsedFeat f) { CurrentMonster.FeatsList.Remove(f.Text); RebuildFeats(); }