Small and quick fixes:

- setTheme, getTheme and loadTheme changed the wrong reference
- XML changed number properties to be usable with reactive values
This commit is contained in:
Robert Jelic
2025-02-25 09:09:32 +01:00
parent 8b3dd38dfa
commit 34bf53e66c
2 changed files with 6 additions and 4 deletions

View File

@@ -185,14 +185,14 @@ local themeAPI = {}
--- @shortDescription Sets a new theme
--- @param newTheme table The theme configuration to set
function themeAPI.setTheme(newTheme)
defaultTheme = newTheme
themes.default = newTheme
end
--- Gets the current theme configuration
--- @shortDescription Gets the current theme
--- @return table theme The current theme configuration
function themeAPI.getTheme()
return defaultTheme
return themes.default
end
--- Loads a theme from a JSON file
@@ -203,7 +203,7 @@ function themeAPI.loadTheme(path)
if file then
local content = file.readAll()
file.close()
defaultTheme = textutils.unserializeJSON(content)
themes.default = textutils.unserializeJSON(content)
end
end