♻️ reworked and debugged the SaveSystem. Removed unnecessary scene reference.

This commit is contained in:
2025-11-25 14:39:31 +01:00
parent 638ebaff46
commit e9cd4ce276
5 changed files with 27 additions and 32 deletions
@@ -17,8 +17,7 @@ public partial class InventoryInstance : Node, ISaveable
[Signal]
public delegate void InventoryContentsChangedEventHandler();
private const string SCENE_NAME = "inventory";
private const string ID = "instace";
/// <summary>
@@ -192,15 +191,14 @@ public partial class InventoryInstance : Node, ISaveable
}
}
SavegameService.AppendDataToSave(SCENE_NAME, ID, payloadData);
SavegameService.AppendDataToSave(ID, payloadData);
}
public void LoadFromSaveData()
{
var sceneName = SCENE_NAME;
var id = ID;
Godot.Collections.Dictionary<string, Variant> save = SavegameService.GetSaveData(sceneName, id);
Godot.Collections.Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
if (save.Count > 0)
{