feat(background): updated the name of background options

This commit is contained in:
Haoyu Xu
2023-01-19 18:29:32 -05:00
parent f18b5a6116
commit d0bdc2b9e6
4 changed files with 17 additions and 15 deletions

View File

@@ -1,9 +1,11 @@
export default class EnvGenerator {
#config
#assets
#operatorConfig
constructor(config, operatorName, assets) {
this.#config = config.operators[operatorName]
this.#config = config
this.#operatorConfig = config.operators[operatorName]
this.#assets = assets
}
@@ -14,18 +16,19 @@ export default class EnvGenerator {
#promise() {
return new Promise((resolve, reject) => {
resolve([
`VITE_TITLE="${this.#config.title}"`,
`VITE_FILENAME=${this.#config.filename.replace('#', '%23')}`,
`VITE_LOGO_FILENAME=${this.#config.logo}`,
`VITE_FALLBACK_FILENAME=${this.#config.fallback_name.replace('#', '%23')}`,
`VITE_VIEWPORT_LEFT=${this.#config.viewport_left}`,
`VITE_VIEWPORT_RIGHT=${this.#config.viewport_right}`,
`VITE_VIEWPORT_TOP=${this.#config.viewport_top}`,
`VITE_VIEWPORT_BOTTOM=${this.#config.viewport_bottom}`,
`VITE_INVERT_FILTER=${this.#config.invert_filter}`,
`VITE_TITLE="${this.#operatorConfig.title}"`,
`VITE_FILENAME=${this.#operatorConfig.filename.replace('#', '%23')}`,
`VITE_LOGO_FILENAME=${this.#operatorConfig.logo}`,
`VITE_FALLBACK_FILENAME=${this.#operatorConfig.fallback_name.replace('#', '%23')}`,
`VITE_VIEWPORT_LEFT=${this.#operatorConfig.viewport_left}`,
`VITE_VIEWPORT_RIGHT=${this.#operatorConfig.viewport_right}`,
`VITE_VIEWPORT_TOP=${this.#operatorConfig.viewport_top}`,
`VITE_VIEWPORT_BOTTOM=${this.#operatorConfig.viewport_bottom}`,
`VITE_INVERT_FILTER=${this.#operatorConfig.invert_filter}`,
`VITE_IMAGE_WIDTH=2048`,
`VITE_IMAGE_HEIGHT=2048`,
`VITE_BACKGROUND_FILES=${JSON.stringify(this.#assets.backgrounds)}`,
`VITE_BACKGROUND_FOLDER=${this.#config.folder.background}`,
].join('\n'))
})
}