Partially fix themes

This commit is contained in:
Pieter Vander Vennet 2023-11-13 04:33:25 +01:00
parent 818f3e9017
commit 7c96ad8bf0
13 changed files with 477 additions and 897 deletions

View file

@ -395,10 +395,11 @@ class LayerOverviewUtils extends Script {
JSON.stringify({ layers: Array.from(sharedLayers.values()) })
)
const mcChangesPath = "./assets/themes/mapcomplete-changes/mapcomplete-changes.json"
if (
recompiledThemes.length > 0 &&
!(recompiledThemes.length === 1 && recompiledThemes[0] === "mapcomplete-changes") &&
args.indexOf("--generate-change-map") >= 0
(args.indexOf("--generate-change-map") >= 0 || !existsSync(mcChangesPath))
) {
// mapcomplete-changes shows an icon for each corresponding mapcomplete-theme
const iconsPerTheme = Array.from(sharedThemes.values()).map((th) => ({
@ -415,10 +416,7 @@ class LayerOverviewUtils extends Script {
)
const rendering = protolayer.pointRendering[0]
rendering.marker[0].icon["mappings"] = iconsPerTheme
writeFileSync(
"./assets/themes/mapcomplete-changes/mapcomplete-changes.json",
JSON.stringify(proto, null, " ")
)
writeFileSync(mcChangesPath, JSON.stringify(proto, null, " "))
}
this.checkAllSvgs()