protected override void BuildFilters() { Button b; b = BuildFilterButton("Type", 180); List <String> types = new List <string>(Rule.Types); types.Insert(0, "All"); PopupUtils.AttachButtonStringPopover("Classes", b, types, 0, (r1, index, val) => { _Type = val; UpdateSubtypeButton(); UpdateFilter(); }); _SubtypeButton = BuildFilterButton("Subtype", 180); _SubtypesList.Add("All"); PopupUtils.AttachButtonStringPopover("Classes", _SubtypeButton, _SubtypesList, 0, (r1, index, val) => { _Subtype = val; UpdateFilter(); }); UpdateSubtypeButton(); }
protected override void BuildFilters() { Button b = BuildFilterButton("group", 100); List <String> groups = new List <string>() { "All Groups" }; groups.AddRange(MagicItem.Groups); int startindex = groups.IndexOf(_Group); if (startindex < 0) { startindex = 0; } PopupUtils.AttachButtonStringPopover("Group", b, groups, startindex, (r1, index, val) => { if (index == 0) { _Group = ""; } else { _Group = val; } UpdateFilter(); }); b = BuildFilterButton("cl", 80); List <string> cls = new List <string>() { "All CLs" }; cls.AddRange(from x in MagicItem.CLs select x.ToString()); startindex = 0; if (_CL != -1) { startindex = cls.IndexOf(_CL.ToString()); } PopupUtils.AttachButtonStringPopover("CL", b, cls, startindex, (r1, index, val) => { if (index == 0) { _CL = -1; } else { int.TryParse(val, out _CL); } UpdateFilter(); }); }
protected override void BuildFilters() { Button b; b = BuildFilterButton("Spells", 180); List <String> classes = new List <string>(Spell.SpellAdjuster.Classes.Values); classes.Insert(0, "All Classes"); PopupUtils.AttachButtonStringPopover("Classes", b, classes, 0, (r1, index, val) => { _Class = val; UpdateFilter(); }); b = BuildFilterButton("Levels", 80); List <String> levels = new List <string>(); for (int i = 0; i < 10; i++) { levels.Add(i.PastTense()); } levels.Insert(0, "All Levels"); PopupUtils.AttachButtonStringPopover("Levels", b, levels, 0, (r1, index, val) => { _Level = index - 1; UpdateFilter(); }); b = BuildFilterButton("Schools", 180); List <String> schools = new List <string>(Spell.Schools); schools.Insert(0, "All Schools"); PopupUtils.AttachButtonStringPopover("Schools", b, schools, 0, (r1, index, val) => { _School = val; UpdateFilter(); }); }
protected override void BuildFilters() { Button b; b = BuildFilterButton("type", 180); List <String> fts = new List <string>(Feat.FeatTypes); fts.Insert(0, "All"); PopupUtils.AttachButtonStringPopover("Type", b, fts, 0, (r1, index, val) => { _Type = val; UpdateFilter(); }); }
protected override void BuildFilters() { Button b; b = BuildFilterButton("type", 180); List <String> fts = new List <string>(Feat.FeatTypes); fts.Insert(0, "All"); PopupUtils.AttachButtonStringPopover("Type", b, fts, 0, (r1, index, val) => { _Type = val; UpdateFilter(); }); b = new Button(_v.Context); b.Text = "New"; b.Click += (sender, e) => { NewItem(); }; FilterLayout.AddView(b); NewButton = b; b = new Button(_v.Context); b.Text = "Customize"; b.Click += (sender, e) => { CustomizeItem(); }; FilterLayout.AddView(b); CustomizeButton = b; b = new Button(_v.Context); b.Text = "Edit"; b.Click += (sender, e) => { EditItem(); }; FilterLayout.AddView(b); EditButton = b; }
protected override void BuildFilters() { Button b = BuildFilterButton("group", 100); PopupUtils.AttachButtonStringPopover("Group", b, new List <string> { "All Monsters", "Monsters", "NPCs" }, _group, (r1, index, val) => { _group = index; UpdateFilter(); }); b = BuildFilterButton("type", 180); List <String> cts = new List <String>(from s in Monster.CreatureTypeNames select s.Capitalize()); cts.Insert(0, "All Types"); PopupUtils.AttachButtonStringPopover("Type", b, cts, 0, (r1, index, val) => { _type = val; UpdateFilter(); }); b = BuildFilterButton("cr", 80); List <string> crs = new List <string>(Monster.CRList.Values); crs.Insert(0, "All CRs"); PopupUtils.AttachButtonStringPopover("CR", b, crs, 0, (r1, index, val) => { _cr = val; UpdateFilter(); }); }
protected override void BuildFilters() { Button b = BuildFilterButton("group", 100); PopupUtils.AttachButtonStringPopover("Group", b, new List <string> { "All Monsters", "Monsters", "NPCs", "Custom" }, _group, (r1, index, val) => { _group = index; UpdateFilter(); }); b = BuildFilterButton("type", 180); List <String> cts = new List <String>(from s in Monster.CreatureTypeNames select s.Capitalize()); cts.Insert(0, "All Types"); PopupUtils.AttachButtonStringPopover("Type", b, cts, 0, (r1, index, val) => { _type = val; UpdateFilter(); }); b = BuildFilterButton("cr", 80); List <string> crs = new List <string>(Monster.CRList.Values); crs.Insert(0, "All CRs"); PopupUtils.AttachButtonStringPopover("CR", b, crs, 0, (r1, index, val) => { _cr = val; UpdateFilter(); }); b = new Button(_v.Context); b.Text = "New"; b.Click += (sender, e) => { NewItem(); }; FilterLayout.AddView(b); NewButton = b; b = new Button(_v.Context); b.Text = "Customize"; b.Click += (sender, e) => { CustomizeItem(); }; FilterLayout.AddView(b); CustomizeButton = b; b = new Button(_v.Context); b.Text = "Edit"; b.Click += (sender, e) => { EditItem(); }; FilterLayout.AddView(b); EditButton = b; }
protected override void BuildAdditionalLayouts() { LinearLayout barLayout = new LinearLayout(_v.Context); BottomLayout.AddView(barLayout); barLayout.Orientation = Orientation.Horizontal; _AdvancerButton = new Button(_v.Context); _AdvancerButton.Text = "Monster Advancer"; _AdvancerButton.SetCompoundDrawablesWithIntrinsicBounds(ContextCompat.GetDrawable(_v.Context, Resource.Drawable.monster16), null, null, null); barLayout.AddView(_AdvancerButton); _AdvancerButton.Click += (object sender, EventArgs e) => { _AdvancerVisible = !_AdvancerVisible; _AdvancerContainer.Visibility = _AdvancerVisible?ViewStates.Visible:ViewStates.Gone; RefreshItem(); }; _AddButton = new Button(_v.Context); _AddButton.Text = "Add to Combat"; _AddButton.SetCompoundDrawablesWithIntrinsicBounds(ContextCompat.GetDrawable(_v.Context, Resource.Drawable.sword16), null, null, null); barLayout.AddView(_AddButton); _AddButton.Click += (object sender, EventArgs e) => { Monster m = CurrentMonster; if (m != null) { CombatFragment.CombatState.AddMonster(m, Activity.GetCMPrefs().GetRollHP(), true); } }; _AdvancerContainer = new LinearLayout(_v.Context); BottomLayout.AddView(_AdvancerContainer); LayoutInflater vi = (LayoutInflater)_v.Context.GetSystemService(Context.LayoutInflaterService); _AdvancerLayout = vi.Inflate(Resource.Layout.MonsterAdvancer, _AdvancerContainer, false); _AdvancerContainer.Visibility = ViewStates.Gone; _AdvancerContainer.AddView(_AdvancerLayout); CheckBox cb = _AdvancerLayout.FindViewById <CheckBox>(Resource.Id.advancedBox); cb.Click += (object sender, EventArgs e) => { RefreshItem(); }; Button b; b = _AdvancerLayout.FindViewById <Button>(Resource.Id.advancedMultiplierButton); List <String> advMult = new List <string>() { "x1", "x2", "x3" }; PopupUtils.AttachButtonStringPopover("Multiplier", b, advMult, 0, (r1, index, val) => { _advMuliplier = index + 1; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.sizeButton); List <String> sizeOpt = new List <string>() { "Young", "Normal", "Giant" }; PopupUtils.AttachButtonStringPopover("Size", b, sizeOpt, 0, (r1, index, val) => { _sizeChange = index - 1; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.sizeMultiplierButton); List <String> sizeMult = new List <string>() { "x1", "x2" }; PopupUtils.AttachButtonStringPopover("Multiplier", b, sizeMult, 1, (r1, index, val) => { _sizeMultiplier = index + 1; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.outsiderButton); List <String> outsiderList = new List <string>() { "None", "Celestial", "Entropic", "Fiendish", "Resoloute" }; PopupUtils.AttachButtonStringPopover("Multiplier", b, outsiderList, 0, (r1, index, val) => { _outsiderChange = index; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.hdButton); List <String> hdList = new List <string>() { "Remove HD", "No HD", "Add HD" }; PopupUtils.AttachButtonStringPopover("Change HD", b, hdList, 1, (r1, index, val) => { _hdChange = index; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.hdCountButton); List <String> hdCountList = new List <string>(); for (int i = 1; i <= 20; i++) { hdCountList.Add(i.ToString()); } PopupUtils.AttachButtonStringPopover("HD Count", b, hdCountList, 0, (r1, index, val) => { _hdCount = index + 1; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.bonusStatButton); List <String> statList = new List <string>(); for (int i = 0; i < 6; i++) { statList.Add(Monster.StatText((Stat)i)); } PopupUtils.AttachButtonStringPopover("Bonus Stat", b, statList, "Bonus Stat {0}", 0, (r1, index, val) => { _bonusStat = index; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.statChangeButton); List <String> sizeChange50List = new List <string>() { "No Size Change", "Size Change 50% HD" }; PopupUtils.AttachButtonStringPopover("Change Size", b, sizeChange50List, 0, (r1, index, val) => { _sizeChange50HD = index == 1; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.templateButton); List <String> templateList = new List <string>() { "No Template", "Half-Dragon", "Half-Celestial", "Half-Fiend", "Skeleton", "Vampire", "Zombie" }; PopupUtils.AttachButtonStringPopover("Template", b, templateList, 0, (r1, index, val) => { _selectedTemplate = index; UpdateTemplateView(); RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.dragonColorButton); List <String> colorList = new List <string>(Monster.DragonColors); PopupUtils.AttachButtonStringPopover("Color", b, colorList, 0, (r1, index, val) => { _dragonColor = val; RefreshItem(); }); b = _AdvancerLayout.FindViewById <Button>(Resource.Id.zombieButton); List <String> zombieList = new List <string>() { "Regular", "Fast", "Plague" }; PopupUtils.AttachButtonStringPopover("Template", b, zombieList, 0, (r1, index, val) => { _zombieType = index; RefreshItem(); }); cb = _AdvancerLayout.FindViewById <CheckBox>(Resource.Id.augmentSummoningBox); cb.Click += (object sender, EventArgs e) => { RefreshItem(); }; foreach (int id in new List <int>() { Resource.Id.strBox, Resource.Id.dexBox, Resource.Id.conBox, Resource.Id.intBox, Resource.Id.wisBox, Resource.Id.chaBox, Resource.Id.bloodyBox, Resource.Id.burningBox, Resource.Id.championBox, }) { cb = _AdvancerLayout.FindViewById <CheckBox>(id); cb.Click += (object sender, EventArgs e) => { RefreshItem(); }; } UpdateTemplateView(); }
protected override void BuildAdditionalLayouts() { ImageButton ib = new ImageButton(_v.Context); ib.SetImageDrawable(ContextCompat.GetDrawable(_v.Context, Resource.Drawable.wand16)); LeftLayout.AddView(ib); ib.Click += (object sender, EventArgs e) => { ShowLookup(); }; ib.Background = (ContextCompat.GetDrawable(_v.Context, Resource.Drawable.main_tab)); ib.Selected = true; lookupButton = ib; ib = new ImageButton(_v.Context); ib.SetImageDrawable(ContextCompat.GetDrawable(_v.Context, Resource.Drawable.dice16)); LeftLayout.AddView(ib); ib.Click += (object sender, EventArgs e) => { ShowGenerator(); }; ib.Background = (ContextCompat.GetDrawable(_v.Context, Resource.Drawable.main_tab)); generatorButton = ib; LayoutInflater vi = (LayoutInflater)_v.Context.GetSystemService(Context.LayoutInflaterService); _GeneratorLayout = vi.Inflate(Resource.Layout.TreasureGenerator, SearchReplacementLayout, false); SearchReplacementLayout.Visibility = ViewStates.Gone; SearchReplacementLayout.AddView(_GeneratorLayout); Button b; b = _GeneratorLayout.FindViewById <Button>(Resource.Id.byLevelButton); b.Click += (object sender, EventArgs e) => { ShowLevel(true); }; b.Selected = true; b.Background = (ContextCompat.GetDrawable(_v.Context, Resource.Drawable.main_tab)); b = _GeneratorLayout.FindViewById <Button>(Resource.Id.byItemsButton); b.Click += (object sender, EventArgs e) => { ShowLevel(false); }; b.Background = (ContextCompat.GetDrawable(_v.Context, Resource.Drawable.main_tab)); ShowLevel(_LevelVisible); //level generation b = _GeneratorLayout.FindViewById <Button>(Resource.Id.levelButton); List <String> levelList = new List <string>(); for (int i = 1; i <= 20; i++) { levelList.Add(i.ToString()); } PopupUtils.AttachButtonStringPopover("Level", b, levelList, "Level {0}", 0, (r1, index, val) => { _Level = index + 1; }); b = _GeneratorLayout.FindViewById <Button>(Resource.Id.goodsButton); b.SetLeftDrawableResource(Resource.Drawable.emerald16); List <String> goodsList = new List <string>() { "None", "Normal", "Double", "Triple" }; for (int i = 4; i <= 100; i++) { goodsList.Add("x" + i.ToString()); } PopupUtils.AttachButtonStringPopover("Goods", b, goodsList, "Goods {0}", 1, (r1, index, val) => { _Goods = index; }); b = _GeneratorLayout.FindViewById <Button>(Resource.Id.coinButton); b.SetLeftDrawableResource(Resource.Drawable.coins16); PopupUtils.AttachButtonStringPopover("Coin", b, goodsList, "Coin {0}", 1, (r1, index, val) => { _Coin = index; }); b = _GeneratorLayout.FindViewById <Button>(Resource.Id.magicItemsButton); b.SetLeftDrawableResource(Resource.Drawable.wand16); PopupUtils.AttachButtonStringPopover("Items", b, goodsList, "Items {0}", 1, (r1, index, val) => { _MagicItems = index; }); b = _GeneratorLayout.FindViewById <Button>(Resource.Id.generateLevelButton); b.SetLeftDrawableResource(Resource.Drawable.treasure16); b.Click += (object sender, EventArgs e) => { GenerateLevel(); }; //item generation b = _GeneratorLayout.FindViewById <Button>(Resource.Id.countButton); List <String> countList = new List <string>(); for (int i = 1; i <= 100; i++) { countList.Add(i.ToString()); } PopupUtils.AttachButtonStringPopover("Item Count", b, countList, "{0} items(s)", 0, (r1, index, val) => { _ItemCount = index + 1; }); b = _GeneratorLayout.FindViewById <Button>(Resource.Id.itemsLevelButton); List <String> itemLevelList = new List <string>() { "Minor", "Medium", "Major" }; PopupUtils.AttachButtonStringPopover("Item Level", b, itemLevelList, "{0} Level", 0, (r1, index, val) => { _ItemLevel = index; }); b = _GeneratorLayout.FindViewById <Button>(Resource.Id.generateItemsButton); b.Click += (object sender, EventArgs e) => { GenerateItems(); }; b.SetCompoundDrawablesWithIntrinsicBounds(ContextCompat.GetDrawable(_v.Context, Resource.Drawable.treasure16), null, null, null); if (_GeneratorVisible) { ShowGenerator(); } else { ShowLookup(); } }
protected override void BuildFilters() { Button b; b = BuildFilterButton("Spells", 180); List <String> classes = new List <string>(Spell.SpellAdjuster.Classes.Values); classes.Insert(0, "All Classes"); PopupUtils.AttachButtonStringPopover("Classes", b, classes, 0, (r1, index, val) => { _Class = val; UpdateFilter(); }); b = BuildFilterButton("Levels", 80); List <String> levels = new List <string>(); for (int i = 0; i < 10; i++) { levels.Add(i.PastTense()); } levels.Insert(0, "All Levels"); PopupUtils.AttachButtonStringPopover("Levels", b, levels, 0, (r1, index, val) => { _Level = index - 1; UpdateFilter(); }); b = BuildFilterButton("Schools", 180); List <String> schools = new List <string>(Spell.Schools); schools.Insert(0, "All Schools"); PopupUtils.AttachButtonStringPopover("Schools", b, schools, 0, (r1, index, val) => { _School = val; UpdateFilter(); }); b = new Button(_v.Context); b.Text = "New"; b.Click += (sender, e) => { NewItem(); }; FilterLayout.AddView(b); NewButton = b; b = new Button(_v.Context); b.Text = "Customize"; b.Click += (sender, e) => { CustomizeItem(); }; FilterLayout.AddView(b); CustomizeButton = b; b = new Button(_v.Context); b.Text = "Edit"; b.Click += (sender, e) => { EditItem(); }; FilterLayout.AddView(b); EditButton = b; }