aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-12-23 04:24:53 +0100
committer Spartan322 <Megacake1234@gmail.com>2023-12-23 04:27:10 +0100
commitf94547021f65a16e4b1819378ded9c845d3950f4 (patch)
tree19798de5713fba500c5091d1a52fb5811f8ff1da /game/src/Game
parent71dd8f7411f37a6621985d39f3ef45b975884d59 (diff)
Add constant GameMenuScene preload to GameStart.gd
Add type hints to GameStart.gd constants Seperate section_name and setting_name from Nodes group in inspector Prefer callable's called_deferred to string caller in GameStart.gd Change `GameStart._initialize_game` to use change_scene_to_packed and GameMenuScene constant to change scene instead
Diffstat (limited to 'game/src/Game')
-rw-r--r--game/src/Game/GameStart.gd8
1 files changed, 5 insertions, 3 deletions
diff --git a/game/src/Game/GameStart.gd b/game/src/Game/GameStart.gd
index 1c230d1..32e70c8 100644
--- a/game/src/Game/GameStart.gd
+++ b/game/src/Game/GameStart.gd
@@ -1,11 +1,13 @@
extends Control
-const LoadingScreen = preload("res://src/Game/LoadingScreen.gd")
-const SoundTabScene = preload("res://src/Game/Menu/OptionMenu/SoundTab.tscn")
+const LoadingScreen := preload("res://src/Game/LoadingScreen.gd")
+const SoundTabScene := preload("res://src/Game/Menu/OptionMenu/SoundTab.tscn")
+const GameMenuScene := preload("res://src/Game/GameMenu.tscn")
@export_subgroup("Nodes")
@export var loading_screen : LoadingScreen
+@export_subgroup("")
@export var section_name : String = "general"
@export var setting_name : String = "base_defines_path"
var _settings_base_path : String = ""
@@ -103,7 +105,7 @@ func _initialize_game() -> void:
print("Loading took ", float(end - start) / 1000000, " seconds")
# change scene in a thread-safe way
- get_tree().call_deferred("change_scene_to_file", "res://src/Game/GameMenu.tscn")
+ get_tree().change_scene_to_packed.call_deferred(GameMenuScene)
func _on_splash_container_splash_end():
loading_screen.show()