Refactoring: split icons into proper layered icons, fix and rerun shops-thief

This commit is contained in:
Pieter Vander Vennet 2023-10-06 23:56:50 +02:00
parent d6cd0516bb
commit 19a760178b
307 changed files with 26845 additions and 116541 deletions

View file

@ -1,5 +1,4 @@
import * as fs from "fs"
function genImages(dryrun = false) {
console.log("Generating images")
const dir = fs.readdirSync("./assets/svg")
@ -45,6 +44,12 @@ function genImages(dryrun = false) {
if (!dryrun) {
allNames.push(`"${path}": Svg.${name}`)
}
const nameUC = name.toUpperCase().at(0) + name.substring(1)
const svelteCode =
'<script>\nexport let color = "#000000"\n</script>\n' +
svg.replace(/\\"/g, '"').replace(/(rgb\(0%,0%,0%\)|#000000|#000)/g, "{color}")
fs.writeFileSync("./src/assets/svg/" + nameUC + ".svelte", svelteCode, "utf8")
}
module += `public static All = {${allNames.join(",")}};`
module += "}\n"