From c47caec0057dce0466af20d84e02ffb9dcf6aa2c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 18 Apr 2023 21:39:44 +0200 Subject: Rename LoCs. --- tools/gendata.js | 4 ++-- tools/genlayout.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'tools') 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") -- cgit v1.2.3