internal void ActivateItem() { Logger.Debug("Active Item:", item.GetFurniClass()); GameScreenManager.Instance.GetInventoryManager().SelectItem(item.GetFurniClass()); GameScreenManager.Instance.GetInventoryManager().GetAllItemSections().ForEach(s => s.Deselect()); this.Select(); GameScreenManager.Instance.GetInventoryManager().ForceUpdateItems(); }
public InventoryItemSection(ContentManager content, int amount, IInventoryItem item, Vector2i position, Vector2i size, out int bodySize) { images = new List <Image>(); fonts = new List <Font>(); headerT = new List <Image>(); headerF = new List <Font>(); this.size = size; this.localPosition = position; this.item = item; this.amount = amount; #region Header String classname = item.GetFurniClass(); Logger.Debug("Generating header for:", classname); if (classname != String.Empty) { if (File.Exists(@"Content/Client/Items/" + classname + "/icon.xnb")) { GameScreenManager.Instance.GetCatalogusManager().catalogusImageManager.GetFurniIcon(classname, out icon); } else { icon = new Image(content, @"Client/Items/CantFindTextureTextures/item_small", Vector2.Zero); } } else { icon = new Image(content, @"Client/Items/CantFindTextureTextures/item_small", Vector2.Zero); } icon.SetPosition(position + new Vector2i(size.X / 2 - icon.dimensions.X / 2, size.Y / 2 - icon.dimensions.Y / 2)); amountT = new Font(content, "Fonts/Inventory/itemAmount", amount.ToString(), new Color(47, 105, 130)); if (amount > 1) { headerF.Add(amountT); } backdrop = new Image(content, "Menu/Inventory/Furni/backdrop", Vector2.Zero); backdropSelected = new Image(content, "Menu/Inventory/Furni/backdropSelected", Vector2.Zero); headerT.Add(backdrop); headerT.Add(icon); #endregion delay = new Timer(200); delay.Elapsed += Delay_Elapsed; bodySize = size.Y; }