private void UpdateCharacterPage() { CharacterMenuEquipment SelectedCharacter = GetShopCharacterUnderMouse(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y); if (SelectedCharacter != null && InputHelper.InputConfirmPressed()) { PushScreen(new BuyCharacter(SelectedCharacter, Owner)); } }
public override void Update(GameTime gameTime) { base.Update(gameTime); if (!IsDragDropActive) { CharacterMenuEquipment SelectedCharacter = GetShopCharacterUnderMouse(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y); if (SelectedCharacter != null && InputHelper.InputConfirmPressed()) { PushScreen(new BuyCharacter(SelectedCharacter, Owner)); } } }
public override void Draw(CustomSpriteBatch g) { base.Draw(g); for (int C = 0; C < ListShopCharacter.Count; ++C) { CharacterMenuEquipment SelectedCharacter = GetShopCharacterUnderMouse(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y); if (SelectedCharacter == ListShopCharacter[C]) { BuyCharacterIcon.SetFrame(2); } else { BuyCharacterIcon.SetFrame(0); } BuyCharacterIcon.Draw(g, new Vector2(172, 152 + C * 60), Color.White); g.DrawString(fntText, ListShopCharacter[C].Name, new Vector2(102, 131 + C * 60), Color.White); g.DrawString(fntText, "5", new Vector2(113, 155 + C * 60), Color.White); g.DrawString(fntText, "5", new Vector2(145, 155 + C * 60), Color.White); g.DrawString(fntText, "4", new Vector2(177, 155 + C * 60), Color.White); g.DrawStringRightAligned(fntText, ListShopCharacter[C].Price + " CR", new Vector2(297, 155 + C * 60), Color.White); } }
public BuyCharacter(CharacterMenuEquipment CharacterToBuy, Player Owner) { this.CharacterToBuy = CharacterToBuy; this.Owner = Owner; PlayerInventory = Owner.Equipment; }
public override void Draw(CustomSpriteBatch g) { g.Draw(sprBackground, Vector2.Zero, Color.White); switch (ShopFilter) { case ShopFilters.Characters: for (int C = 0; C < ListShopCharacter.Count; ++C) { CharacterMenuEquipment SelectedCharacter = GetShopCharacterUnderMouse(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y); if (SelectedCharacter == ListShopCharacter[C]) { BuyCharacterIcon.SetFrame(2); } else { BuyCharacterIcon.SetFrame(0); } BuyCharacterIcon.Draw(g, new Vector2(172, 152 + C * 60), Color.White); g.DrawString(fntText, ListShopCharacter[C].Name, new Vector2(102, 131 + C * 60), Color.White); g.DrawString(fntText, "5", new Vector2(113, 155 + C * 60), Color.White); g.DrawString(fntText, "5", new Vector2(145, 155 + C * 60), Color.White); g.DrawString(fntText, "4", new Vector2(177, 155 + C * 60), Color.White); g.DrawStringRightAligned(fntText, ListShopCharacter[C].Price + " CR", new Vector2(297, 155 + C * 60), Color.White); } DrawMyCharactersAndEquipment(g); break; case ShopFilters.Equipment: for (int C = 0; C < ListShopEquipment.Count; ++C) { MenuEquipment EquipmentToBuy = GetShopEquipmentUnderMouse(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y); if (EquipmentToBuy == ListShopEquipment[C]) { BuyItemIcon.SetFrame(2); } else { BuyItemIcon.SetFrame(0); } BuyItemIcon.Draw(g, new Vector2(172, 152 + C * 60), Color.White); g.Draw(ListShopEquipment[C].sprIcon, new Vector2(39, 131 + C * 60), Color.White); g.DrawString(fntText, ListShopEquipment[C].Name, new Vector2(92, 131 + C * 60), Color.White); g.DrawString(fntText, ListShopEquipment[C].EquipmentType.ToString(), new Vector2(92, 155 + C * 60), Color.White); g.DrawStringRightAligned(fntText, ListShopEquipment[C].Price + " CR", new Vector2(297, 155 + C * 60), Color.White); } DrawMyCharactersAndEquipment(g); break; case ShopFilters.Weapons: g.Draw(sprMyWeaponsBackground, new Vector2(358, 84), Color.White); break; case ShopFilters.Items: case ShopFilters.Other: g.Draw(sprMyItemsBackground, new Vector2(358, 84), Color.White); g.Draw(sprMyEquipmentBackground, new Vector2(358, 350), Color.White); break; } foreach (InteractiveButton ActiveButton in ArrayMenuButton) { ActiveButton.Draw(g); } if (DragAndDropEquipment != null) { g.Draw(DragAndDropEquipment.sprIcon, new Vector2(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y), Color.White); } }