İlk commit: Stepstead Godot istemci (4.6 Mobile)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
commit
6a1706051d
346 changed files with 14415 additions and 0 deletions
26
scripts/character_create.gd
Normal file
26
scripts/character_create.gd
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
extends Control
|
||||
|
||||
@onready var name_input: LineEdit = $Panel/VBox/Name
|
||||
@onready var create_btn: Button = $Panel/VBox/Create
|
||||
@onready var logout_btn: Button = $Panel/VBox/Logout
|
||||
@onready var error: Label = $Panel/VBox/Error
|
||||
|
||||
func _ready() -> void:
|
||||
error.text = ""
|
||||
create_btn.pressed.connect(_on_create)
|
||||
logout_btn.pressed.connect(func():
|
||||
Auth.clear()
|
||||
get_tree().change_scene_to_file("res://scenes/login.tscn"))
|
||||
|
||||
func _on_create() -> void:
|
||||
error.text = ""
|
||||
create_btn.disabled = true
|
||||
var res: Dictionary = await GameState.create_character(name_input.text.strip_edges())
|
||||
create_btn.disabled = false
|
||||
if not res.ok:
|
||||
var detail := "Karakter oluşturulamadı"
|
||||
if res.body is Dictionary and res.body.has("detail"):
|
||||
detail = str(res.body["detail"])
|
||||
error.text = detail
|
||||
return
|
||||
get_tree().change_scene_to_file("res://scenes/world.tscn")
|
||||
Loading…
Add table
Add a link
Reference in a new issue