Annoying Bug in the Loading Screen...
Hi guys! I just solved an annoying bug in the loading screen. So...the problem is when the player is at the world map, then teleports to World 1, there is a comic story. But actually when we are at the comic story page, in the background the game is already playing before the player hits the DONE button. So, of course the monsters will be surrounding the player.
I finished that problem. Here's how I did it:
In the LoadManager, I added this signal:
signal comic_done_btn_pressed
Then, in comic_story.gd:
func _on_donebtn_pressed() -> void:
emit_signal("done_reading") #for emitting the signal done_reading
GameManager.curr_story += 1
queue_free()
after that, I made a new signal function:
func _on_done_reading() -> void:
LoadManager.comic_done_btn_pressed.emit()
I connected func done_reading from comic_story:
Modified the some of code in LoadManager:
func _process(delta):
var load_status = ResourceLoader.load_threaded_get_status(_scene_path, _progress)
match load_status:
0, 2: #? THREAD_LOAD_INVALID_RESOURCE, THREAD_LOAD_FAILED
set_process(false)
return
1: #? THREAD_LOAD_IN_PROGRESS
emit_signal("progress_changed", _progress[0])
3: #? THREAD_LOAD_LOADED
_loaded_resource = ResourceLoader.load_threaded_get(_scene_path)
emit_signal("progress_changed", 1.0)
emit_signal("load_done")
await Signal(comic_done_btn_pressed) #<-- I only added this line
get_tree().change_scene_to_packed(_loaded_resource)
After all those modifications, then...TADAA!!
It works just like what I wanted!