Replicated the weapon flying tick setup using resources
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 26s
Create tag and build when new code gets to main / Export (push) Successful in 5m42s

This commit is contained in:
2026-04-07 16:32:26 +02:00
parent cc7cb90041
commit 1d856fd937
145 changed files with 12943 additions and 109 deletions

View File

@@ -6,7 +6,7 @@ using Godot;
namespace Gamesmiths.Forge.Godot.Editor.Attributes;
[Tool]
public partial class AttributeEditorProperty : EditorProperty
public partial class AttributeEditorProperty : EditorProperty, ISerializationListener
{
private const int ButtonSize = 26;
private const int PopupSize = 300;
@@ -15,17 +15,15 @@ public partial class AttributeEditorProperty : EditorProperty
public override void _Ready()
{
Texture2D dropdownIcon = EditorInterface.Singleton
.GetEditorTheme()
.GetIcon("GuiDropdown", "EditorIcons");
Texture2D dropdownIcon = EditorInterface.Singleton.GetEditorTheme().GetIcon("GuiDropdown", "EditorIcons");
var hbox = new HBoxContainer();
var hBox = new HBoxContainer();
_label = new Label { Text = "None", SizeFlagsHorizontal = SizeFlags.ExpandFill };
var button = new Button { Icon = dropdownIcon, CustomMinimumSize = new Vector2(ButtonSize, 0) };
hbox.AddChild(_label);
hbox.AddChild(button);
AddChild(hbox);
hBox.AddChild(_label);
hBox.AddChild(button);
AddChild(hBox);
var popup = new Popup { Size = new Vector2I(PopupSize, PopupSize) };
var tree = new Tree
@@ -78,6 +76,20 @@ public partial class AttributeEditorProperty : EditorProperty
_label.Text = string.IsNullOrEmpty(value) ? "None" : value;
}
public void OnBeforeSerialize()
{
for (var i = GetChildCount() - 1; i >= 0; i--)
{
Node child = GetChild(i);
RemoveChild(child);
child.Free();
}
}
public void OnAfterDeserialize()
{
}
private static void BuildAttributeTree(Tree tree)
{
TreeItem root = tree.CreateItem();