mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
Minor fixes and improvements
This commit is contained in:
@@ -83,10 +83,17 @@ local function onTabDragMove(tab, mousePos, mouseMoved)
|
||||
end
|
||||
end
|
||||
|
||||
local function tabBlink(tab)
|
||||
if not tab.blinking then return end
|
||||
local function tabBlink(tab, step)
|
||||
step = step or 0
|
||||
tab:setOn(not tab:isOn())
|
||||
tab.blinkEvent = scheduleEvent(function() tabBlink(tab) end, 500)
|
||||
|
||||
removeEvent(tab.blinkEvent)
|
||||
if step < 4 then
|
||||
tab.blinkEvent = scheduleEvent(function() tabBlink(tab, step+1) end, 500)
|
||||
else
|
||||
tab:setOn(true)
|
||||
tab.blinkEvent = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- public functions
|
||||
@@ -240,7 +247,7 @@ function UIMoveableTabBar:selectPrevTab()
|
||||
end
|
||||
|
||||
function UIMoveableTabBar:blinkTab(tab)
|
||||
if tab:isChecked() or tab.blinking then return end
|
||||
if tab:isChecked() then return end
|
||||
tab.blinking = true
|
||||
tabBlink(tab)
|
||||
end
|
||||
|
@@ -237,7 +237,7 @@ function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
|
||||
if not self.mouseScroll then
|
||||
return false
|
||||
end
|
||||
if mouseWheel == MouseWheelDown then
|
||||
if mouseWheel == MouseWheelUp then
|
||||
if self.orientation == 'vertical' then
|
||||
self:decrement()
|
||||
else
|
||||
|
@@ -19,14 +19,15 @@ function UITextEdit:onMouseWheel(mousePos, mouseWheel)
|
||||
else
|
||||
self.verticalScrollBar:increment()
|
||||
end
|
||||
return true
|
||||
elseif self.horizontalScrollBar then
|
||||
if mouseWheel == MouseWheelUp then
|
||||
self.horizontalScrollBar:increment()
|
||||
else
|
||||
self.horizontalScrollBar:decrement()
|
||||
end
|
||||
return true
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function UITextEdit:onTextAreaUpdate(virtualOffset, virtualSize, totalSize)
|
||||
|
Reference in New Issue
Block a user