diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-18 15:33:49 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:48 +0100 |
commit | 79edc30c38d3561101e5cb56e35f56c43f7ad4d4 (patch) | |
tree | edf0332e10f8dacfa03803267d37cc00b4f892f2 /tools/gendata.js | |
parent | 91d6d6fbc8243eb544f15e10bd756924e8c720b6 (diff) | |
download | table-battles-79edc30c38d3561101e5cb56e35f56c43f7ad4d4.tar.gz |
data
Diffstat (limited to 'tools/gendata.js')
-rw-r--r-- | tools/gendata.js | 11 |
1 files changed, 7 insertions, 4 deletions
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) { <div class="scenario_player_name">${s.player2}</div> <div class="scenario_line">Cards ${s.cards2}</div> <div class="scenario_line">Morale: ${s.morale2}</div> -<div class="scenario_line">${s.tactical2 ? "Tactical Victory: " + s.tactical2 : ""}</div> +<div class="scenario_line">${s.name !== "Fleurus" && s.tactical2 ? "Tactical Victory: " + s.tactical2 : ""}</div> </div> <div class="rule_text">${s.rule_text}</div> <div class="lore_text">${s.lore_text}</div> @@ -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(`<a href="/table-battles/info/s_${s.number}.html">`, html, '</a>') + // result.push(`<img src="/table-battles/paintings/${s.name.toLowerCase().replaceAll(" ", "_")}.jpg">`) } 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")) |