player names are now displayed above player hands
This commit is contained in:
@@ -36,7 +36,8 @@ signal received_chat_message(client_name: String, message: String)
|
||||
|
||||
signal connection_status_changed(new_status: ConnectionStatus)
|
||||
|
||||
signal client_order_received(client_ids: Array[String])
|
||||
# This signal is messy as fuck
|
||||
signal client_order_received(client_ids: Array[String], client_ids_playing_order: Array[String], client_names: Array[String])
|
||||
signal cards_received(cards: Dictionary)
|
||||
signal trump_received(trump_id: int)
|
||||
signal received_bet_request(disallowed_bet: int)
|
||||
@@ -133,7 +134,7 @@ func _handle_response(response: String) -> void:
|
||||
if data["current_round"] == 1:
|
||||
var playing_order: Array[String] = []
|
||||
playing_order.assign(data["playing_order"])
|
||||
client_order_received.emit.call_deferred(playing_order)
|
||||
client_order_received.emit.call_deferred(playing_order, _connected_client_ids, _connected_client_names)
|
||||
|
||||
var received_cards = data["cards"]
|
||||
#print(received_cards)
|
||||
|
||||
@@ -30,6 +30,9 @@ func _ready() -> void:
|
||||
if hide_client_name:
|
||||
name_label.hide()
|
||||
|
||||
func set_player_name(player_name: String) -> void:
|
||||
name_label.text = player_name
|
||||
|
||||
func add_card(card: PlayingCard) -> void:
|
||||
card_container.add_child(card)
|
||||
_arrange_cards()
|
||||
|
||||
@@ -31,7 +31,7 @@ var _own_client_id: String
|
||||
var _plays: Array[Play]
|
||||
var _trump_id: int = -1
|
||||
|
||||
func _on_web_client_tcp_client_order_received(client_ids: Array[String]) -> void:
|
||||
func _on_web_client_tcp_client_order_received(client_ids: Array[String], client_ids_playing_order: Array[String], client_names: Array[String]) -> void:
|
||||
var marker_positions: Array[Marker3D]
|
||||
match client_ids.size():
|
||||
3:
|
||||
@@ -69,6 +69,7 @@ func _on_web_client_tcp_client_order_received(client_ids: Array[String]) -> void
|
||||
hand = own_player_hand
|
||||
else:
|
||||
hand = player_hand_scene.instantiate()
|
||||
hand.set_player_name(client_names[client_ids_playing_order.find(client_ids[index])])
|
||||
marker_positions[index - 1].add_child(hand)
|
||||
|
||||
hand_associations[client_ids[index]] = hand
|
||||
|
||||
Reference in New Issue
Block a user