summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-18 21:39:44 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commitc47caec0057dce0466af20d84e02ffb9dcf6aa2c (patch)
treeac3d3a9fd8f6757b47e4d1fb66d9e2543db98502 /tools
parent2629cba9b8f8a48e5fb96333da42760ce040221a (diff)
downloadandean-abyss-c47caec0057dce0466af20d84e02ffb9dcf6aa2c.tar.gz
Rename LoCs.
Diffstat (limited to 'tools')
-rw-r--r--tools/gendata.js4
-rw-r--r--tools/genlayout.py12
2 files changed, 13 insertions, 3 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index 93a72d5..d6efbc5 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -385,8 +385,8 @@ function def_town(name) {
}
function def_loc(type, econ, cities, depts) {
- let name = cities.join(" / ")
- let loc_names = cities.concat(depts)
+ let name = cities.slice().sort().join("-") + " LoC"
+ let loc_names = cities.concat(depts).sort()
for (let n of loc_names)
if (space_name.indexOf(n) < 0)
console.log("not a space: " + n)
diff --git a/tools/genlayout.py b/tools/genlayout.py
index b113e8e..033ef5e 100644
--- a/tools/genlayout.py
+++ b/tools/genlayout.py
@@ -34,7 +34,17 @@ def readsvg(filename):
if line.startswith('height="'): h = round(float(line.split('"')[1]))
if line.startswith('cx="'): x = round(float(line.split('"')[1]))
if line.startswith('cy="'): y = round(float(line.split('"')[1]))
- if line.startswith('inkscape:label="'): name = line.split('"')[1]
+ if line.startswith('inkscape:label="'):
+ name = line.split('"')[1]
+ if " / " in name:
+ if " COIN" in name:
+ name = name.replace(" COIN", "")
+ name = "-".join(sorted(name.split(" / "))) + " LoC COIN"
+ elif " INSURGENTS" in name:
+ name = name.replace(" INSURGENTS", "")
+ name = "-".join(sorted(name.split(" / "))) + " LoC INSURGENTS"
+ else:
+ name = "-".join(sorted(name.split(" / "))) + " LoC"
flush()
readsvg("tools/boxes.svg")