2025-07-31 17:34:57 +00:00
|
|
|
extends Node
|
|
|
|
## Should always be at the top of autoloads
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
var loader := AssetLoader.new()
|
2025-07-31 23:40:57 +00:00
|
|
|
# No point to load the game if no asset are loaded
|
2025-07-31 17:34:57 +00:00
|
|
|
if loader.critical_error:
|
|
|
|
Engine.get_main_loop().quit(1)
|
|
|
|
return
|
|
|
|
loader.load_all() # TODO: Making it async
|
|
|
|
_start_game()
|
|
|
|
|
|
|
|
|
|
|
|
## This will show a native MessageBox on Windows,
|
|
|
|
## a native dialog on macOS, and GTK/QT dialog on Linux.
|
|
|
|
func _show_error_popup(context:String, message: String) -> void:
|
|
|
|
OS.alert(context+":"+message, context+":Error")
|
|
|
|
|
|
|
|
|
|
|
|
func _start_game() -> void:
|
|
|
|
print("Game starting...")
|
|
|
|
#TODO: Load main menu or world scene
|