make Game.gd not rely on autoload/global

This commit is contained in:
2025-06-24 01:14:50 +10:00
parent 20cde0a778
commit 64befd8ec7
33 changed files with 194 additions and 411 deletions

View File

@ -5,14 +5,13 @@ func _ready() -> void:
enet_peer.create_server(Data.DEFAULT_SERVER_PORT, 1)
multiplayer.multiplayer_peer = enet_peer
enet_peer.refuse_new_connections = true
setup_game()
func setup_game() -> void:
loadout_editor = character_select_screen.instantiate() as CharacterSelect
loadout_editor.hero_confirmed.connect(start_game)
add_child(loadout_editor)
Game.chatbox = chatbox
game_manager.chatbox = chatbox
chatbox.username = Data.player_profile.display_name
Data.player_profile.display_name_changed.connect(chatbox.change_username)
loadout_editor.hero_selected.connect(Data.player_profile.set_preferred_class)