♻️ reworked and debugged the SaveSystem. Removed unnecessary scene reference.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user