summaryrefslogtreecommitdiff
path: root/ui/login.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-01-05 16:54:36 +0100
committerDaniel Weipert <git@mail.dweipert.de>2025-01-05 16:54:36 +0100
commit35b0f811f23f029110373798b19d9d0895d907f0 (patch)
tree2e4906a992c2569fa0f89dbe0f079010a734cc41 /ui/login.gd
parente08a29e73ea4f7e6d78e8e7f5a6e7033dbc1f542 (diff)
next commit
Diffstat (limited to 'ui/login.gd')
-rw-r--r--ui/login.gd24
1 files changed, 10 insertions, 14 deletions
diff --git a/ui/login.gd b/ui/login.gd
index 8cabec8..fb3c80b 100644
--- a/ui/login.gd
+++ b/ui/login.gd
@@ -15,8 +15,6 @@ var current_character_information: CharacterInformation
func _ready() -> void:
switch_screen(%Login)
#$BackgroundMusic.play()
-
- %ChatWindow.visible = false
func switch_screen(screen: Node):
@@ -94,11 +92,15 @@ func _on_character_server_login_pressed(character_server_info: CharacterServerIn
current_character_slot_idx = slot_idx
%CharacterSelectionSlotLabel.text = "%s/%s" % [str(slot_idx + 1), login_character_list.slot_count]
- if slot_idx < character_list.character_information.size():
- current_character_information = character_list.character_information[slot_idx]
+ var info = login_character_list.get_info_for_slot(slot_idx)
+ if info:
+ current_character_information = info
else:
current_character_information = null
)
+ %CharacterSelectionList.requested_login.connect(func(slot_idx: int):
+ _on_character_selected_pressed(slot_idx)
+ )
# pre-select first character
%CharacterSelectionList.select(0)
@@ -117,6 +119,7 @@ func _on_character_selected_pressed(slot_idx: int):
return
Client.character.name = current_character_information.name
+ Client.character.info = current_character_information
Network.map_server = MapServer.new(
selected_character.get_map_server_ip(),
@@ -131,16 +134,9 @@ func _on_character_selected_pressed(slot_idx: int):
)
var _logged_in = await Network.map_server.logged_in
- # TODO: switch to game :)
-
- %ChatWindow.visible = true
- %ChatWindow.initialize()
-
- # TODO: load map
- var map_loaded_packet := MapLoadedPacket.new()
- Network.map_server.send(map_loaded_packet)
-
- # TODO: check which map server packets to send next
+ get_tree().change_scene_to_file(
+ "res://client_data/data/%s.tscn" % current_character_information.get_map_name()
+ )
func _on_character_server_back_button_pressed() -> void: