summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
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")