mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 07:26:49 +01:00
rework map rendering
This commit is contained in:
@@ -13,7 +13,7 @@ local function moveToolTip(tooltip)
|
||||
else
|
||||
pos.x = pos.x + 10
|
||||
end
|
||||
tooltip:setPos(pos)
|
||||
tooltip:setPosition(pos)
|
||||
end
|
||||
|
||||
-- public functions
|
||||
|
||||
@@ -36,10 +36,10 @@ function UIMap:onDrop(widget, mousePos)
|
||||
spinbox:setCurrentIndex(data)
|
||||
|
||||
local okButton = moveWindow:getChildById('buttonOk')
|
||||
okButton.onClick = function() Game.move(widget.currentDragThing, tile:getPos(), spinbox:getCurrentIndex()) okButton:getParent():destroy() widget.currentDragThing = nil end
|
||||
okButton.onClick = function() Game.move(widget.currentDragThing, tile:getPosition(), spinbox:getCurrentIndex()) okButton:getParent():destroy() widget.currentDragThing = nil end
|
||||
moveWindow.onEnter = okButton.onClick
|
||||
else
|
||||
Game.move(widget.currentDragThing, tile:getPos(), 1)
|
||||
Game.move(widget.currentDragThing, tile:getPosition(), 1)
|
||||
end
|
||||
|
||||
return true
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
function Thing:isInsideContainer()
|
||||
local pos = self:getPos()
|
||||
local pos = self:getPosition()
|
||||
return (pos and pos.x == 65535 and pos.y >= 64)
|
||||
end
|
||||
|
||||
function Thing:getContainerId()
|
||||
local pos = self:getPos()
|
||||
local pos = self:getPosition()
|
||||
if not pos then return 0 end
|
||||
return pos.y - 64
|
||||
end
|
||||
|
||||
@@ -46,7 +46,7 @@ function Containers.onContainerOpen(containerId, itemId, name, capacity, hasPare
|
||||
|
||||
if i <= #items then
|
||||
local item = items[i]
|
||||
item:setPos(itemWidget.position)
|
||||
item:setPosition(itemWidget.position)
|
||||
itemWidget:setItem(item)
|
||||
end
|
||||
end
|
||||
@@ -76,7 +76,7 @@ function Containers.onContainerAddItem(containerId, item)
|
||||
|
||||
local swapItem = itemWidget:getItem()
|
||||
if swapItem then
|
||||
swapItem:setPos(nextItemWidget.position)
|
||||
swapItem:setPosition(nextItemWidget.position)
|
||||
nextItemWidget:setItem(swapItem)
|
||||
end
|
||||
|
||||
@@ -85,7 +85,7 @@ function Containers.onContainerAddItem(containerId, item)
|
||||
|
||||
local itemWidget = container:getChildByIndex(1)
|
||||
if not itemWidget then return end
|
||||
item:setPos(itemWidget.position)
|
||||
item:setPosition(itemWidget.position)
|
||||
itemWidget:setItem(item)
|
||||
|
||||
container.itemCount = container.itemCount + 1
|
||||
@@ -98,7 +98,7 @@ function Containers.onContainerUpdateItem(containerId, slot, item)
|
||||
local itemWidget = container:getChildByIndex(slot + 1)
|
||||
if not itemWidget then return end
|
||||
itemWidget:setItem(item)
|
||||
item:setPos(itemWidget.position)
|
||||
item:setPosition(itemWidget.position)
|
||||
end
|
||||
|
||||
function Containers.onContainerRemoveItem(containerId, slot)
|
||||
@@ -117,9 +117,9 @@ function Containers.onContainerRemoveItem(containerId, slot)
|
||||
if not nextItemWidget then return end
|
||||
|
||||
local item = nextItemWidget:getItem()
|
||||
local pos = item:getPos()
|
||||
local pos = item:getPosition()
|
||||
pos.z = pos.z - 1
|
||||
item:setPos(pos)
|
||||
item:setPosition(pos)
|
||||
|
||||
itemWidget:setItem(item)
|
||||
nextItemWidget:setItem(nil)
|
||||
|
||||
Reference in New Issue
Block a user