Skip to content

Commit b6f4d6a

Browse files
committed
refactor(godot): update PolyPetAvatar to use Control type
Changed the PolyPetAvatar node type from Node2D to Control in multiple scenes to ensure compatibility with Godot's UI system. This adjustment allows the avatar to properly fit within its Control rect and supports better layout management.
1 parent 3215baf commit b6f4d6a

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ Unity adapter: Unity/Runtime/PolyPetAvatar.cs Unity/Runtime/PolyPetName.cs Unity
88
Godot adapter: Godot/addons/PolyPet/PolyPetAvatar.cs Godot/addons/PolyPet/PolyPetName.cs Godot/addons/PolyPet/plugin.cfg
99
Tests: Core.Tests/Core.Tests.csproj
1010
Automation: .github/workflows/sync-core.yml .github/workflows/release.yml
11-
Rules: keep Core engine-agnostic; PolyPetName is display-only; seed generation stays in PolyPet
11+
Rules: keep Core engine-agnostic; PolyPetName is display-only; seed generation stays in PolyPet; Godot PolyPetAvatar is Control-based and must fit its Control rect; Unity PolyPetAvatar must support FrameSize and Canvas RectTransform framing
1212
Verify after code changes, run: .\scripts\verify.ps1 -NoPause
1313
Limits: sample folders are scaffolding; no sample scenes or Godot/Unity editor compile harness here

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ Unity adapter: Unity/Runtime/PolyPetAvatar.cs Unity/Runtime/PolyPetName.cs Unity
88
Godot adapter: Godot/addons/PolyPet/PolyPetAvatar.cs Godot/addons/PolyPet/PolyPetName.cs Godot/addons/PolyPet/plugin.cfg
99
Tests: Core.Tests/Core.Tests.csproj
1010
Automation: .github/workflows/sync-core.yml .github/workflows/release.yml
11-
Rules: keep Core engine-agnostic; PolyPetName is display-only; seed generation stays in PolyPet
11+
Rules: keep Core engine-agnostic; PolyPetName is display-only; seed generation stays in PolyPet; Godot PolyPetAvatar is Control-based and must fit its Control rect; Unity PolyPetAvatar must support FrameSize and Canvas RectTransform framing
1212
Verify after code changes, run: .\scripts\verify.ps1 -NoPause
1313
Limits: sample folders are scaffolding; no sample scenes or Godot/Unity editor compile harness here

Godot/addons/PolyPet/Samples/PolyPetCreator.tscn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ script/source = "extends SpinBox
3535
@onready var avatar: PolyPetAvatar = %PolyPetAvatar
3636

3737

38-
func _on_poly_pet_avatar_seed_changed(avatar: Node2D, seed: Variant) -> void:
38+
func _on_poly_pet_avatar_seed_changed(avatar: PolyPetAvatar, seed: Variant) -> void:
3939
value = int(seed)
4040

4141

@@ -76,7 +76,7 @@ anchor_bottom = 0.75
7676
grow_horizontal = 2
7777
grow_vertical = 2
7878

79-
[node name="PolyPetAvatar" type="Node2D" parent="AvatarContainer/Origin" unique_id=264461052]
79+
[node name="PolyPetAvatar" type="Control" parent="AvatarContainer/Origin" unique_id=264461052]
8080
unique_name_in_owner = true
8181
script = ExtResource("2_33x3t")
8282
_startSeedType = 2

Godot/addons/PolyPet/Samples/PolyPetFarm.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ layout_mode = 2
2626
[node name="Origin" type="Control" parent="ScrollContainer/GridContainer/PolyPetAvatarControl" unique_id=80489148]
2727
layout_mode = 2
2828

29-
[node name="PolyPetAvatar" type="Node2D" parent="ScrollContainer/GridContainer/PolyPetAvatarControl/Origin" unique_id=1703280634]
29+
[node name="PolyPetAvatar" type="Control" parent="ScrollContainer/GridContainer/PolyPetAvatarControl/Origin" unique_id=1703280634]
3030
script = ExtResource("1_pq1lp")
3131
metadata/_custom_type_script = "uid://b770jfm8t7i50"
3232

0 commit comments

Comments
 (0)