feat: add names to dragons
This commit is contained in:
parent
f07b28d2dc
commit
ca4959af32
10 changed files with 91 additions and 15 deletions
|
@ -10,8 +10,9 @@ class_name DragonEditor
|
|||
@export var shirt_outfits: DragonOutfit
|
||||
@export var shoes_outfits: DragonOutfit
|
||||
|
||||
@onready var dragon_name: LineEdit = $CanvasLayer/LineEdit
|
||||
|
||||
signal on_create_dragon(hat: Texture2D, shirt: Texture2D, shoes: Texture2D)
|
||||
signal on_create_dragon(hat: Texture2D, shirt: Texture2D, shoes: Texture2D, dragon_name: String)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
@ -37,5 +38,7 @@ func _on_change_shoes_pressed() -> void:
|
|||
|
||||
|
||||
func _on_create_pressed() -> void:
|
||||
on_create_dragon.emit(hat.texture, shirt.texture, shoes.texture)
|
||||
if dragon_name.text.is_empty():
|
||||
return
|
||||
on_create_dragon.emit(hat.texture, shirt.texture, shoes.texture, dragon_name.text)
|
||||
queue_free()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue