mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-05 09:52:18 +01:00
Add Toggle to use theme BG in options menu
This commit is contained in:
@@ -16,6 +16,7 @@ let defaultConfig: Configuration
|
||||
last_port: '443',
|
||||
language: 'en',
|
||||
custom_background: '',
|
||||
use_theme_background: false,
|
||||
cert_generated: false,
|
||||
theme: 'default',
|
||||
https_enabled: false,
|
||||
@@ -45,6 +46,7 @@ export interface Configuration {
|
||||
last_port: string
|
||||
language: string
|
||||
custom_background: string
|
||||
use_theme_background: boolean
|
||||
cert_generated: boolean
|
||||
theme: string
|
||||
https_enabled: boolean
|
||||
|
||||
@@ -115,8 +115,8 @@ export async function loadTheme(theme: ThemeList, document: Document) {
|
||||
|
||||
// Set custom background
|
||||
if (theme.customBackgroundURL) {
|
||||
// If the custom bg is already set don't overwrite
|
||||
if (config.custom_background === '') {
|
||||
// If the custom bg is already set don't overwrite unless user wants to force the new background
|
||||
if (config.custom_background === '' || config.use_theme_background) {
|
||||
config.custom_background = theme.customBackgroundURL
|
||||
}
|
||||
}
|
||||
@@ -133,8 +133,8 @@ export async function loadTheme(theme: ThemeList, document: Document) {
|
||||
})
|
||||
|
||||
// Set the background
|
||||
// If the custom bg is already set don't overwrite
|
||||
if (config.custom_background === '') {
|
||||
// If the custom bg is already set don't overwrite unless user wants to force the new background
|
||||
if (config.custom_background === '' || config.use_theme_background) {
|
||||
config.custom_background = bgPath + imageName
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user