Make own equippable inventory - Heyter/helix GitHub Wiki

function PLUGIN:InitializedPlugins()
	-- Inventory slot #1
	local right_hand = ix.item.RegisterEquippableInv("rhand") -- "rhand" = inventory type
	right_hand:SetSize(1, 1) -- slot size (width, height)
	right_hand:SetIcon(Material("icon16/accept.png")) -- icon for PaintSlot. OPTIONAL
	right_hand:SetTitle("R-Hand") -- title slot
	right_hand:SetData("isDraggable", true, "derma") -- slot can draggable
	
	function right_hand:PaintSlot(w,h)
		surface.SetDrawColor( 255, 255, 255, 35 )
		surface.SetMaterial( self:GetIcon() )
		surface.DrawTexturedRect( 0, 0, w, h )
	end
	
	-- Inventory slot #2
	local left_hand = ix.item.RegisterEquippableInv("lhand")
	left_hand:SetSize(1, 1)
	left_hand:SetIcon(Material("icon16/accept.png"))
	left_hand:SetTitle("L-Hand")
	
	function left_hand:PaintSlot(w,h)
		surface.SetDrawColor( 255, 255, 255, 35 )
		surface.SetMaterial( self:GetIcon() )
		surface.DrawTexturedRect( 0, 0, w, h )
	end
end

-- Returns the actual size of the item.
-- By default, the item is set to the size of the inventory, to avoid this equippable_slot_realsize should be set. In this case, it will return the size of the item.
inventory_object:SetData("equippable_slot_realsize", true)