public void CreateMenuItems() { SlotItem grenadeItem = new Grenade(grenade); SlotItem grenadeItemBackup = new Grenade(grenade); SlotItem grenadeItemBackup2 = new Grenade(grenade); SlotItem blankItem = new Grenade(empty); MagicBar mBar = new MagicBar(shield); HealthBar hBar = hudHealth = new HealthBar(trans); ShieldBar sBar = new ShieldBar(empty); Rectangle hBarTrans = new Rectangle(0, 0, 200, 75); grenadeItem.IsPrimary = true; grenadeItemBackup.IsSecondary = true; transparencies.Add(hBarTrans); hudElements.Add(mBar); hudElements.Add(hBar); hudElements.Add(sBar); primary = AddWeaponSlot(grenadeItem); AddWeaponSlot(grenadeItemBackup); AddWeaponSlot(grenadeItemBackup2); for (int i = currentSlots; i <= MAX_WEAPON_SLOTS; i++) { AddWeaponSlot(grenadeItemBackup2); } }
public void UpdatePrimaryItems(Entity character) { IMenuItem item = (IMenuItem)character.InventoryItem; if (item != null) { arrowItem = new Grenade(currentLevel.RenderManager.TextureCache.GetResource(item.Texture)); arrowItem.IsPrimary = true; hudElements[FindPrimary()] = new WeaponSlot(arrowItem, blank); } }
public WeaponSlot AddWeaponSlot(SlotItem item) { WeaponSlot slot = new WeaponSlot(item, outline); HudElements.Add(slot); currentSlots++; return slot; }