Add buttons to quickly swap background layers (also in the locationInput), move copyright into home panel, split privacy policy to seperate welcome message tab

This commit is contained in:
Pieter Vander Vennet 2021-11-21 02:44:35 +01:00
parent 1d0fbe701c
commit 37c0129a6d
22 changed files with 477 additions and 183 deletions

View file

@ -1,6 +1,6 @@
import * as fs from "fs";
function genImages() {
function genImages(dryrun = false) {
console.log("Generating images")
const dir = fs.readdirSync("./assets/svg")
@ -17,7 +17,7 @@ function genImages() {
throw "Non-svg file detected in the svg files: " + path;
}
const svg = fs.readFileSync("./assets/svg/" + path, "utf-8")
let svg = fs.readFileSync("./assets/svg/" + path, "utf-8")
.replace(/<\?xml.*?>/, "")
.replace(/fill: ?none;/g, "fill: none !important;") // This is such a brittle hack...
.replace(/\n/g, " ")
@ -26,11 +26,18 @@ function genImages() {
.replace(/"/g, "\\\"")
const name = path.substr(0, path.length - 4)
.replace(/[ -]/g, "_");
if (dryrun) {
svg = "xxx"
}
module += ` public static ${name} = "${svg}"\n`
module += ` public static ${name}_img = Img.AsImageElement(Svg.${name})\n`
module += ` public static ${name}_svg() { return new Img(Svg.${name}, true);}\n`
module += ` public static ${name}_ui() { return new FixedUiElement(Svg.${name}_img);}\n\n`
allNames.push(`"${path}": Svg.${name}`)
if (!dryrun) {
allNames.push(`"${path}": Svg.${name}`)
}
}
module += `public static All = {${allNames.join(",")}};`
module += "}\n";