public bool FoundAndUpdatedEntry(InventoryObject.InventoryObjectItem _itm) { foreach (Control ec in Controls) { TestSlot tst = ec as TestSlot; if (tst != null && tst.assignedItem.ItemType == _itm.ItemType) { if ((_itm.ItemType as AmmoItemType) != null) { tst.SetQuantity(_itm.Juice); } else { tst.SetQuantity(tst.quantity + 1); unassigned_itms.Add(_itm); } return(true); } } return(false); }
public TestSlot(InventoryObject.InventoryObjectItem _item) { assignedItem = _item; MouseDown += ETestSlot_MouseDown; Size = new ScaleValue(ScaleType.ScaleByResolution, new Vec2(50f, 50f)); Texture b = TextureManager.Instance.Load(assignedItem.ItemType.InvIcon, Texture.Type.Type2D, 0); if (b != null) { BackTexture = b; } else { Log.Warning("Could not load icon for " + assignedItem.ItemType.Name); } clabel.HorizontalAlign = HorizontalAlign.Right; clabel.VerticalAlign = VerticalAlign.Bottom; clabel.TextOffset = new ScaleValue(ScaleType.Parent, new Vec2(0.3f, 0.3f)); clabel.TopMost = clabel.Visible = true; }