Skip to content

Commit 4f2cf55

Browse files
committed
Disable theme reloading temporarily
1 parent 8729333 commit 4f2cf55

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

scenes/config/settings/GeneralSettings.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ 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+
8992
func _on_SetThemePath_pressed():
9093
#warning-ignore:return_value_discarded
9194
OS.shell_open(RetroHubConfig.get_themes_dir())

scenes/root/Root.tscn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ script = ExtResource("6")
8787
unique_name_in_owner = true
8888
handle_input_locally = false
8989
size = Vector2i(608, 346)
90+
popup_window = true
9091
content_scale_size = Vector2i(608, 346)
9192
content_scale_mode = 1
9293
content_scale_aspect = 4

source/Config.gd

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,11 @@ func load_theme() -> bool:
427427
theme_path = get_themes_dir() + "/" + current_theme
428428
else:
429429
theme_path = get_default_themes_dir() + "/" + current_theme + ".pck"
430-
if !ProjectSettings.load_resource_pack(theme_path, false):
431-
push_error("Error when loading theme " + theme_path)
432-
return false
430+
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
431+
if not ProjectSettings.is_pack_loaded(theme_path):
432+
if not ProjectSettings.load_resource_pack(theme_path, false):
433+
push_error("Error when loading theme " + theme_path)
434+
return false
433435

434436
load_theme_data()
435437
if theme_data.entry_scene:
@@ -470,9 +472,10 @@ func unload_theme():
470472
save_theme_config()
471473

472474
theme_data = null
473-
if !ProjectSettings.unload_resource_pack(theme_path):
474-
push_error("Error when unloading theme " + theme_path)
475-
return
475+
# FIXME: Theme hot-reloading is disabled until nasty GDScript bug is solved
476+
#if !ProjectSettings.unload_resource_pack(theme_path):
477+
# push_error("Error when unloading theme " + theme_path)
478+
# return
476479

477480
func get_theme_config(key, default_value):
478481
if not _theme_config.has(key):

0 commit comments

Comments
 (0)