mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
Spinbox changes
This commit is contained in:
@@ -13,9 +13,9 @@ end
|
||||
|
||||
function UISpinBox:onMouseWheel(mousePos, direction)
|
||||
if direction == MouseWheelUp then
|
||||
self:setValue(self.value + 1)
|
||||
self:up()
|
||||
elseif direction == MouseWheelDown then
|
||||
self:setValue(self.value - 1)
|
||||
self:down()
|
||||
end
|
||||
return true
|
||||
end
|
||||
@@ -59,6 +59,14 @@ function UISpinBox:onStyleApply(styleName, styleNode)
|
||||
end
|
||||
end
|
||||
|
||||
function UISpinBox:up()
|
||||
self:setValue(self.value + 1)
|
||||
end
|
||||
|
||||
function UISpinBox:down()
|
||||
self:setValue(self.value - 1)
|
||||
end
|
||||
|
||||
function UISpinBox:setValue(value)
|
||||
value = math.max(math.min(self.maximum, value), self.minimum)
|
||||
if value == self.value then return end
|
||||
|
Reference in New Issue
Block a user