Merge pull request #816 from dscarpac/hover-counter

Added ability to change generic counter value on hover
This commit is contained in:
Chr1Z 2024-08-15 08:45:21 +02:00 committed by GitHub
commit 1a3d8e1aca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,8 @@ function onLoad(savedData)
val = JSON.decode(savedData)
end
self.max_typed_number = 99
local name = self.getName()
local position = { 0, 0.06, 0 }
@ -56,3 +58,7 @@ function modifyValue(mod)
val = math.min(math.max(val + tonumber(mod), MIN_VALUE), MAX_VALUE)
self.editButton({ index = 0, label = tostring(val) })
end
function onNumberTyped(_, number)
updateVal(number)
end