1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +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:
Manolis Papadeas 2021-01-10 18:20:17 +02:00
parent b1c0344d0b
commit 4da4f4ebb8

View file

@ -34,6 +34,8 @@ func _ready() -> void:
if Global.config_cache.has_section_key("preferences", "theme"):
var theme_id = Global.config_cache.get_value("preferences", "theme")
if theme_id >= themes.size():
theme_id = 0
change_theme(theme_id)
buttons_container.get_child(theme_id).pressed = true
else: