Here it is.
function drawInventory()
dxDrawRectangle(startposX, startposY, startsizeX, startsizeY, tocolor(0, 0, 0, 180), false)
dxDrawRectangle(startposX, startposY, startsizeX, 20, tocolor(0, 0, 0, 255), false)
dxDrawText("Inventory", startposX, startposY, 1, 1, tocolor(255, 255, 255, 255), 1.20, "default", "left", "top", false, false, false, false, false)
for k, v in pairs (slots) do
if v[3] == true then
dxDrawRectangle(slotposX, slotposY, startsizeX - 10, slotsizeY, tocolor(70, 70, 70, 255), false)
dxDrawText(tostring(v[8]), slotposX + 50, slotposY + 10, 1, 1, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, false, false, false)
if not (v[6] == nil) then
dxDrawImage(slotposX + 5, slotposY + 5, 30, 30, v[6])
end
local minslotposx = slotposX
local minslotposy = slotposY + 40
for y = 1, v[5] do
for x = 1, v[4] do
for key, item in pairs (items) do
if not(x == item[3] and y == item[4]) then
dxDrawRectangle(minslotposx, minslotposy, 30, 30, (isCursorInPosition(minslotposx, minslotposy, 30, 30) and tocolor(85, 85, 85, 255) or tocolor(100, 100, 100, 255)), false)
else
if isCursorInPosition(minslotposx, minslotposy, item[5] * 30 - 1, item[6] * 30 - 1) then
if item[9] == false then
function clickNMove()
if getKeyState("mouse1") then
local cx, cy = getCursorPosition()
local cax, cay = cx * screenW, cy * screenH
local sx, sy = (slotposX) - cax, (slotposY + 40) - cay
local fx, fy = math.abs(math.floor(sx / 31)), math.abs(math.floor(sy / 31))
if fx == item[3] and fy == item[4] then
item[9] = true
if item[9] == true then
slotW = item[3]
slotH = item[4]
else
item[9] = false
end
end
else
item[9] = false
end
end
bindKey("mouse1", "down", clickNMove)
end
end
if v[1] == item[2] then
if v[4] >= (item[3] * item[5] - 1) and v[5] >= (item[4] * item[6] - 1) then
if item[9] == false then
if item[5] > 1 then
if item[6] > 1 then
dxDrawRectangle(minslotposx, minslotposy, (30 * (item[5]) + item[5] - 1), (30 * (item[6]) + item[6] - 1), (isCursorInPosition(minslotposx, minslotposy, (30 * (item[5]) + item[5]), (30 * (item[6]) + item[6])) and tocolor(85, 85, 85, 255) or tocolor(100, 100, 100, 255)), true)
else
dxDrawRectangle(minslotposx, minslotposy, (30 * (item[5]) + item[5] - 1), (30 * (item[6])), (isCursorInPosition(minslotposx, minslotposy, (30 * (item[5]) + item[5]), (30 * (item[6]))) and tocolor(85, 85, 85, 255) or tocolor(100, 100, 100, 255)), true)
end
else
dxDrawRectangle(minslotposx, minslotposy, (30 * (item[5])), (30 * (item[6])), (isCursorInPosition(minslotposx, minslotposy, (30 * (item[5])), (30 * (item[6]))) and tocolor(85, 85, 85, 255) or tocolor(100, 100, 100, 255)), true)
end
dxDrawImage(minslotposx, minslotposy, (30 * item[5]), (30 * item[6]), item[8], 0, 0, 0, tocolor(255, 255, 255, 255), true)
else
local cx, cy = getCursorPosition()
local cax, cay = cx * screenW, cy * screenH
local sx, sy = (slotposX) - cax, (slotposY + 40) - cay
local fx, fy = math.abs(math.floor(sx / 31)), math.abs(math.floor(sy / 31))
if item[5] > 1 then
if item[6] > 1 then
dxDrawRectangle(cax, cay, (30 * (item[5]) + item[5] - 1), (30 * (item[6]) + item[6] - 1), (isCursorInPosition(cax, cay, (30 * (item[5]) + item[5]), (30 * (item[6]) + item[6])) and tocolor(85, 85, 85, 255) or tocolor(100, 100, 100, 255)), true)
else
dxDrawRectangle(cax, cay, (30 * (item[5]) + item[5] - 1), (30 * (item[6])), (isCursorInPosition(cax, cay, (30 * (item[5]) + item[5]), (30 * (item[6]))) and tocolor(85, 85, 85, 255) or tocolor(100, 100, 100, 255)), true)
end
else
dxDrawRectangle(cax, cay, (30 * (item[5])), (30 * (item[6])), (isCursorInPosition(cax, cay, (30 * (item[5])), (30 * (item[6]))) and tocolor(85, 85, 85, 255) or tocolor(100, 100, 100, 255)), true)
end
dxDrawImage(cax, cay, (30 * item[5]), (30 * item[6]), item[8], 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawText(tostring(fx).." "..tostring(fy).." ", 300, 300, 1, 1, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, false, false, false)
function dropSlot()
if fx > v[4] or fy > v[5] then --Sloton kívüli geci
item[9] = false
item[3] = slotW
item[4] = slotH
else
for index, value in pairs (items) do
if fx == value[3] or fy == value[4] then
if item[9] == true then
item[9] = false
item[3] = slotW
item[4] = slotH
end
else
item[3] = fx
item[4] = fy
item[9] = false
end
end
end
end
bindKey("mouse1", "up", dropSlot)
end
else
outputChatBox("Nincs elég hely: "..item[1])
end
end
end
end
minslotposx = minslotposx + slotspace
end
minslotposy = minslotposy + slotspace
minslotposx = slotposX
end
minslotposx = slotposX
minslotposy = slotposY + 45
if (v[5] > 3) then
slotposY = slotposY + 45 * v[5]
else
slotposY = slotposY + space
end
else
dxDrawRectangle(slotposX, slotposY, startsizeX - 10, slotsizeY, tocolor(100, 100, 100, 255), false)
dxDrawText(v[8], slotposX + 50, slotposY + 10, 1, 1, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, false, false, false)
if not (v[6] == nil) then
dxDrawImage(slotposX + 5, slotposY + 5, 30, 30, v[6])
end
slotposY = slotposY + 45
end
end
slotposY = startposY + 25
end