public InventorySlotView BuildEquipSlot(Slot slot) { var view = new InventorySlotView(slot); view.MouseClick += Slot_view_MouseUp; return(view); }
public void InitSlots() { Children.Clear(); foreach (var slot in Inventory.slots) { var view = new InventorySlotView(slot) { Width = slot_width, Height = slot_height }; RegisterChild(view); view.MouseClick += View_MouseUp; } Width = slot_width * Inventory.Cols + slot_margin * (Inventory.Cols - 1); // Height = slot_height * Inventory.Rows + slot_margin * (Inventory.Rows - 1); }