Loading scenes/dragon_editor/dragon_editor.gd +5 −2 Original line number Diff line number Diff line Loading @@ -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: Loading @@ -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() scenes/dragon_editor/dragon_editor.tscn +12 −1 Original line number Diff line number Diff line [gd_scene load_steps=9 format=3 uid="uid://fut42ruut302"] [gd_scene load_steps=10 format=3 uid="uid://fut42ruut302"] [ext_resource type="Script" uid="uid://bfuos2kgfgber" path="res://scenes/dragon_editor/dragon_editor.gd" id="1_8vkll"] [ext_resource type="Texture2D" uid="uid://fdqnc2qrrvn1" path="res://assets/sprites/icon.svg" id="2_un5ur"] Loading @@ -8,6 +8,7 @@ [ext_resource type="Resource" uid="uid://ba5684xylts3f" path="res://assets/outfits/shoes.tres" id="4_1ivi1"] [ext_resource type="Texture2D" uid="uid://dc2uk6tqtwl4n" path="res://assets/sprites/shirt.png" id="4_6sr44"] [ext_resource type="Texture2D" uid="uid://8srlwinjr3tt" path="res://assets/sprites/shoes.png" id="5_wby0j"] [ext_resource type="Script" uid="uid://mhudiyt5gnt1" path="res://scenes/dragon_editor/line_edit.gd" id="9_xhgxf"] [node name="DragonEditor" type="Window"] title = "Dragon Editor" Loading Loading @@ -116,6 +117,16 @@ grow_vertical = 2 texture = ExtResource("5_wby0j") expand_mode = 1 [node name="LineEdit" type="LineEdit" parent="CanvasLayer"] offset_left = 59.0 offset_top = 372.0 offset_right = 250.0 offset_bottom = 403.0 placeholder_text = "NOM" alignment = 1 max_length = 8 script = ExtResource("9_xhgxf") [connection signal="close_requested" from="." to="." method="_on_close_requested"] [connection signal="pressed" from="CanvasLayer/VBoxContainer/change_hat" to="." method="_on_change_hat_pressed"] [connection signal="pressed" from="CanvasLayer/VBoxContainer/change_shirt" to="." method="_on_change_shirt_pressed"] Loading scenes/dragon_editor/line_edit.gd 0 → 100644 +11 −0 Original line number Diff line number Diff line extends LineEdit func _ready() -> void: connect("text_changed", _text_to_upper) func _text_to_upper(new_text: String): var last_caret_column = caret_column text = new_text.to_upper() caret_column = last_caret_column scenes/dragon_editor/line_edit.gd.uid 0 → 100644 +1 −0 Original line number Diff line number Diff line uid://mhudiyt5gnt1 scenes/dragons/dragon_entity_dragger.gd +6 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ class_name DragonEntity @export var dragon: DragonSprite signal on_pick(position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D) signal on_pick(position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D, dragon_name: String) func _ready() -> void: Loading @@ -15,9 +15,13 @@ func _input_event(viewport, event, shape_idx) -> void: if event is InputEventMouseButton \ and event.button_index == MOUSE_BUTTON_LEFT \ and event.is_pressed(): on_pick.emit(position, dragon.hat.texture, dragon.shirt.texture, dragon.shoes.texture) on_pick.emit(position, dragon.hat.texture, dragon.shirt.texture, dragon.shoes.texture, dragon.name_label.text) queue_free() func dress(hat: Texture2D, shirt: Texture2D, shoes: Texture2D): dragon.dress(hat, shirt, shoes) func set_dragon_name(dragon_name: String): dragon.set_dragon_name(dragon_name) Loading
scenes/dragon_editor/dragon_editor.gd +5 −2 Original line number Diff line number Diff line Loading @@ -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: Loading @@ -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()
scenes/dragon_editor/dragon_editor.tscn +12 −1 Original line number Diff line number Diff line [gd_scene load_steps=9 format=3 uid="uid://fut42ruut302"] [gd_scene load_steps=10 format=3 uid="uid://fut42ruut302"] [ext_resource type="Script" uid="uid://bfuos2kgfgber" path="res://scenes/dragon_editor/dragon_editor.gd" id="1_8vkll"] [ext_resource type="Texture2D" uid="uid://fdqnc2qrrvn1" path="res://assets/sprites/icon.svg" id="2_un5ur"] Loading @@ -8,6 +8,7 @@ [ext_resource type="Resource" uid="uid://ba5684xylts3f" path="res://assets/outfits/shoes.tres" id="4_1ivi1"] [ext_resource type="Texture2D" uid="uid://dc2uk6tqtwl4n" path="res://assets/sprites/shirt.png" id="4_6sr44"] [ext_resource type="Texture2D" uid="uid://8srlwinjr3tt" path="res://assets/sprites/shoes.png" id="5_wby0j"] [ext_resource type="Script" uid="uid://mhudiyt5gnt1" path="res://scenes/dragon_editor/line_edit.gd" id="9_xhgxf"] [node name="DragonEditor" type="Window"] title = "Dragon Editor" Loading Loading @@ -116,6 +117,16 @@ grow_vertical = 2 texture = ExtResource("5_wby0j") expand_mode = 1 [node name="LineEdit" type="LineEdit" parent="CanvasLayer"] offset_left = 59.0 offset_top = 372.0 offset_right = 250.0 offset_bottom = 403.0 placeholder_text = "NOM" alignment = 1 max_length = 8 script = ExtResource("9_xhgxf") [connection signal="close_requested" from="." to="." method="_on_close_requested"] [connection signal="pressed" from="CanvasLayer/VBoxContainer/change_hat" to="." method="_on_change_hat_pressed"] [connection signal="pressed" from="CanvasLayer/VBoxContainer/change_shirt" to="." method="_on_change_shirt_pressed"] Loading
scenes/dragon_editor/line_edit.gd 0 → 100644 +11 −0 Original line number Diff line number Diff line extends LineEdit func _ready() -> void: connect("text_changed", _text_to_upper) func _text_to_upper(new_text: String): var last_caret_column = caret_column text = new_text.to_upper() caret_column = last_caret_column
scenes/dragon_editor/line_edit.gd.uid 0 → 100644 +1 −0 Original line number Diff line number Diff line uid://mhudiyt5gnt1
scenes/dragons/dragon_entity_dragger.gd +6 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ class_name DragonEntity @export var dragon: DragonSprite signal on_pick(position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D) signal on_pick(position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D, dragon_name: String) func _ready() -> void: Loading @@ -15,9 +15,13 @@ func _input_event(viewport, event, shape_idx) -> void: if event is InputEventMouseButton \ and event.button_index == MOUSE_BUTTON_LEFT \ and event.is_pressed(): on_pick.emit(position, dragon.hat.texture, dragon.shirt.texture, dragon.shoes.texture) on_pick.emit(position, dragon.hat.texture, dragon.shirt.texture, dragon.shoes.texture, dragon.name_label.text) queue_free() func dress(hat: Texture2D, shirt: Texture2D, shoes: Texture2D): dragon.dress(hat, shirt, shoes) func set_dragon_name(dragon_name: String): dragon.set_dragon_name(dragon_name)