mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
Implement #261
This commit is contained in:
@@ -591,12 +591,24 @@ function moveStackableItem(item, toPos)
|
||||
spinbox:setValue(0)
|
||||
spinbox:hideButtons()
|
||||
spinbox:focus()
|
||||
spinbox.firstEdit = true
|
||||
|
||||
local spinBoxValueChange = function(self, value)
|
||||
scrollbar:setValue(value)
|
||||
end
|
||||
spinbox.onValueChange = spinBoxValueChange
|
||||
|
||||
local check = function()
|
||||
if spinbox.firstEdit then
|
||||
spinbox:setValue(spinbox:getMaximum())
|
||||
spinbox.firstEdit = false
|
||||
end
|
||||
end
|
||||
g_keyboard.bindKeyPress("Up", function() check() spinbox:up() end, spinbox)
|
||||
g_keyboard.bindKeyPress("Down", function() check() spinbox:down() end, spinbox)
|
||||
g_keyboard.bindKeyPress("PageUp", function() check() spinbox:setValue(spinbox:getValue()+10) end, spinbox)
|
||||
g_keyboard.bindKeyPress("PageDown", function() check() spinbox:setValue(spinbox:getValue()-10) end, spinbox)
|
||||
|
||||
scrollbar.onValueChange = function(self, value)
|
||||
itembox:setItemCount(value)
|
||||
spinbox.onValueChange = nil
|
||||
|
Reference in New Issue
Block a user