Creating lobby updates #8
@ -15,13 +15,14 @@ func _ready() -> void:
|
||||
host_button.pressed.connect(_on_host)
|
||||
leave_button.pressed.connect(_on_leave)
|
||||
start_button.pressed.connect(_on_start)
|
||||
show_lobbies_button.pressed.connect(_on_show_lobbies)
|
||||
|
||||
NetworkManager.lobby_created.connect(_on_lobby_created)
|
||||
NetworkManager.lobby_joined.connect(_on_lobby_joined)
|
||||
NetworkManager.user_joined_lobby.connect(_on_user_joined_lobby)
|
||||
NetworkManager.user_left_lobby.connect(_on_user_left_lobby)
|
||||
NetworkManager.on_game_started.connect(_on_game_started)
|
||||
NetworkManager.lobbies_received.connect(_on_lobbies_received)
|
||||
NetworkManager.on_lobbies_received.connect(_on_lobbies_received)
|
||||
|
||||
GameConsole.register_command(Command.new("update", update_ui, [], "Updates the lobby UI"))
|
||||
|
||||
@ -36,11 +37,11 @@ func _on_leave():
|
||||
|
||||
|
||||
func _on_show_lobbies():
|
||||
lobby_list_box.visible = true
|
||||
NetworkManager.get_lobbies()
|
||||
|
||||
|
||||
func _on_lobbies_received(these_lobbies: Array):
|
||||
lobby_list_box.visible = true
|
||||
for this_lobby in these_lobbies:
|
||||
# Pull lobby data from Steam, these are specific to our example
|
||||
var lobby_name: String = Steam.getLobbyData(this_lobby, "name")
|
||||
|
Loading…
Reference in New Issue
Block a user