From 79edc30c38d3561101e5cb56e35f56c43f7ad4d4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 18 Dec 2023 15:33:49 +0100 Subject: data --- tools/gendata.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tools/gendata.js') diff --git a/tools/gendata.js b/tools/gendata.js index 0211a3e..b529fc0 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -545,7 +545,7 @@ for (let s of scenario_records) {
${s.player2}
Cards ${s.cards2}
Morale: ${s.morale2}
-
${s.tactical2 ? "Tactical Victory: " + s.tactical2 : ""}
+
${s.name !== "Fleurus" && s.tactical2 ? "Tactical Victory: " + s.tactical2 : ""}
${s.rule_text}
${s.lore_text}
@@ -574,6 +574,7 @@ body{background-color:dimgray;color:whitesmoke;padding:20px;background-image:url fs.writeFileSync(`info/s_${s.number}.html`, scenario_html[s.number].join("\n")) result.push(``, html, '') + // result.push(``) } catch (err) { console.log(err) } @@ -583,8 +584,10 @@ fs.writeFileSync("info/scenarios.html", result.join("\n")) result = [] result.push("const data = {") -result.push("scenarios: " + JSON.stringify(scenarios,0,"\t") + ",") -result.push("cards: " + JSON.stringify(cards,0,"\t") + ",") -result.push("}") +result.push("scenarios: [") +for (let row of scenarios) result.push(JSON.stringify(row) + ",") +result.push("],\ncards: [") +for (let row of cards) result.push(JSON.stringify(row) + ",") +result.push("],\n}") result.push("if (typeof module!=='undefined') module.exports = data") fs.writeFileSync("data.js", result.join("\n")) -- cgit v1.2.3