checkboxes work, might be labeled backwards
This commit is contained in:
parent
e7a8fdf576
commit
9299b49184
@ -137,6 +137,34 @@ function handle_ui_click(x, y)
|
||||
return
|
||||
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
|
||||
-->8
|
||||
-- draw_cursor
|
||||
|
Loading…
Reference in New Issue
Block a user