checkboxes work, might be labeled backwards

This commit is contained in:
Kistaro Windrider 2023-09-22 23:10:30 -07:00
parent e7a8fdf576
commit 9299b49184
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -137,6 +137,34 @@ function handle_ui_click(x, y)
return return
end end
-- checkboxes: qualify
if (y < 113 or y > 120 or x < 32) return
if x <= 67 then
x -= 32
if (x % 9 == 8) return
local box = x \ 9
--check range
if (box < 0 or box > 3) return
toggle_mask_bit(box)
return
end
x -= 90
if (x % 9 == 8) return
local box = x \ 9
--check range
if (box < 0 or box > 3) return
toggle_mask_bit(box + 4)
return
end
function toggle_mask_bit(n)
local sel = 1 << n
local b = plane_mask & sel
plane_mask = plane_mask & ~sel
if (b > 0) return
plane_mask = plane_mask | sel
end end
-->8 -->8
-- draw_cursor -- draw_cursor