minor bugfix
This commit is contained in:
parent
4884899f30
commit
8ee07b2582
@ -1,7 +1,5 @@
|
|||||||
local playmatAPI = require("playermat/PlaymatApi")
|
local playmatAPI = require("playermat/PlaymatApi")
|
||||||
local matColor
|
local matColor, handColor, loopId, hovering
|
||||||
local handColor
|
|
||||||
local loopId
|
|
||||||
|
|
||||||
function onLoad()
|
function onLoad()
|
||||||
local buttonParamaters = {}
|
local buttonParamaters = {}
|
||||||
@ -48,12 +46,18 @@ function onDrop() updateColors() end
|
|||||||
-- toggles counting method briefly
|
-- toggles counting method briefly
|
||||||
function onObjectHover(hover_color, obj)
|
function onObjectHover(hover_color, obj)
|
||||||
-- only continue if correct player hovers over "self"
|
-- only continue if correct player hovers over "self"
|
||||||
if obj ~= self or hover_color ~= handColor then return end
|
if obj ~= self or hover_color ~= handColor or hovering then return end
|
||||||
|
|
||||||
|
-- toggle this flag so this doesn't get executed multiple times during the delay
|
||||||
|
hovering = true
|
||||||
|
|
||||||
-- stop loop, toggle "des" and displayed value briefly, then start new loop after 2s
|
-- stop loop, toggle "des" and displayed value briefly, then start new loop after 2s
|
||||||
Wait.stop(loopId)
|
Wait.stop(loopId)
|
||||||
updateValue(true)
|
updateValue(true)
|
||||||
Wait.time(function() loopId = Wait.time(updateValue, 1, -1) end, 2)
|
Wait.time(function()
|
||||||
|
loopId = Wait.time(updateValue, 1, -1)
|
||||||
|
hovering = false
|
||||||
|
end, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- updates the matcolor and handcolor variable
|
-- updates the matcolor and handcolor variable
|
||||||
|
Loading…
Reference in New Issue
Block a user