/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); EngManager.spriteBatch = spriteBatch; //LoadDebugMenuContent(); LoadBoardTextures(); LoadBlockTextures(); LoadContextMenuTextures(); //also default font LoadStatDisplay(); LoadDisplayOptions(); LoadScrollMenuTextures(); Creature.baseCommonTexture = Content.Load <Texture2D>("base"); dndManager = new DnDManager(new SRDLibrary(), GetMonsterTextures(), contextMenuTextureSet, boardTextureSet); graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; graphics.ApplyChanges(); //ScrollMenuTest(); // TODO: use this.Content to load your game content here }
public Encounter(DnDManager manager, Vector2 boardDimensions, int boardTileSize, BoardTextureSet boardTextureSet) { DnDManager.encounters.Add(this); library = DnDManager.libraries[0]; contextMenuTextures = manager.menuTextureSet; turn = 0; creatures = new List <Creature>(); initiativeOrder = new List <Creature>(); MakeSquareBoard(new Vector2(0, 0), boardDimensions, boardTileSize, boardTextureSet); }
public override void ButtonPress(List <string> tags, ContextMenuItem item) { base.ButtonPress(tags, item); if (tags.Contains("SpawnMonster")) { tile.board.encounter.SpawnMonster(DnDManager.monsters[tags[1]], tile); } if (tags.Contains(Encounter.EncounterControls.EndTurn.ToString())) { tile.board.encounter.EndTurn(); } if (tags.Contains("NewEncounter")) { DnDManager.NewEncounter(); } if (tags.Contains(Encounter.EncounterControls.SpawnCharacter.ToString())) { } if (tags.Contains(Encounter.EncounterControls.DestroyEncounter.ToString())) { tile.board.encounter.DestroyEncounter(); } if (tags.Contains(Encounter.EncounterControls.SpawnQuickCharacter.ToString())) { tile.board.encounter.SpawnQuickCharacter(tags.GetRange(1, 5), tile); } if (tags.Contains(Encounter.EncounterControls.ShortRest.ToString())) { tile.board.encounter.ShortRest(); } if (tags.Contains(Encounter.EncounterControls.LongRest.ToString())) { tile.board.encounter.LongRest(); } if (!tags.Contains(ContextMenu.DefaultTags.ParentMenu.ToString()) && !tags.Contains(ContextMenu.DefaultTags.NotButton.ToString())) { if (tile != null) { tile.board.encounter.contextMenu = null; } DnDManager.contextMenu = null; DestroyAndChildren(); } }
public DnDManager(Library library, Dictionary <string, Texture2D> monsterTextures, ContextMenuTextureSet menuTextureSet, BoardTextureSet boardTextureSet) { manager = this; ongoingRolls = new List <Roll>(); encounters = new List <Encounter>(); ongoingControls = new List <Control>(); DnDManager.monsterTextures = new Dictionary <string, Texture2D>(monsterTextures); this.menuTextureSet = menuTextureSet; this.boardTextureSet = boardTextureSet; SpellBook.baseContextMenuTextureSet = menuTextureSet; InitializeLibraryLists(); AddLibrary(library); contextMenu = null; }