mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
If it's trying to load a theme that doesn't exist, default to the first theme
Useful for cases where a user uses a version with a theme, and goes to a previous version where that theme does not exist
This commit is contained in:
parent
b1c0344d0b
commit
4da4f4ebb8
|
@ -34,6 +34,8 @@ func _ready() -> void:
|
||||||
|
|
||||||
if Global.config_cache.has_section_key("preferences", "theme"):
|
if Global.config_cache.has_section_key("preferences", "theme"):
|
||||||
var theme_id = Global.config_cache.get_value("preferences", "theme")
|
var theme_id = Global.config_cache.get_value("preferences", "theme")
|
||||||
|
if theme_id >= themes.size():
|
||||||
|
theme_id = 0
|
||||||
change_theme(theme_id)
|
change_theme(theme_id)
|
||||||
buttons_container.get_child(theme_id).pressed = true
|
buttons_container.get_child(theme_id).pressed = true
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue