graphics element enable/disable, click indication on hazard buttons

This commit is contained in:
Mikayla Fischler
2022-10-20 12:22:45 -04:00
parent ab757e14a7
commit 6d5af98310
6 changed files with 88 additions and 47 deletions

View File

@@ -63,12 +63,14 @@ local function switch_button(args)
---@param event monitor_touch monitor touch event
---@diagnostic disable-next-line: unused-local
function e.handle_touch(event)
-- toggle state
e.value = not e.value
draw_state()
if e.enabled then
-- toggle state
e.value = not e.value
draw_state()
-- call the touch callback with state
args.callback(e.value)
-- call the touch callback with state
args.callback(e.value)
end
end
-- set the value