checkboxes work, might be labeled backwards
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user