44[ext_resource type ="Script" path ="res://addons/PolyPet/PolyPetAvatar.cs" id ="2_33x3t" ]
55[ext_resource type ="Texture2D" path ="res://addons/PolyPet/Samples/Assets/shuffle.svg" id ="3_o1n1n" ]
66
7+ [sub_resource type ="GDScript" id ="GDScript_33x3t" ]
8+ resource_name = "RandomizePolyPetNameButton"
9+ script/source = "extends Button
10+
11+ func _pressed () -> void :
12+ % PolyPetAvatar .RandomizeNameSeed ()
13+ "
14+
715[sub_resource type ="GDScript" id ="GDScript_m6ijy" ]
816resource_name = "NameSeed"
917script/source = "extends LineEdit
1018
1119@onready var avatar : PolyPetAvatar = % PolyPetAvatar
1220
13- func _ready () -> void :
14- print (avatar )
21+
22+ func _on_poly_pet_avatar_name_seed_changed (_avatar : PolyPetAvatar , nameSeed : Variant ) -> void :
23+ text = str (nameSeed )
24+
25+
26+ func _on_text_submitted (new_text : String ) -> void :
27+ avatar .NameSeed = int (new_text )
1528"
1629
17- [sub_resource type ="GDScript" id ="GDScript_33x3t " ]
18- resource_name = "RandomizePolyPetNameButton "
19- script/source = "extends Button
30+ [sub_resource type ="GDScript" id ="GDScript_kwek3 " ]
31+ resource_name = "AvatarSeed "
32+ script/source = "extends LineEdit
2033
21- func _pressed () -> void :
22- % PolyPetAvatar .RandomizeNameSeed ()
34+
35+ func _on_poly_pet_avatar_seed_changed (avatar : Node2D , seed : Variant ) -> void :
36+ text = str (seed )
2337"
2438
2539[sub_resource type ="GDScript" id ="GDScript_o1n1n" ]
@@ -44,8 +58,8 @@ anchors_preset = 5
4458anchor_left = 0.5
4559anchor_right = 0.5
4660offset_left = -140.0
47- offset_right = 140 .0
48- offset_bottom = 92 .0
61+ offset_right = 83 .0
62+ offset_bottom = 125 .0
4963grow_horizontal = 2
5064
5165[node name ="MarginContainer" type ="MarginContainer" parent ="UI" unique_id =1027590759 ]
@@ -70,41 +84,47 @@ columns = 3
7084layout_mode = 2
7185text = "Name:"
7286
73- [node name ="NameValue " type ="HBoxContainer " parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =653098343 ]
87+ [node name ="PolyPetName " type ="Label " parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =1675894007 node_paths = PackedStringArray ( "Avatar" ) ]
7488layout_mode = 2
7589size_flags_horizontal = 3
76- theme_override_constants/separation = 10
77-
78- [node name ="NameSeed" type ="LineEdit" parent ="UI/MarginContainer/HBoxContainer/GridContainer/NameValue" unique_id =301370324 ]
79- layout_mode = 2
80- script = SubResource ("GDScript_m6ijy" )
81-
82- [node name ="PolyPetName" type ="Label" parent ="UI/MarginContainer/HBoxContainer/GridContainer/NameValue" unique_id =1675894007 node_paths =PackedStringArray ("Avatar" )]
83- layout_mode = 2
84- size_flags_horizontal = 3
85- text = "MOWALO"
8690uppercase = true
8791script = ExtResource ("1_k8tk0" )
88- Avatar = NodePath ("../../../../../../ AvatarOrigin/PolyPetAvatar" )
92+ Avatar = NodePath ("../../../../../AvatarOrigin/PolyPetAvatar" )
8993
9094[node name ="RandomizeName" type ="Button" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =786034616 ]
9195layout_mode = 2
9296icon = ExtResource ("3_o1n1n" )
9397script = SubResource ("GDScript_33x3t" )
9498
99+ [node name ="Spacer" type ="Control" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =863450605 ]
100+ layout_mode = 2
101+
102+ [node name ="NameSeed" type ="LineEdit" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =301370324 ]
103+ custom_minimum_size = Vector2 (101 , 0 )
104+ layout_mode = 2
105+ expand_to_text_length = true
106+ script = SubResource ("GDScript_m6ijy" )
107+
108+ [node name ="Spacer2" type ="Control" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =1547713120 ]
109+ layout_mode = 2
110+
95111[node name ="AvatarLabel" type ="Label" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =38632948 ]
96112layout_mode = 2
97113text = "Body:"
98114
99115[node name ="AvatarSeed" type ="LineEdit" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =1616937740 ]
116+ custom_minimum_size = Vector2 (101 , 0 )
100117layout_mode = 2
101118size_flags_horizontal = 3
119+ script = SubResource ("GDScript_kwek3" )
102120
103121[node name ="RandomizeAvatar" type ="Button" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =1833411425 ]
104122layout_mode = 2
105123icon = ExtResource ("3_o1n1n" )
106124script = SubResource ("GDScript_o1n1n" )
107125
126+ [node name ="Node" type ="Node" parent ="UI/MarginContainer/HBoxContainer/GridContainer" unique_id =409569466 ]
127+
108128[node name ="AvatarOrigin" type ="Control" parent ="." unique_id =1813218209 ]
109129layout_mode = 1
110130anchor_left = 0.5
@@ -117,3 +137,9 @@ grow_vertical = 2
117137[node name ="PolyPetAvatar" type ="Node2D" parent ="AvatarOrigin" unique_id =264461052 ]
118138unique_name_in_owner = true
119139script = ExtResource ("2_33x3t" )
140+ _startSeedType = 2
141+ _startNameSeedType = 2
142+
143+ [connection signal ="text_submitted" from ="UI/MarginContainer/HBoxContainer/GridContainer/NameSeed" to ="UI/MarginContainer/HBoxContainer/GridContainer/NameSeed" method ="_on_text_submitted" ]
144+ [connection signal ="NameSeedChanged" from ="AvatarOrigin/PolyPetAvatar" to ="UI/MarginContainer/HBoxContainer/GridContainer/NameSeed" method ="_on_poly_pet_avatar_name_seed_changed" ]
145+ [connection signal ="SeedChanged" from ="AvatarOrigin/PolyPetAvatar" to ="UI/MarginContainer/HBoxContainer/GridContainer/AvatarSeed" method ="_on_poly_pet_avatar_seed_changed" ]
0 commit comments