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

@@ -0,0 +1,75 @@
// Copyright © Gamesmiths Guild.
using Godot;
using Godot.Collections;
namespace Gamesmiths.Forge.Godot.Resources.Statescript;
/// <summary>
/// Resource representing a complete Statescript graph. Contains all nodes and their connections.
/// </summary>
[Tool]
[GlobalClass]
[Icon("uid://b6yrjb46fluw3")]
public partial class StatescriptGraph : Resource
{
/// <summary>
/// Gets or sets the display name for this graph.
/// </summary>
[Export]
public string StatescriptName { get; set; } = "New Statescript";
/// <summary>
/// Gets or sets the nodes in this graph.
/// </summary>
[Export]
public Array<StatescriptNode> Nodes { get; set; } = [];
/// <summary>
/// Gets or sets the connections between nodes in this graph.
/// </summary>
[Export]
public Array<StatescriptConnection> Connections { get; set; } = [];
/// <summary>
/// Gets or sets the graph variable definitions.
/// </summary>
[Export]
public Array<StatescriptGraphVariable> Variables { get; set; } = [];
/// <summary>
/// Gets or sets the scroll offset of the graph editor when this graph was last saved.
/// </summary>
[Export]
public Vector2 ScrollOffset { get; set; }
/// <summary>
/// Gets or sets the zoom level of the graph editor when this graph was last saved.
/// </summary>
[Export]
public float Zoom { get; set; } = 1.0f;
/// <summary>
/// Ensures the graph has an Entry node. Called when the graph is first created or loaded.
/// </summary>
public void EnsureEntryNode()
{
foreach (StatescriptNode node in Nodes)
{
if (node.NodeType == StatescriptNodeType.Entry)
{
return;
}
}
var entryNode = new StatescriptNode
{
NodeId = "entry",
Title = "Entry",
NodeType = StatescriptNodeType.Entry,
PositionOffset = new Vector2(100, 200),
};
Nodes.Add(entryNode);
}
}