private void GetPartyMenu(ContainerButton con) { PartyMenuList.Clear(); var pos = new Rectangle(con.Button.Position.X - 1, con.Button.Position.Y, ContentLoader.Button.Width, ContentLoader.Button.Height); //moveButton = new Button(new Rectangle(pos.X, pos.Y, pos.Width, pos.Height), ContentLoader.Button, ContentLoader.ButtonHover, ContentLoader.ButtonClicked, "Move", ContentLoader.Arial); statusButton = new Button(new Rectangle(pos.X, pos.Y, pos.Width, pos.Height), ContentLoader.Button, ContentLoader.ButtonHover, ContentLoader.ButtonClicked, "Status", ContentLoader.Arial); movesButton = new Button(new Rectangle(pos.X, pos.Y + (pos.Height), pos.Width, pos.Height), ContentLoader.Button, ContentLoader.ButtonHover, ContentLoader.ButtonClicked, "Moves", ContentLoader.Arial); PartyMenuList.AddMany(statusButton, movesButton); }
private void GetMoves(ContainerButton con) { movesList.Clear(); for (int i = 0; i < con.Monster.Moves.Count; i++) { var move = con.Monster.Moves[i]; var pos = new Rectangle(0, 0, 220, 100); pos = i < 4 ? new Rectangle(pos.X, pos.Y + (pos.Height * (i)), pos.Width, pos.Height) : new Rectangle(pos.X + pos.Width, pos.Y + ((pos.Height * (i - 4))), pos.Width, pos.Height); var b = new Button(pos, ContentLoader.BRN, ContentLoader.BRN, ContentLoader.BRN, move.Name, ContentLoader.Arial); movesList.Add(new ContainerButton(b, move)); } }
public static void UpdateItemButtons(MouseState cur, MouseState prev) { if (bMedicine != null) if (bMedicine.IsClicked(cur, prev)) { DrawMedicine = true; DrawCapture = false; } if (bCapture != null) if (bCapture.IsClicked(cur, prev)) { DrawCapture = true; DrawMedicine = false; } if (MedicineButtons != null) foreach (var btn in MedicineButtons) { btn.Update(cur, prev); if (btn.Button.IsClicked(cur, prev)) LastClickedContainer = btn; } if (CaptureButtons != null) foreach (var btn in CaptureButtons) { btn.Update(cur, prev); if (btn.Button.IsClicked(cur, prev)) LastClickedContainer = btn; } if (InventoryButtons != null) foreach (var btn in InventoryButtons) { btn.Update(cur, prev); if (btn.IsClicked(cur, prev)) LastClickedButton = btn; } }
private void GetKnownMonsters() { var pos = new Vector2(-96, 0); foreach (var m in player.KnownMonsters.Values) { //Draw monsters from left to right up to the point where no other fits there if (pos.X + (m.FrontSprite.Width * 2) >= Settings.ResolutionWidth) { pos.X = 0; pos.Y += m.FrontSprite.Height; } pos.X += m.FrontSprite.Width; var b = new Button(new Rectangle((int)pos.X, (int)pos.Y, m.FrontSprite.Width, m.FrontSprite.Height), m.FrontSprite); var c = new ContainerButton(b, m); knownMonsterList.Add(c); } }
public void Update(MouseState cur, MouseState prev, GameTime gameTime) { if (Visible) { for (int i = 0; i < Monsters.Count; i++) { var b = Monsters[i]; if (b.Button.IsClicked(cur, prev)) { if (Selected != null) { if (Selected == b) Selected = null; else { ToBeMoved = b; if (Monsters.Contains(Selected)) { MoveMonster(false); } else { MoveMonsterToList(false); } Selected = null; ToBeMoved = null; } } else { Selected = b; } drawStats = true; } b.BoxedMonster.Monster.Update(gameTime); } for (int i = 0; i < Party.Count; i++) { var p = Party[i]; if (p.Button.IsClicked(cur, prev)) { if (Selected != null) { if (Selected == p) Selected = null; else { ToBeMoved = p; if (Party.Contains(Selected)) { MoveMonster(true); } else { MoveMonsterToList(true); } Selected = null; ToBeMoved = null; } } else { Selected = p; } drawStats = true; } p.Monster.Update(gameTime); } } }