You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
813 B
30 lines
813 B
7 months ago
|
extends Control
|
||
|
|
||
|
@onready var _submit_button = $Button
|
||
|
@onready var _dojo_name_input = $LineEdit
|
||
|
@onready var _error_label = $RichTextLabel
|
||
|
@onready var _global_scn = get_node("/root/Global")
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready():
|
||
|
pass # Replace with function body.
|
||
|
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
func _process(delta):
|
||
|
pass
|
||
|
|
||
|
func _on_submit_button_button_up():
|
||
|
if (_submit_button.is_hovered()):
|
||
|
var regex = RegEx.new()
|
||
|
regex.compile("^\\w[\\w\\d]+$")
|
||
|
|
||
|
var result = regex.search(_dojo_name_input.text)
|
||
|
if result:
|
||
|
_error_label.visible = false
|
||
|
_global_scn.create_dojo(_dojo_name_input.text)
|
||
|
|
||
|
else:
|
||
|
_error_label.visible = true
|
||
|
_error_label.text = "[color=red][b]Kein gültiger Name :P[/b][/color]"
|