Create a loading screen after clicking on the main menu buttons #169
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Done in
0fad1dd.ui/LoadingScreen.gd: a cover over the menu with the name of what is opening and a bar that moves. It goes up on the press and the load only starts once it has been on screen for a frame or two, so the frame that blocks happens with something visible rather than behind a menu that has stopped responding.
Two notes on what it deliberately does NOT do:
ResourceLoader.load_threaded_request()was the obvious way to get a real progress bar and it does not work here: asked for these scenes it comes back FAILED, with the text-scene parser reporting errors ("Parse Error ... Rock.tscn:9", "Could not resolve external class member PROFILES") that the same files do not produce throughload(). The scripts and scenes reach each other through global class names and preloads, and that resolution is not available off the loading thread. A progress bar is not worth a menu that sometimes refuses to start the game - and the web build ships with thread support off anyway, so it could never have used that path.A second press while a load is running is ignored. On the web a button fires on PRESS (see IconButton), so an impatient double tap costs nothing to make and used to build the world twice.
Covered in test_main_menu.gd: the cover is up and the menu is still the current scene immediately after the press, and further presses change nothing.