Renamed globals to autoloads for clarity
This commit is contained in:
38
shell.gd
38
shell.gd
@@ -1,27 +1,40 @@
|
||||
class_name Shell extends Node
|
||||
static var instance: Shell
|
||||
|
||||
|
||||
@onready var game_server: GameServer = $game_server
|
||||
@onready var game_client: GameClient = $game_client
|
||||
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
instance = self
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
instance.run()
|
||||
|
||||
|
||||
func run() -> void:
|
||||
_load_resources()
|
||||
_load_scene()
|
||||
#_parse_args()
|
||||
#_load_scene()
|
||||
|
||||
var game_core = load("res://game_core.gd").new()
|
||||
game_core.instance.run()
|
||||
|
||||
|
||||
func _load_resources():
|
||||
func _load_resources() -> void:
|
||||
_load_asset_pck()
|
||||
_load_game_pck()
|
||||
_load_lobby_pck()
|
||||
_load_store_pck()
|
||||
_load_mods_manager_pck()
|
||||
|
||||
|
||||
func _load_asset_pck():
|
||||
func _load_asset_pck() -> void:
|
||||
_load_resource_pck("assets.pck")
|
||||
|
||||
func _load_game_pck():
|
||||
func _load_game_pck() -> void:
|
||||
_load_resource_pck("game.pck")
|
||||
|
||||
$data_bridge.free()
|
||||
@@ -32,13 +45,16 @@ func _load_game_pck():
|
||||
add_child(data_bridge)
|
||||
move_child(data_bridge, 0)
|
||||
|
||||
func _load_lobby_pck():
|
||||
func _load_lobby_pck() -> void:
|
||||
_load_resource_pck("lobby-client.pck")
|
||||
|
||||
func _load_store_pck():
|
||||
func _load_store_pck() -> void:
|
||||
_load_resource_pck("store.pck")
|
||||
|
||||
func _load_resource_pck(target: String):
|
||||
func _load_mods_manager_pck() -> void:
|
||||
_load_resource_pck("mods-manager.pck")
|
||||
|
||||
func _load_resource_pck(target: String) -> void:
|
||||
#var TARGET_PCK := OS.get_executable_path().get_base_dir() + "/modules/" + target
|
||||
var TARGET_PCK = "/home/abaddon/Coding/Projects/Active/Godot_Projects/builds/desktop/shell-test/modules/" + target
|
||||
push_warning("PCK Path: ", TARGET_PCK)
|
||||
@@ -53,10 +69,6 @@ func _load_resource_pck(target: String):
|
||||
return
|
||||
|
||||
|
||||
func _load_scene():
|
||||
func _load_scene() -> void:
|
||||
add_child(Globals.multiplayer_data.multiplayer_synchronizer)
|
||||
move_child(Globals.multiplayer_data.multiplayer_synchronizer, 0)
|
||||
|
||||
Globals.game_state.set_game_scene(
|
||||
"res://scenes/screens/start_screen/start.tscn"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user