request_bet and request_card are now broadcast for everyone to receive and display an arrow to represent active client's turn

This commit is contained in:
2025-07-20 20:06:58 +02:00
parent 66287ee8a0
commit b6e818cc49
8 changed files with 210 additions and 27 deletions
+16
View File
@@ -23,6 +23,9 @@ var _is_owned: bool
@export var hide_client_name: bool = false
@export var card_disallowed_label: Label
@export var top_arrow_container: Node3D
@export var bottom_arrow_container: Node3D
var _selected_card: PlayingCard = null
var _cards_in_hand_ids: Array[int] = []
var _allow_clicking_cards: bool = false
@@ -38,11 +41,24 @@ signal card_played(card_id: int)
func _ready() -> void:
if hide_client_name:
name_label.hide()
top_arrow_container.hide()
bottom_arrow_container.hide()
func set_player_data(client_data: ClientData) -> void:
_client_data = client_data
name_label.text = _client_data.client_name
func set_turn(is_turn: bool, is_self: bool) -> void:
if is_turn:
if is_self:
top_arrow_container.show()
else:
bottom_arrow_container.show()
else:
top_arrow_container.hide()
bottom_arrow_container.hide()
func add_card(card: PlayingCard) -> void:
card_container.add_child(card)
_arrange_cards()