mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
scrollbar, options and widgets changes
* complete scrollbar skin * implement scrollbar functionality (scrolling with mouse) * fix onMouseClick issues * add tabs in options (graphics and general tab) * add new option for limiting frame rate using scrollbar * add new widget property "clipping" that will be used on scrollable areas
This commit is contained in:
@@ -15,3 +15,24 @@ end
|
||||
function Mouse.restoreCursor()
|
||||
g_window.restoreMouseCursor()
|
||||
end
|
||||
|
||||
function Mouse.bindAutoPress(widget, callback)
|
||||
connect(widget, { onMousePress = function(widget, mousePos, mouseButton)
|
||||
callback()
|
||||
periodicalEvent(function()
|
||||
callback()
|
||||
end, function()
|
||||
return widget:isPressed()
|
||||
end, 30, 300)
|
||||
return true
|
||||
end })
|
||||
end
|
||||
|
||||
function Mouse.bindPressMove(widget, callback)
|
||||
connect(widget, { onMouseMove = function(widget, mousePos, mouseMoved)
|
||||
if widget:isPressed() then
|
||||
callback(mousePos, mouseMoved)
|
||||
end
|
||||
return true
|
||||
end })
|
||||
end
|
||||
|
Reference in New Issue
Block a user