24 lines
476 B
GDScript
24 lines
476 B
GDScript
class_name GameClient
|
|
extends Node
|
|
|
|
@export var web_client: WebClientTCP
|
|
@export var start_game_button: Button
|
|
|
|
var _is_host: bool = false
|
|
|
|
func _set_host(is_host: bool) -> void:
|
|
_is_host = is_host
|
|
if is_host:
|
|
start_game_button.show()
|
|
else:
|
|
start_game_button.hide()
|
|
|
|
func _on_start_game_button_pressed() -> void:
|
|
web_client.start_game()
|
|
|
|
func _on_create_lobby_button_pressed() -> void:
|
|
_set_host(true)
|
|
|
|
func _on_join_lobby_button_pressed() -> void:
|
|
_set_host(false)
|