diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-11-20 15:14:37 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:37 +0100 |
commit | 62c5a54f132ec16a673fabb3e62a29864b63f54e (patch) | |
tree | 952bdf15b450d73e7f8ff70b2ab1bdd30a855126 /tools/gendata.js | |
parent | 24eaf8561801306327b0e92570e95a2aea67f0c6 (diff) | |
download | nevsky-62c5a54f132ec16a673fabb3e62a29864b63f54e.tar.gz |
Drop back side of service markers.
Diffstat (limited to 'tools/gendata.js')
-rw-r--r-- | tools/gendata.js | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/tools/gendata.js b/tools/gendata.js index 43ee50d..ef29c5d 100644 --- a/tools/gendata.js +++ b/tools/gendata.js @@ -769,51 +769,49 @@ function to_path(name) { let lord_service = {Russian:[],Teutonic:[]} let vassal_service = {Russian:[],Teutonic:[]} -let last_path, last_side, last_ix +let last_path, last_side -last_path = null +last_path = [] last_side = null lords.forEach((lord,id) => { let side = lord.side let path = "counters300/lord_" + side.toLowerCase() + "_" + to_path(lord.name) if (side !== last_side) { - last_ix = 0 last_side = side + last_path = [] } - lord.image = last_ix - if (path !== last_path) { - last_ix++ - last_path = path + if (!last_path.includes(path)) { + last_path.push(path) lord_service[side].push(path + ".a.png") - lord_service[side].push(path + ".b.png") + // lord_service[side].push(path + ".b.png") } + lord.image = last_path.indexOf(path) }) -last_path = null +last_path = [] last_side = null vassals.forEach((vassal,id) => { let lord = lords[vassal.lord] let side = lord.side let path = "counters300/vassal_" + side.toLowerCase() + "_" + to_path(lord.name) + "_" + to_path(vassal.name) if (side !== last_side) { - last_ix = 0 last_side = side + last_path = [] } - vassal.image = last_ix - if (path !== last_path) { - last_ix++ - last_path = path + if (!last_path.includes(path)) { + last_path.push(path) vassal_service[side].push(path + ".a.png") - vassal_service[side].push(path + ".b.png") + // vassal_service[side].push(path + ".b.png") } + vassal.image = last_path.indexOf(path) }) let script = [] script.push("mkdir -p service300") -script.push("montage -mode concatenate -tile 2x " + lord_service.Teutonic.join(" ") + " service300/service_lords_teutonic.png") -script.push("montage -mode concatenate -tile 2x " + vassal_service.Teutonic.join(" ") + " service300/service_vassals_teutonic.png") -script.push("montage -mode concatenate -tile 2x " + lord_service.Russian.join(" ") + " service300/service_lords_russian.png") -script.push("montage -mode concatenate -tile 2x " + vassal_service.Russian.join(" ") + " service300/service_vassals_russian.png") +script.push("montage -mode concatenate -tile 1x " + lord_service.Teutonic.join(" ") + " service300/service_lords_teutonic.png") +script.push("montage -mode concatenate -tile 1x " + lord_service.Russian.join(" ") + " service300/service_lords_russian.png") +script.push("montage -mode concatenate -tile 3x " + vassal_service.Teutonic.join(" ") + " service300/service_vassals_teutonic.png") +script.push("montage -mode concatenate -tile 3x " + vassal_service.Russian.join(" ") + " service300/service_vassals_russian.png") print("const data = {") print("seaports:" + JSON.stringify(seaports) + ",") |