fixed some things

This commit is contained in:
2025-07-20 19:26:50 +02:00
parent 9b8390cfb3
commit 66287ee8a0
9 changed files with 87 additions and 49 deletions
+11 -4
View File
@@ -32,9 +32,11 @@ var _bets: Dictionary[String, Array] # Array[BetResult]
var _plays: Array[Play]
var _trump_id: int = -1
func _on_web_client_tcp_client_order_received(client_ids: Array[String], client_ids_playing_order: Array[String], client_names: Array[String]) -> void:
func _on_web_client_tcp_client_order_received(playing_order: Array[ClientData]) -> void:
var marker_positions: Array[Marker3D]
match client_ids.size():
var client_ids: Array[String] = []
client_ids.assign(playing_order.map(func(a: ClientData): return a.client_id))
match playing_order.size():
3:
marker_positions = hand_markers_3
4:
@@ -71,7 +73,12 @@ func _on_web_client_tcp_client_order_received(client_ids: Array[String], client_
hand = own_player_hand
else:
hand = player_hand_scene.instantiate()
hand.set_player_name(client_names[client_ids_playing_order.find(client_ids[index])])
var client_data: ClientData
for client in playing_order:
if client.client_id == client_ids[index]:
client_data = client
break
hand.set_player_data(client_data) # also for own hand?
marker_positions[index - 1].add_child(hand)
hand_associations[client_ids[index]] = hand
@@ -92,7 +99,7 @@ func _on_web_client_tcp_received_play_winner_request() -> void:
if not $"../HBoxContainer/GameUI"._is_host:
return
await get_tree().create_timer(1.5).timeout
await get_tree().create_timer(1.0).timeout
var card_ids: Array[int] = []
card_ids.assign(_plays.map(func(p: Play): return p.card_id))