Refactoring: don't include '_ui()'-fields anymore

This commit is contained in:
Pieter Vander Vennet 2023-05-08 01:58:53 +02:00
parent 3b28e3ff21
commit ce48927db5

View file

@ -1,4 +1,5 @@
import * as fs from "fs"
import Constants from "../Models/Constants";
function genImages(dryrun = false) {
console.log("Generating images")
@ -32,19 +33,16 @@ function genImages(dryrun = false) {
const name = path.substring(0, path.length - 4).replace(/[ -]/g, "_")
if (dryrun) {
svg = "xxx"
svg = "<omitting svg - dryrun>"
}
let rawName = name
if (dryrun) {
rawName = "add"
}
module += ` public static ${name} = "${svg}"\n`
module += ` public static ${name}_img = Img.AsImageElement(Svg.${rawName})\n`
module += ` public static ${name}_svg() { return new Img(Svg.${rawName}, true);}\n`
module += ` public static ${name}_ui() { return new FixedUiElement(Svg.${rawName}_img);}\n\n`
if (!dryrun) {
// module += ` /**@deprecated*/ public static ${name}_ui() { return new FixedUiElement(Svg.${rawName}_img);}\n\n`
if (Constants.defaultPinIcons.indexOf(name) >= 0 && !dryrun) {
allNames.push(`"${path}": Svg.${name}`)
}
}
@ -54,4 +52,4 @@ function genImages(dryrun = false) {
console.log("Done")
}
genImages()
genImages(false)