fixed leave button
This commit is contained in:
parent
101c08c03f
commit
0bef74cca6
@ -23,18 +23,12 @@ func _ready() -> void:
|
|||||||
|
|
||||||
func _on_host():
|
func _on_host():
|
||||||
NetworkManager.host_lobby()
|
NetworkManager.host_lobby()
|
||||||
host_button.disabled = true
|
|
||||||
join_button.disabled = true
|
|
||||||
leave_button.disabled = false
|
|
||||||
lobby_id_line_edit.editable = false
|
|
||||||
|
|
||||||
|
|
||||||
func _on_join():
|
func _on_join():
|
||||||
NetworkManager.join_lobby(int(lobby_id_line_edit.text))
|
NetworkManager.join_lobby(int(lobby_id_line_edit.text))
|
||||||
host_button.disabled = true
|
|
||||||
join_button.disabled = true
|
|
||||||
leave_button.disabled = false
|
|
||||||
lobby_id_line_edit.editable = false
|
|
||||||
|
|
||||||
func _on_leave():
|
func _on_leave():
|
||||||
NetworkManager.leave_lobby()
|
NetworkManager.leave_lobby()
|
||||||
@ -42,13 +36,21 @@ func _on_leave():
|
|||||||
for child in user_list_box.get_children():
|
for child in user_list_box.get_children():
|
||||||
child.queue_free()
|
child.queue_free()
|
||||||
|
|
||||||
|
|
||||||
func _on_lobby_created(lobby_id: int):
|
func _on_lobby_created(lobby_id: int):
|
||||||
print("Lobby created")
|
print("Lobby created")
|
||||||
lobby_id_line_edit.text = str(NetworkManager.lobby_id)
|
lobby_id_line_edit.text = str(NetworkManager.lobby_id)
|
||||||
|
host_button.disabled = true
|
||||||
|
join_button.disabled = true
|
||||||
|
leave_button.disabled = false
|
||||||
|
lobby_id_line_edit.editable = false
|
||||||
|
|
||||||
|
|
||||||
func _on_lobby_joined(lobby_id: int):
|
func _on_lobby_joined(lobby_id: int):
|
||||||
print("Lobby joined")
|
host_button.disabled = true
|
||||||
|
join_button.disabled = true
|
||||||
|
leave_button.disabled = false
|
||||||
|
lobby_id_line_edit.editable = false
|
||||||
|
|
||||||
func _on_user_joined_lobby(user_id: int):
|
func _on_user_joined_lobby(user_id: int):
|
||||||
if user_id in added_users:
|
if user_id in added_users:
|
||||||
|
Loading…
Reference in New Issue
Block a user