Branching zones G7: collapse empty columns in !zone map

The graph-mode map renderer iterated 0..maxX, emitting a blank slot for
columns whose only inhabitant was a hidden secret node. In Matrix code
blocks the dark background painted that gap as a phantom cell with no
status mark — read in playtest as "a box missing a dot." Collapse
columns with no visible nodes before laying out rows; secret columns
reappear once the player visits them.
This commit is contained in:
prosolis
2026-05-09 16:41:46 -07:00
parent 90ff7666bd
commit b3d3db9142
2 changed files with 51 additions and 4 deletions

View File

@@ -57,9 +57,19 @@ func renderZoneGraphMap(g ZoneGraph, run *DungeonRun) string {
})
}
// Drop columns that have no visible nodes (e.g. when the only
// entry was a hidden secret). Otherwise the render leaves a blank
// slot mid-row that reads as a missing status mark.
visibleX := make([]int, 0, maxX+1)
for x := 0; x <= maxX; x++ {
if len(cols[x]) > 0 {
visibleX = append(visibleX, x)
}
}
// Find max stack height per column for vertical alignment.
maxRows := 0
for x := 0; x <= maxX; x++ {
for _, x := range visibleX {
if len(cols[x]) > maxRows {
maxRows = len(cols[x])
}
@@ -73,9 +83,9 @@ func renderZoneGraphMap(g ZoneGraph, run *DungeonRun) string {
var sb strings.Builder
for row := 0; row < maxRows; row++ {
var top, bot strings.Builder
for x := 0; x <= maxX; x++ {
if x > 0 {
connector, statusGap := graphConnector(g, cols[x-1], cols[x], row, visited)
for i, x := range visibleX {
if i > 0 {
connector, statusGap := graphConnector(g, cols[visibleX[i-1]], cols[x], row, visited)
top.WriteString(connector)
bot.WriteString(statusGap)
}