fix(flows): udkørselsregler vises kun når en vare bruger dem
Rent lager-flow viste 'sælg fra 90 %' / 'pris >= 90 %' selv om det aldrig sælger. Guidens Regler-trin, resuméet og statuslinjen viser nu kun salgsgrænser ved salg og lagergrænsen ved lager (v1.60.11.0).
This commit is contained in:
@@ -214,8 +214,9 @@ check("FL11 fra tom", partText(lineFor(sumOut, "buildings")), "spu_guide_flow_no
|
||||
check("FL11 varer", partText(lineFor(sumOut, "goods")), "spu_policy_store")
|
||||
check("FL11 varenavn foran", lineFor(sumOut, "goods").parts[1].prefix, "Mælk: ")
|
||||
check("FL11 lager auto", partText(lineFor(sumOut, "store")), "spu_guide_sum_auto")
|
||||
check("FL11 regler", partText(lineFor(sumOut, "rules")), "spu_guide_flow_sumSellAt,spu_guide_flow_sumStoreAbove,spu_guide_flow_sumRound")
|
||||
check("FL11 sælg 95", lineFor(sumOut, "rules").parts[1].args[1], 95)
|
||||
-- varen er kun "lager": salgsgrænsen vises ikke (in-game 29/9)
|
||||
check("FL11 regler (kun lager)", partText(lineFor(sumOut, "rules")), "spu_guide_flow_sumStoreAbove,spu_guide_flow_sumRound")
|
||||
check("FL11 lager over", lineFor(sumOut, "rules").parts[1].args[1], 80)
|
||||
check("FL11 ingen traktorer", partText(lineFor(sumOut, "tractors")), "spu_guide_flow_sumNoTractors")
|
||||
local manyGoods = FG.summary(FG.choose(FG.choose(FG.choose(supply, "ingredientMode", "manual"), "ingredients", {item = "HAY", on = true}), "ingredients", {item = "STRAW", on = true}))
|
||||
check("FL12 valgte varer", partText(lineFor(manyGoods, "goods")), "=Hø + Halm")
|
||||
@@ -294,5 +295,20 @@ check("WG9 husket vogn i kladden", reopened.draft.wagons.s2, "w2")
|
||||
check("WG9 ny solo tager ikke den huskede", FG.choose(reopened, "vehicleIds", {item = "s1", on = true}).draft.wagons.s1, "w1")
|
||||
check("WG9 kladden kopierer (run urørt)", (function() local g = FG.choose(reopened, "wagon", {item = "s2", value = "w1"}); return remembered.wagons.s2 end)(), "w2")
|
||||
|
||||
|
||||
-- regler: kun de relevante for varernes politik
|
||||
local storeOnly = FG.open(newRun("outbound", {products = {{fillType = "MILK", policy = "store"}}}), ctx())
|
||||
local function keys(rows) local r = {} for _, row in ipairs(rows) do if row.id then table.insert(r, row.id) end end return table.concat(r, ",") end
|
||||
check("RL1 kun lager: ingen salgsvalg", keys(FG.rows(at(storeOnly, "rules"))), "storeAbovePercent,collectRound")
|
||||
local sellOnly = FG.open(newRun("outbound", {products = {{fillType = "MILK", policy = "sell"}}}), ctx())
|
||||
check("RL2 kun salg: ingen lagervalg", keys(FG.rows(at(sellOnly, "rules"))), "sellAtPercent,sellAbovePercent,collectRound")
|
||||
local function ruleKeys(guide)
|
||||
for _, line in ipairs(FG.summary(guide)) do
|
||||
if line.step == "rules" then local r = {} for _, p in ipairs(line.parts) do table.insert(r, p.key) end return table.concat(r, ",") end
|
||||
end
|
||||
end
|
||||
check("RL3 resumé kun lager", ruleKeys(storeOnly), "spu_guide_flow_sumStoreAbove")
|
||||
check("RL4 resumé kun salg", ruleKeys(sellOnly), "spu_guide_flow_sumSellAt")
|
||||
|
||||
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
|
||||
os.exit(failures == 0 and 0 or 1)
|
||||
|
||||
Reference in New Issue
Block a user