Skip to content

Commit a370175

Browse files
committed
Restore theme hot-reloading functionality
1 parent 701a4ac commit a370175

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
@@ -86,9 +86,6 @@ func _on_Themes_item_selected(index):
8686
var theme_path : String = theme_id_map[index]
8787
RetroHubConfig.config.current_theme = theme_path
8888

89-
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
90-
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.")
91-
9289
func _on_SetThemePath_pressed():
9390
#warning-ignore:return_value_discarded
9491
OS.shell_open(RetroHubConfig.get_themes_dir())

source/Config.gd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ func load_theme() -> bool:
450450
theme_path = get_themes_dir().path_join(current_theme)
451451
else:
452452
theme_path = get_default_themes_dir().path_join(current_theme + ".pck")
453-
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
454453
if not ProjectSettings.is_pack_loaded(theme_path):
455454
if not ProjectSettings.load_resource_pack(theme_path, false):
456455
push_error("Error when loading theme " + theme_path)
@@ -495,10 +494,9 @@ func unload_theme():
495494
save_theme_config()
496495

497496
theme_data = null
498-
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
499-
#if !ProjectSettings.unload_resource_pack(theme_path):
500-
# push_error("Error when unloading theme " + theme_path)
501-
# return
497+
if not ProjectSettings.unload_resource_pack(theme_path):
498+
push_error("Error when unloading theme " + theme_path)
499+
return
502500

503501
func get_theme_config(key, default_value):
504502
if not _theme_config.has(key):

0 commit comments

Comments
 (0)