/// <summary> /// Resolves inventory links and returns a real inventory item that /// the link is pointing to /// </summary> /// <param name="item"></param> /// <returns></returns> public InventoryItem RealInventoryItem(InventoryItem item) { if (item.IsLink() && Client.Inventory.Store.Contains(item.AssetUUID) && Client.Inventory.Store[item.AssetUUID] is InventoryItem) { return (InventoryItem)Client.Inventory.Store[item.AssetUUID]; } return item; }
TreeNode AddItem(TreeNode parent, InventoryItem item) { TreeNode itemNode = new TreeNode(); itemNode.Name = item.UUID.ToString(); itemNode.Text = ItemLabel(item, false); itemNode.Tag = item; int img = -1; InventoryItem linkedItem = null; if (item.IsLink() && Inventory.Contains(item.AssetUUID) && Inventory[item.AssetUUID] is InventoryItem) { linkedItem = (InventoryItem)Inventory[item.AssetUUID]; } else { linkedItem = item; } if (linkedItem is InventoryWearable) { InventoryWearable w = linkedItem as InventoryWearable; img = GetItemImageIndex(w.WearableType.ToString().ToLower()); } else { img = GetItemImageIndex(linkedItem.AssetType.ToString().ToLower()); } itemNode.ImageIndex = img; itemNode.SelectedImageIndex = img; parent.Nodes.Add(itemNode); lock (UUID2NodeCache) { UUID2NodeCache[item.UUID] = itemNode; } return itemNode; }
private InventoryItem AInventoryItem(InventoryItem item) { if (item.IsLink() && client.Inventory.Store.Contains(item.AssetUUID) && client.Inventory.Store[item.AssetUUID] is InventoryItem) { return (InventoryItem)client.Inventory.Store[item.AssetUUID]; } return item; }