mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
fix useWith mouse conflict with resize borders
This commit is contained in:
@@ -1,19 +1,29 @@
|
||||
Mouse = {}
|
||||
|
||||
local cursorChanged = true
|
||||
|
||||
function Mouse.setTargetCursor()
|
||||
g_window.setMouseCursor('/core_styles/cursors/targetcursor.png', {x=9,y=9})
|
||||
cursorChanged = true
|
||||
end
|
||||
|
||||
function Mouse.setHorizontalCursor()
|
||||
g_window.setMouseCursor('/core_styles/cursors/horizontal.png', {x=9,y=4})
|
||||
cursorChanged = true
|
||||
end
|
||||
|
||||
function Mouse.setVerticalCursor()
|
||||
g_window.setMouseCursor('/core_styles/cursors/vertical.png', {x=4,y=9})
|
||||
cursorChanged = true
|
||||
end
|
||||
|
||||
function Mouse.restoreCursor()
|
||||
g_window.restoreMouseCursor()
|
||||
cursorChanged = false
|
||||
end
|
||||
|
||||
function Mouse.isCursorChanged()
|
||||
return cursorChanged
|
||||
end
|
||||
|
||||
function Mouse.isPressed()
|
||||
|
@@ -10,7 +10,7 @@ end
|
||||
|
||||
function UIResizeBorder:onHoverChange(hovered)
|
||||
if hovered then
|
||||
if g_ui.getDraggingWidget() then return end
|
||||
if Mouse.isCursorChanged() or Mouse.isPressed() then return end
|
||||
if self:getWidth() > self:getHeight() then
|
||||
Mouse.setVerticalCursor()
|
||||
self.vertical = true
|
||||
|
@@ -9,7 +9,7 @@ end
|
||||
|
||||
function UISplitter:onHoverChange(hovered)
|
||||
if hovered then
|
||||
if g_ui.getDraggingWidget() then return end
|
||||
if Mouse.isCursorChanged() or Mouse.isPressed() then return end
|
||||
if self:getWidth() > self:getHeight() then
|
||||
Mouse.setVerticalCursor()
|
||||
self.vertical = true
|
||||
|
Reference in New Issue
Block a user