♻️ reworked and debugged the SaveSystem. Removed unnecessary scene reference.
This commit is contained in:
@@ -11,10 +11,6 @@ namespace Babushka.scripts.CSharp.Common.Temp;
|
||||
/// </summary>
|
||||
public partial class MVPDuck : Node2D, ISaveable
|
||||
{
|
||||
[ExportGroup("Persistence")]
|
||||
// A container for the current scene. Used to automatically add the current scene context to the save ID.
|
||||
[Export] public VariableResource _sceneKeyProvider;
|
||||
|
||||
[ExportGroup("Animation")]
|
||||
[Export] private Node2D _penTarget;
|
||||
[Export] private int _transferDelayMs;
|
||||
@@ -70,7 +66,7 @@ public partial class MVPDuck : Node2D, ISaveable
|
||||
|
||||
string id = GetMeta("SaveID").AsString();
|
||||
GD.Print($"Updating Save ID for object {Name}: {id}");
|
||||
SavegameService.AppendDataToSave(_sceneKeyProvider.Payload.AsString(), id, payloadData);
|
||||
SavegameService.AppendDataToSave( id, payloadData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -78,11 +74,10 @@ public partial class MVPDuck : Node2D, ISaveable
|
||||
/// </summary>
|
||||
public void LoadFromSaveData()
|
||||
{
|
||||
var sceneName = _sceneKeyProvider.Payload.AsString();
|
||||
string id = GetMeta("SaveID").AsString();
|
||||
GD.Print($"Loading Save ID for object {Name}: " + id);
|
||||
|
||||
Dictionary<string, Variant> save = SavegameService.GetSaveData(sceneName, id);
|
||||
Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
|
||||
if (save.Count > 0)
|
||||
{
|
||||
float xPos = 0;
|
||||
|
||||
Reference in New Issue
Block a user