mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user