feat(flow-guide): listen over traktorer der ikke kan bruges er foldet sammen som standard; linjen med antallet folder ud/ind (v1.36.6.0)

This commit is contained in:
2026-09-27 13:34:23 +02:00
parent a626fcdd95
commit 29a142d3df
5 changed files with 38 additions and 10 deletions
+19 -5
View File
@@ -161,11 +161,25 @@ check("FL9 traktorer: kun egne + ledige", countType(tractorRows, "check"), 2)
check("FL9 egne først", (function() for _, r in ipairs(tractorRows) do if r.type == "check" then return r.item end end end)(), "t4")
check("FL9 skjult andre flows", findRow(tractorRows, "vehicleIds", "t2"), nil)
check("FL9 skjult blokeret", findRow(tractorRows, "vehicleIds", "t3"), nil)
check("FL9 linjer", textKeys(tractorRows), "spu_guide_flow_otherFlows,spu_guide_flow_blocked")
-- in-game 27/9: en parkeret Lintrac dukkede ikke op og ingen kunne se hvorfor — blokerede står med navn + grund
local blockedLine = nil
for _, r in ipairs(tractorRows) do if r.type == "text" and r.label.text ~= nil and r.label.text:find("Traktor 3", 1, true) then blockedLine = r end end
check("FL9 blokeret traktor vises med sin tekst", blockedLine ~= nil, true)
check("FL9 linjer", textKeys(tractorRows), "spu_guide_flow_otherFlows")
-- blokerede traktorer: foldet sammen som standard (in-game 27/9: 37 linjer der ikke kunne bruges fyldte trinnet);
-- linjen med antallet er et link der folder navn + grund ud og ind
local function blockedLine(rows)
for _, r in ipairs(rows) do if r.type == "text" and r.label.text ~= nil and r.label.text:find("Traktor 3", 1, true) then return r end end
return nil
end
local function blockedLink(rows)
for _, r in ipairs(rows) do if r.type == "link" and r.id == "showBlocked" then return r end end
return nil
end
check("FL9 blokerede foldet sammen som standard", blockedLine(tractorRows), nil)
check("FL9 link med antal", blockedLink(tractorRows) ~= nil and blockedLink(tractorRows).label.key, "spu_guide_flow_blockedShow")
local expanded = FG.choose(assigned, "showBlocked", true)
local expandedRows = FG.rows(at(expanded, "tractors"))
check("FL9 foldet ud viser navn + grund", blockedLine(expandedRows) ~= nil, true)
check("FL9 foldet ud: link skjuler igen", blockedLink(expandedRows).label.key, "spu_guide_flow_blockedHide")
check("FL9 fold ud ændrer ikke kladden", expanded.draft.vehicleIds[1], "t4")
check("FL9 fold sammen igen", blockedLine(FG.rows(at(FG.choose(expanded, "showBlocked", true), "tractors"))), nil)
local inThisRun = FG.open(newRun("supply"), ctx({vehicles = {{id = "t2", text = "T2", otherRunId = 1, otherRunName = "Mælk ud"}}}))
check("FL9 traktor i dette flow er ikke 'andet flow'", countType(FG.rows(at(inThisRun, "tractors")), "check"), 1)