mirror of
https://github.com/edubart/otclient.git
synced 2025-12-13 12:29:46 +01: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:
@@ -4,7 +4,10 @@ importStyle = g_ui.importStyle
|
||||
importFont = g_fonts.importFont
|
||||
setDefaultFont = g_fonts.setDefaultFont
|
||||
|
||||
loadUI = g_ui.loadUI
|
||||
function loadUI(otui, parent)
|
||||
local otuiFilePath = resolvepath(otui, 2)
|
||||
return g_ui.loadUI(otuiFilePath, parent)
|
||||
end
|
||||
|
||||
function displayUI(otui, parent)
|
||||
parent = parent or rootWidget
|
||||
@@ -17,7 +20,6 @@ function createWidget(stylename, parent)
|
||||
parent = rootWidget:recursiveGetChildById(parent)
|
||||
end
|
||||
local widget = g_ui.createWidgetFromStyle(stylename, parent)
|
||||
--widget:setStyle(stylename)
|
||||
return widget
|
||||
end
|
||||
|
||||
@@ -36,6 +38,26 @@ function addEvent(callback, front)
|
||||
return event
|
||||
end
|
||||
|
||||
|
||||
function periodicalEvent(eventFunc, conditionFunc, delay, autoRepeatDelay)
|
||||
delay = delay or 30
|
||||
autoRepeatDelay = autoRepeatDelay or delay
|
||||
|
||||
local func
|
||||
func = function()
|
||||
if conditionFunc and not conditionFunc() then
|
||||
func = nil
|
||||
return
|
||||
end
|
||||
eventFunc()
|
||||
scheduleEvent(func, delay)
|
||||
end
|
||||
|
||||
scheduleEvent(function()
|
||||
func()
|
||||
end, autoRepeatDelay)
|
||||
end
|
||||
|
||||
function removeEvent(event)
|
||||
if event then
|
||||
event:cancel()
|
||||
|
||||
Reference in New Issue
Block a user