mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 07:26:49 +01:00
fix move on different floors, dragqueen border on uiitem
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
function UIItem:onDragEnter(mousePos)
|
||||
local item = self:getItem()
|
||||
if not item then return false end
|
||||
|
||||
self:setBorderWidth('1')
|
||||
self:setBorderColor('#ffffff')
|
||||
|
||||
self.currentDragThing = item
|
||||
setTargetCursor()
|
||||
@@ -10,6 +13,7 @@ end
|
||||
function UIItem:onDragLeave(widget, mousePos)
|
||||
self.currentDragThing = nil
|
||||
restoreCursor()
|
||||
self:setBorderWidth('0')
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -23,7 +27,6 @@ function UIItem:onDrop(widget, mousePos)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
function UIItem:onMouseRelease(mousePosition, mouseButton)
|
||||
local item = self:getItem()
|
||||
if not item or not self:containsPoint(mousePosition) then return false end
|
||||
|
||||
@@ -19,10 +19,11 @@ end
|
||||
function UIMap:onDrop(widget, mousePos)
|
||||
if not widget or not widget.currentDragThing then return false end
|
||||
|
||||
local pos = self:getPosition(mousePos)
|
||||
local tile = self:getTile(mousePos)
|
||||
if not tile then return false end
|
||||
local count = 1 -- todo make a window for it
|
||||
|
||||
Game.move(widget.currentDragThing, pos, count)
|
||||
Game.move(widget.currentDragThing, tile:getPos(), count)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user