mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 13:03:27 +02:00
fix use with, improve move, change icons, improve topbar
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
function UIItem:onDragEnter(mousePos)
|
||||
local item = self:getItem()
|
||||
if not item then return false end
|
||||
|
||||
self:setBorderWidth('1')
|
||||
self:setBorderColor('#ffffff')
|
||||
|
||||
self:setBorderWidth(1)
|
||||
|
||||
self.currentDragThing = item
|
||||
setTargetCursor()
|
||||
@@ -13,7 +12,7 @@ end
|
||||
function UIItem:onDragLeave(widget, mousePos)
|
||||
self.currentDragThing = nil
|
||||
restoreCursor()
|
||||
self:setBorderWidth('0')
|
||||
self:setBorderWidth(0)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -24,9 +23,20 @@ function UIItem:onDrop(widget, mousePos)
|
||||
local count = widget.currentDragThing:getData()
|
||||
|
||||
Game.move(widget.currentDragThing, pos, count)
|
||||
self:setBorderWidth(0)
|
||||
return true
|
||||
end
|
||||
|
||||
function UIItem:onHoverChange(hovered)
|
||||
if g_ui.getDraggingWidget() and self ~= g_ui.getDraggingWidget() then
|
||||
if hovered then
|
||||
self:setBorderWidth(1)
|
||||
else
|
||||
self:setBorderWidth(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UIItem:onMouseRelease(mousePosition, mouseButton)
|
||||
local item = self:getItem()
|
||||
if not item or not self:containsPoint(mousePosition) then return false end
|
||||
|
Reference in New Issue
Block a user