Fix some bugs in generation script

This commit is contained in:
Robin van der Linde 2022-12-31 23:51:01 +01:00
parent e3939f1086
commit 2ecdee9245
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D
2 changed files with 903 additions and 302 deletions

View file

@ -80,6 +80,7 @@ function main(){
const signs = JSON.parse(signFile) as SignFile;
for(const sign of signs.traffic_signs){
const originalMapping = originalSignMappings.find(m => m.if === "traffic_sign=" + sign.id);
const iconPath = "./assets/layers/traffic_sign/images/"+signs.country.toLowerCase()+"/"+sign.image.file
// Create new mapping, reusing original translations
const mapping: MappingConfigJson = {
if: "traffic_sign=" + sign.id,
@ -87,12 +88,16 @@ function main(){
...originalMapping?.then,
en: sign.name,
},
hideInAnswer: "_country!="+signs.country.toLowerCase()
hideInAnswer: "_country!="+signs.country.toLowerCase(),
icon: {
path: iconPath,
class: "large"
}
};
const icon: MappingConfigJson = {
if: "traffic_sign=" + sign.id + "(;.*)*$",
then:
"./assets/layers/traffic_sign/images/"+signs.country.toLowerCase()+"/"+sign.image.file
if: "traffic_sign~" + sign.id + "(;.*)*$",
then: iconPath
};
mappings.push(mapping);
iconMappings.push(icon);

File diff suppressed because it is too large Load diff