public ContextMenuTemplate GetNonEncounterContextMenuTemplate() { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(menuTextureSet.blankTileTextures); template.font = menuTextureSet.baseFont; template.texts = new List <string>() { "New Encounter" }; template.tags = new List <List <string> >() { new List <string>() { "NewEncounter" } }; template.childMenus = new List <ContextMenuTemplate>() { }; return(template); }
public ContextMenuTemplate GetContextMenuEncounterControls() { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.texts = new List <string>() { string.Format("Current Turn : {0}", turn), "End Turn" }; template.tags = new List <List <string> >() { new List <string>() { ContextMenu.DefaultTags.NotButton.ToString() }, new List <string>() { EncounterControls.EndTurn.ToString() } }; return(template); }
public ContextMenuTemplate GetSpawnMonsterMenu(BoardTile tile) { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.tags = new List <List <string> >() { new List <string>() { "SpawnMonster", SRDLibrary.Monsters.Commoner.ToString() }, new List <string>() { "SpawnMonster", SRDLibrary.Monsters.Goblin.ToString() }, new List <string>() { "SpawnMonster", SRDLibrary.Monsters.Cultist.ToString() }, new List <string>() { "SpawnMonster", SRDLibrary.Monsters.CultFanatic.ToString() } }; template.texts = new List <string>() { "Commoner", "Goblin", "Cultist", "Cult Fanatic" }; return(template); }
ContextMenuTemplate GetAttackMenu(Creature creature) { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.tags = new List <List <string> >(); template.texts = new List <string>(); List <Weapon> weapons = creature.GetAttackWeapons(); if (weapons.Count > 0) { for (int w = 0; w < weapons.Count; w++) { if (weapons[w].weaponType != WeaponTypes.Shield) { template.texts.Add(weapons[w].name); template.tags.Add(new List <string>() { CombatActions.Attack.ToString(), w.ToString() }); } } } return(template); }
void ScrollMenuTest() { ContextMenuTemplate scrollTestTemplate = new ContextMenuTemplate(); scrollTestTemplate.tags = new List <List <string> >() { new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>(), new List <string>() }; scrollTestTemplate.texts = new List <string>() { "Test", "Test2", "Test3", "Test4", "Test5", "Test6", "Test7", "Test8", "Test9", "Test10", "Test11", "Test12", "Test13", "Test14", "Test15", "Test16" }; scrollTestTemplate.textures = ButtonTextures.FromList(contextMenuTextureSet.baseTextures); scrollTestTemplate.numberOfColumns = 1; List <ButtonTextures> scrollTextures = new List <ButtonTextures>(new ButtonTextures[5]); scrollTextures[(int)ScrollAreaTextures.ArrowDown] = new ButtonTextures(Content.Load <Texture2D>("scrollDownArrow"), Content.Load <Texture2D>("scrollDownArrowInactive"), Content.Load <Texture2D>("scrollDownArrowInactive"), Content.Load <Texture2D>("scrollDownArrowInactive"), Content.Load <Texture2D>("scrollDownArrowInactive")); scrollTextures[(int)ScrollAreaTextures.ArrowUp] = new ButtonTextures(Content.Load <Texture2D>("scrollUpArrow"), Content.Load <Texture2D>("scrollUpArrowInactive"), Content.Load <Texture2D>("scrollUpArrowInactive"), Content.Load <Texture2D>("scrollUpArrowInactive"), Content.Load <Texture2D>("scrollUpArrowInactive")); scrollTextures[(int)ScrollAreaTextures.Background] = new ButtonTextures(); scrollTextures[(int)ScrollAreaTextures.Scroller] = new ButtonTextures(); scrollTextures[(int)ScrollAreaTextures.ScrollerBackground] = new ButtonTextures(); ScrollMenuTemplate scrollMenuTemplate = new ScrollMenuTemplate(scrollTestTemplate); scrollMenuTemplate.downArrow = scrollTextures[(int)ScrollAreaTextures.ArrowDown]; scrollMenuTemplate.upArrow = scrollTextures[(int)ScrollAreaTextures.ArrowUp]; scrollMenuTemplate.numberOfButtons = 6; //new ScrollArea(scrollTestTemplate, new List<Vector2>() { new Vector2(500, 450), new Vector2(50, 30), new Vector2(50, 130) }, scrollTextures, new Vector2(100, 20), new Vector2(100, 20), 4); //new ScrollMenu(scrollMenuTemplate, new Vector2(500, 500)); new DropDownMenu(scrollMenuTemplate, new Vector2(500, 300), scrollTestTemplate.textures, new Vector2(600, 100), "Test Dropdown"); }
public virtual ContextMenuTemplate ChildMenuBase() { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(caster.encounter.contextMenuTextures.blankTileTextures); template.font = caster.encounter.contextMenuTextures.baseFont; template.texts = new List <string>(); template.tags = new List <List <string> >(); return(template); }
public ContextMenuTemplate BaseControlsTemplate() { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.texts = new List <string>(); template.tags = new List <List <string> >(); return(template); }
public ContextMenuTemplate BaseChildMenuTemplate() { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(creature.encounter.contextMenuTextures.blankTileTextures); template.font = creature.encounter.contextMenuTextures.baseFont; template.texts = new List <string>(); template.tags = new List <List <string> >(); template.childMenus = new List <ContextMenuTemplate>(); template.inactives = new List <bool>(); return(template); }
public ContextMenuTemplate GetContextMenuBlankTile(BoardTile tile) { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.texts = new List <string>() { "Spawn Monster", "Spawn Quick Character", "Spawn Character", "Destroy Encounter" }; template.tags = new List <List <string> >() { new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }, new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }, new List <string>() { EncounterControls.SpawnCharacter.ToString() }, new List <string>() { EncounterControls.DestroyEncounter.ToString() } }; template.childMenus = new List <ContextMenuTemplate>() { GetSpawnMonsterMenu(tile), GetSpawnQuickCharacterSpeciesMenu() }; return(template); }
public ContextMenuTemplate GetSpawnQuickCharacterLevelMenu(string race, string subrace, string playerClass, string subClass) { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.numberOfColumns = 2; template.texts = new List <string>(); template.tags = new List <List <string> >(); for (int i = 0; i < 20; i++) { template.texts.Add((i + 1).ToString()); template.tags.Add(new List <string>() { EncounterControls.SpawnQuickCharacter.ToString(), race, subrace, playerClass, subClass, (i + 1).ToString() }); } return(template); }
public ContextMenuTemplate GetSpawnQuickCharacterClassMenu(string race, string subRace) { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.texts = new List <string>(DnDManager.classes.Keys); template.tags = new List <List <string> >(); template.childMenus = new List <ContextMenuTemplate>(); for (int i = 0; i < DnDManager.classes.Keys.Count; i++) { template.tags.Add(new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }); template.childMenus.Add(GetSpawnQuickCharacterSubClassMenu(race, subRace, DnDManager.classes.Keys.ElementAt <string>(i))); } return(template); }
public ContextMenuTemplate SpellControls() { if (!(spells.Count > 0)) { return(null); } ContextMenuTemplate spellControls = new ContextMenuTemplate(); ContextMenuTemplate[] spellControlsEachLevel = new ContextMenuTemplate[10]; for (int i = 0; i <= 9; i++) { spellControlsEachLevel[i] = new ContextMenuTemplate(); spellControlsEachLevel[i].textures = ButtonTextures.FromList(contextMenuTextures.baseTextures); spellControlsEachLevel[i].font = contextMenuTextures.baseFont; spellControlsEachLevel[i].texts = new List <string>(); spellControlsEachLevel[i].tags = new List <List <string> >(); spellControlsEachLevel[i].inactives = new List <bool>(); spellControlsEachLevel[i].childMenus = new List <ContextMenuTemplate>(); } foreach (Spell spell in spells) { if (!spell.hideInSpellbook) { spellControlsEachLevel[spell.spellLevel].texts.Add(spell.name); if (spell.childMenu) { spellControlsEachLevel[spell.spellLevel].tags.Add(new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }); } else { spellControlsEachLevel[spell.spellLevel].tags.Add(new List <string>() { CombatActions.CastSpell.ToString(), spells.IndexOf(spell).ToString() }); } spellControlsEachLevel[spell.spellLevel].inactives.Add(!spell.CheckCastable(owner)); spellControlsEachLevel[spell.spellLevel].childMenus.Add(spell.GetChildMenu()); } } spellControls.textures = ButtonTextures.FromList(contextMenuTextures.baseTextures); spellControls.font = contextMenuTextures.baseFont; spellControls.texts = new List <string>(); spellControls.tags = new List <List <string> >(); spellControls.childMenus = new List <ContextMenuTemplate>(); if (spellsByLevel[0].Count > 0) { spellControls.texts.Add("Cantrips"); spellControls.tags.Add(new List <string>() { 0.ToString(), ContextMenu.DefaultTags.ParentMenu.ToString() }); spellControls.childMenus.Add(spellControlsEachLevel[0]); } for (int i = 1; i <= 9; i++) { if (ContainsSpellLevel(i)) { spellControls.texts.Add(string.Format("Level {0}", i)); spellControls.tags.Add(new List <string>() { i.ToString(), ContextMenu.DefaultTags.ParentMenu.ToString() }); spellControls.childMenus.Add(spellControlsEachLevel[i]); } } return(spellControls); }
public ContextMenuTemplate GetCommandMenu(Creature creature, BoardTile tile = null) { ContextMenuTemplate template = new ContextMenuTemplate(); template.textures = ButtonTextures.FromList(contextMenuTextures.blankTileTextures); template.font = contextMenuTextures.baseFont; template.numberOfColumns = 2; template.texts = new List <string>() { "Info", "Move", "Attack", "Cast a Spell", "Dash", "Disengage", "Dodge", "Help", "Hide", "Search", "Use an Object", "Use a Feat", "Equip Items", "Make Choices" }; template.tags = new List <List <string> >() { new List <string>() { "StatMenu" }, new List <string>() { CombatActions.Move.ToString() }, new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }, new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }, new List <string>() { CombatActions.Dash.ToString() }, new List <string>() { CombatActions.Disengage.ToString() }, new List <string>() { CombatActions.Dodge.ToString() }, new List <string>() { CombatActions.Help.ToString() }, new List <string>() { CombatActions.Hide.ToString() }, new List <string>() { CombatActions.Search.ToString() }, new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }, new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }, new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() }, new List <string>() { ContextMenu.DefaultTags.ParentMenu.ToString() } }; template.childMenus = new List <ContextMenuTemplate>() { null, null, GetAttackMenu(creature), creature.spellbook.SpellControls(), null, null, null, null, null, null, GetUsableObjectMenu(creature), GetFeatMenu(creature), GetEquipMenu(creature), GetChoicesMenu(creature) }; template.inactives = new List <bool>() { false, !creature.CanMove, (creature.AttacksLeft == 0 || (creature.actionTaken && !creature.attacked)), creature.silenced, creature.actionTaken, creature.actionTaken, creature.actionTaken, creature.actionTaken, creature.actionTaken, creature.actionTaken, creature.actionTaken, false }; return(template); }