all clients now receive current round
This commit is contained in:
+8
-1
@@ -6,6 +6,7 @@ extends Node
|
||||
@export var play_card_button: Button
|
||||
@export var bet_container: Control
|
||||
@export var bet_input: LineEdit
|
||||
@export var round_label: Label
|
||||
|
||||
var _is_host: bool = false
|
||||
var _current_player_count: int = 0
|
||||
@@ -63,6 +64,10 @@ func _update_player_count(player_count: int) -> void:
|
||||
else:
|
||||
start_game_button.hide()
|
||||
|
||||
func _set_current_round(round: int) -> void:
|
||||
_current_round = round
|
||||
round_label.text = str(_current_round)
|
||||
|
||||
func _on_web_client_tcp_client_joined_lobby(client_name: String, connected_client_names: Array[String]) -> void:
|
||||
_update_player_count(connected_client_names.size())
|
||||
|
||||
@@ -74,11 +79,13 @@ func _on_player_hand_card_selected(card_id: int) -> void:
|
||||
|
||||
func _on_submit_bet_button_pressed() -> void:
|
||||
bet_container.hide()
|
||||
print("current round! " + str(_current_round))
|
||||
web_client.submit_bet(int(bet_input.text.strip_edges()), _current_round)
|
||||
|
||||
func _on_web_client_tcp_received_bet_request(disallowed_bet: int) -> void:
|
||||
func _on_web_client_tcp_received_bet_request(disallowed_bet: int, current_round: int) -> void:
|
||||
bet_input.text = ""
|
||||
bet_container.show()
|
||||
_set_current_round(current_round)
|
||||
|
||||
func _on_web_client_tcp_request_next_round() -> void:
|
||||
_start_next_round()
|
||||
|
||||
Reference in New Issue
Block a user