Studio: studio now supports loading self-made layers in themes

This commit is contained in:
Pieter Vander Vennet 2024-04-23 15:35:18 +02:00
parent 9716bc5425
commit 28bf8cca9f
24 changed files with 826 additions and 464 deletions

View file

@ -39,7 +39,7 @@ export abstract class Conversion<TIn, TOut> {
ConversionContext.print(msg)
}
if (context.hasErrors()) {
throw "Detected one or more errors, stopping now"
throw new Error(["Detected one or more errors, stopping now:", context.getAll("error").map(e => e.context.path.join(".")+": "+e.message)].join("\n\t"))
}
return fixed
}

View file

@ -186,7 +186,7 @@ class AddDefaultLayers extends DesugaringStep<LayoutConfigJson> {
convert(json: LayoutConfigJson, context: ConversionContext): LayoutConfigJson {
const state = this._state
json.layers = [...(json.layers ?? [])]
json.layers = Utils.NoNull([...(json.layers ?? [])])
const alreadyLoaded = new Set(json.layers.map((l) => l["id"]))
for (const layerName of Constants.added_by_default) {