📝 Added documentation

This commit is contained in:
2025-11-25 13:46:46 +01:00
parent b4013b1ff2
commit 638ebaff46
3 changed files with 16 additions and 1 deletions
@@ -4,9 +4,16 @@ using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// And editor tool that lives in the scene scope and iterates over saveable nodes and assigns them unique IDs where necessary.
/// It only works if the object (prefab) in question has been added to the "Saveable"-group beforehand.
/// </summary>
[Tool]
public partial class SaveIDProviderTool : Node
{
/// <summary>
/// Creates an inspector button that calls the AssignIDs method.
/// </summary>
[ExportToolButton("Assign IDs")] private Callable assignIDs => Callable.From(AssignIDs);
private void AssignIDs()
@@ -15,7 +22,6 @@ public partial class SaveIDProviderTool : Node
foreach (var node in saveables)
{
GD.Print($"Checking {node.Name}.");
GD.Print($"Node has Meta SaveID: {node.HasMeta("SaveID")} and it's: " + node.GetMeta("SaveID").AsString());
if (!node.HasMeta("SaveID") || string.IsNullOrEmpty(node.GetMeta("SaveID").AsString()))
{
string saveID = Guid.NewGuid().ToString();