Update list when user leaves lobby

This commit is contained in:
Chris Bell 2024-12-13 14:29:20 -06:00
parent 0bef74cca6
commit e4839dd7e8
2 changed files with 4 additions and 5 deletions

View File

@ -71,8 +71,9 @@ func _on_lobby_chat_update(this_lobby_id: int, change_id: int, making_change_id:
print("%s has joined the lobby." % changer_name)
elif chat_state == Steam.CHAT_MEMBER_STATE_CHANGE_LEFT:
user_left_lobby.emit(change_id)
print("%s has left the lobby." % changer_name)
elif chat_state == Steam.CHAT_MEMBER_STATE_CHANGE_KICKED:
print("%s has been kicked from the lobby." % changer_name)

View File

@ -60,10 +60,8 @@ func _on_user_joined_lobby(user_id: int):
update()
func _on_user_left_lobby(user_id: int):
for child in user_list_box.get_children():
if child.get_node("Username").text == str(user_id):
user_list_box.remove_child(child)
break
added_users.erase(user_id)
update()
func update() -> void: