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

@@ -13,7 +13,7 @@ using Godot.Collections;
namespace Gamesmiths.Forge.Godot.Editor.Attributes;
[Tool]
public partial class AttributeSetValuesEditorProperty : EditorProperty
public partial class AttributeSetValuesEditorProperty : EditorProperty, ISerializationListener
{
public override void _Ready()
{
@@ -94,6 +94,24 @@ public partial class AttributeSetValuesEditorProperty : EditorProperty
}
}
public void OnBeforeSerialize()
{
VBoxContainer? attributesRoot = GetNodeOrNull<VBoxContainer>("AttributesRoot");
if (attributesRoot is not null)
{
for (var i = attributesRoot.GetChildCount() - 1; i >= 0; i--)
{
Node child = attributesRoot.GetChild(i);
attributesRoot.RemoveChild(child);
child.Free();
}
}
}
public void OnAfterDeserialize()
{
}
private static PanelContainer AttributeHeader(string text)
{
var headerPanel = new PanelContainer
@@ -124,17 +142,17 @@ public partial class AttributeSetValuesEditorProperty : EditorProperty
private static HBoxContainer AttributeFieldRow(string label, SpinBox spinBox)
{
var hbox = new HBoxContainer();
var hBox = new HBoxContainer();
hbox.AddChild(new Label
hBox.AddChild(new Label
{
Text = label,
CustomMinimumSize = new Vector2(80, 0),
SizeFlagsHorizontal = SizeFlags.ExpandFill,
});
hbox.AddChild(spinBox);
return hbox;
hBox.AddChild(spinBox);
return hBox;
}
private static SpinBox CreateSpinBox(int min, int max, int value)
@@ -143,8 +161,9 @@ public partial class AttributeSetValuesEditorProperty : EditorProperty
{
MinValue = min,
MaxValue = max,
Value = value,
SizeFlagsHorizontal = SizeFlags.ExpandFill,
SelectAllOnFocus = true,
Value = value,
};
}