Skip to content

Commit bfea48f

Browse files
committed
Fix game launching and theme unloading
1 parent 54a751b commit bfea48f

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

scenes/game_launched/GameLaunched.gd

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ func _input(event):
4848
if event.is_action_pressed("rh_menu"):
4949
n_timer.start()
5050

51-
func set_info(logo_path: String, game_name: String, emu_name: String):
52-
n_emu_logo.texture = load(logo_path)
53-
n_game_name.text = game_name_orig_text % game_name
54-
n_emu_name.text = emu_name_orig_text % emu_name
55-
51+
func _ready():
52+
n_emu_logo.texture = load("res://assets/emulators/%s.png" % RetroHub.launched_emulator["name"])
53+
n_game_name.text = game_name_orig_text % RetroHub.launched_game_data.name
54+
n_emu_name.text = emu_name_orig_text % RetroHub.launched_emulator["fullname"]
5655

5756
func _on_Timer_timeout():
5857
RetroHub.kill_game_process()

scenes/popups/scraper/StopScraperDialog.gd

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,5 @@ extends ConfirmationDialog
44

55
@onready var base_text : String = n_stop_description.text
66

7-
func _ready():
8-
# The size is reset by the parent popup, so this prevents this one
9-
# from getting the same size as parent, covering the whole screen
10-
11-
# FIXME: Since Popup is no longer a Control this might not be necessary anymore. Confirm
12-
#size = custom_minimum_size
13-
pass
14-
157
func set_num_games_pending(num_games_pending: int):
168
n_stop_description.text = base_text % num_games_pending

scenes/root/Root.gd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,8 @@ func _on_theme_unload():
115115

116116
func _on_game_loaded(game_data: RetroHubGameData):
117117
var game_launched_child : PackedScene = load("res://scenes/game_launched/GameLaunched.tscn")
118+
n_viewport.clear_theme()
118119
n_viewport.set_theme(game_launched_child)
119-
game_launched_child.set_info(
120-
"res://assets/emulators/%s.png" % RetroHub.launched_emulator["name"],
121-
game_data.name,
122-
RetroHub.launched_emulator["fullname"])
123120
print("Loaded game")
124121

125122
func set_theme_input_enabled(enabled : bool):

scenes/root/Viewport.gd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ func set_theme(scene: PackedScene):
99

1010
func clear_theme():
1111
remove_child(n_theme_node)
12-
n_theme_node.set_process(false)
13-
n_theme_node.set_process_input(false)
14-
n_theme_node.set_process_unhandled_input(false)
15-
n_theme_node.set_process_unhandled_key_input(false)
16-
n_theme_node.set_physics_process(false)
17-
n_theme_node.free()
12+
n_theme_node.queue_free()
1813
#while is_instance_valid(n_theme_node):
1914
# await get_tree().process_frame

0 commit comments

Comments
 (0)