add a check for name entry
This commit is contained in:
parent
340a176e55
commit
0fcb151f87
@ -24,11 +24,19 @@ func _display_error(message: String) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_host_button_pressed() -> void:
|
func _on_host_button_pressed() -> void:
|
||||||
|
if !_name_edit.text:
|
||||||
|
_display_error("Name cannot be empty")
|
||||||
|
return
|
||||||
|
|
||||||
Networker.set_local_player_info(_name_edit.text)
|
Networker.set_local_player_info(_name_edit.text)
|
||||||
Networker.host_game()
|
Networker.host_game()
|
||||||
|
|
||||||
|
|
||||||
func _on_join_button_pressed() -> void:
|
func _on_join_button_pressed() -> void:
|
||||||
|
if !_name_edit.text:
|
||||||
|
_display_error("Name cannot be empty")
|
||||||
|
return
|
||||||
|
|
||||||
_join_button.disabled = true
|
_join_button.disabled = true
|
||||||
_host_button.disabled = true
|
_host_button.disabled = true
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user