Skip to content

Commit e365b68

Browse files
committed
Restore theme hot-reloading functionality
1 parent 170bb77 commit e365b68

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

scenes/config/settings/GeneralSettings.gd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ func _on_Themes_item_selected(index):
9090
var theme_path : String = theme_id_map[index]
9191
RetroHubConfig.config.current_theme = theme_path
9292

93-
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
94-
RetroHubUI.show_warning("Theme reloading is temporarily disabled for this version due to an internal bug in RetroHub's engine (Godot).\n \nYou'll have to restart RetroHub manually to switch themes.")
95-
9693
func _on_SetThemePath_pressed():
9794
#warning-ignore:return_value_discarded
9895
OS.shell_open(RetroHubConfig._get_themes_dir())

source/Config.gd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ func _load_theme() -> bool:
490490
theme_path = _get_themes_dir().path_join(current_theme)
491491
else:
492492
theme_path = _get_default_themes_dir().path_join(current_theme + ".pck")
493-
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
494493
if not ProjectSettings.is_pack_loaded(theme_path):
495494
if not ProjectSettings.load_resource_pack(theme_path, false):
496495
push_error("Error when loading theme " + theme_path)
@@ -535,10 +534,9 @@ func _unload_theme():
535534
save_theme_config()
536535

537536
theme_data = null
538-
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
539-
#if !ProjectSettings.unload_resource_pack(theme_path):
540-
# push_error("Error when unloading theme " + theme_path)
541-
# return
537+
if not ProjectSettings.unload_resource_pack(theme_path):
538+
push_error("Error when unloading theme " + theme_path)
539+
return
542540

543541
func get_theme_config(key, default_value):
544542
if not _theme_config.has(key):

0 commit comments

Comments
 (0)