forked from MapComplete/MapComplete
Refactoring: don't include '_ui()'-fields anymore
This commit is contained in:
parent
3b28e3ff21
commit
ce48927db5
1 changed files with 5 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue