Remove crosshair-only grid mode, keep grid on/off toggle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rolandnsharp
2026-04-05 20:01:22 +10:00
parent 1f320b7ff1
commit 2c04d7f034
2 changed files with 21 additions and 27 deletions

View File

@@ -68,10 +68,7 @@ proc main() =
of Key.Space:
scope.frozen = not scope.frozen
of Key.G:
scope.grid = case scope.grid
of gsGrid: gsCross
of gsCross: gsOff
of gsOff: gsGrid
scope.grid = if scope.grid == gsGrid: gsOff else: gsGrid
else:
discard

View File

@@ -10,7 +10,6 @@ type
GridStyle* = enum
gsGrid ## Full graticule
gsCross ## Center crosshair only
gsOff ## No grid
Scope* = object
@@ -93,33 +92,31 @@ proc drawGraticule*(tb: var TerminalBuffer, w, h: int, grid: GridStyle) =
let cx = w div 2
let cy = h div 2
if grid == gsGrid:
# Division lines
for d in 1..<10:
let x = d * w div 10
if x > 0 and x < w:
for y in 0..<h:
tb.write(x, y, fgGreen, styleDim, "")
for d in 1..<8:
let y = d * h div 8
if y > 0 and y < h:
for x in 0..<w:
tb.write(x, y, fgGreen, styleDim, "")
# Division lines
for d in 1..<10:
let x = d * w div 10
if x > 0 and x < w:
for y in 0..<h:
tb.write(x, y, fgGreen, styleDim, "")
for d in 1..<8:
let y = d * h div 8
if y > 0 and y < h:
for x in 0..<w:
tb.write(x, y, fgGreen, styleDim, "")
# Center crosshair (shown for both gsGrid and gsCross)
# Center crosshair
for x in 0..<w: tb.write(x, cy, fgGreen, styleDim, "")
for y in 0..<h: tb.write(cx, y, fgGreen, styleDim, "")
tb.write(cx, cy, fgGreen, "")
if grid == gsGrid:
# Intersections
for dx in 1..<10:
let x = dx * w div 10
if x > 0 and x < w:
for dy in 1..<8:
let y = dy * h div 8
if y > 0 and y < h:
tb.write(x, y, fgGreen, styleDim, "")
# Intersections
for dx in 1..<10:
let x = dx * w div 10
if x > 0 and x < w:
for dy in 1..<8:
let y = dy * h div 8
if y > 0 and y < h:
tb.write(x, y, fgGreen, styleDim, "")
# ── HUD ──────────────────────────────────────────────────────────────