working intermediate state of the save system

pull/32/head
kziolkowski 2 months ago
parent 2a4425b9db
commit 2947011a1a

@ -1,4 +1,4 @@
[gd_scene load_steps=116 format=3 uid="uid://gigb28qk8t12"]
[gd_scene load_steps=117 format=3 uid="uid://gigb28qk8t12"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="1_7wfwe"]
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
@ -38,7 +38,6 @@
[ext_resource type="Resource" uid="uid://d1uuxp1lp4aro" path="res://resources/items/tomato_seed.tres" id="35_64mdn"]
[ext_resource type="Texture2D" uid="uid://65e44yde224q" path="res://art/farm/Babushka_house_01.png" id="36_e5b7x"]
[ext_resource type="Resource" uid="uid://duq7tshxv6uhp" path="res://resources/items/beet_seed.tres" id="36_fv1t2"]
[ext_resource type="Texture2D" uid="uid://cyyxqmphcrjj" path="res://art/farm/farming/farmobjekte/tomaten/tomaten_template.png" id="36_l7ekk"]
[ext_resource type="AudioStream" uid="uid://cfqg50am0swb7" path="res://audio/Music/Farming_90BPM_69Bars_Loop.wav" id="37_8ey8m"]
[ext_resource type="AudioStream" uid="uid://dku1rq5cocisg" path="res://audio/Music/Farming_90BPM_69Bars.wav" id="37_di1ed"]
[ext_resource type="Shader" uid="uid://braevmqauoek7" path="res://shader/swaying_plant.gdshader" id="37_taxvr"]
@ -79,6 +78,7 @@
[ext_resource type="Script" uid="uid://dih1b0opgc3f7" path="res://scripts/GdScript/dialogic_start_specific.gd" id="77_l7ekk"]
[ext_resource type="Resource" uid="uid://tt3d166mntmi" path="res://resources/low code/farming/var_sceneNameProvider.tres" id="77_xcwle"]
[ext_resource type="PackedScene" uid="uid://b1d2e7ely6hyw" path="res://prefabs/farm/base_field.tscn" id="78_xcwle"]
[ext_resource type="Script" uid="uid://iquhbkr7pqeg" path="res://scripts/CSharp/Common/Savegame/SaveCheats.cs" id="79_065st"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wtdui"]
shader = ExtResource("13_7p0hq")
@ -2509,6 +2509,9 @@ script = ExtResource("76_l7ekk")
_variableResource = ExtResource("77_xcwle")
_payloadToSet = "farmOutside"
[node name="SaveGameCheat" type="Node" parent="."]
script = ExtResource("79_065st")
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="InteractedTool" from="YSorted/Well/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[connection signal="SuccessfulPickUp" from="YSorted/CanGenericPickup" to="YSorted/Vesna" method="HandlePickUp"]

@ -216,6 +216,9 @@ public partial class FieldBehaviour2D : Sprite2D
var sceneName = _sceneKeyProvider.Payload.AsString();
var id = SaveId + _fieldIndex.Payload.AsString();
string jsonPayload = SavegameService.GetSaveData(sceneName, id);
if (string.IsNullOrEmpty(jsonPayload))
return;
Dictionary<string, Variant> save = Json.ParseString(jsonPayload).AsGodotDictionary<string, Variant>();
if (save.Count > 0)

@ -206,6 +206,9 @@ public partial class InventoryInstance : Node
var sceneName = SCENE_NAME;
var id = ID;
string jsonPayload = SavegameService.GetSaveData(sceneName, id);
if (string.IsNullOrEmpty(jsonPayload))
return;
Godot.Collections.Dictionary<string, Variant> save = Json.ParseString(jsonPayload).AsGodotDictionary<string, Variant>();
if (save.Count > 0)

@ -0,0 +1,15 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Savegame;
[Tool]
public partial class SaveCheats : Node
{
[ExportToolButton("ResetSave")] Callable _raiseAction => Callable.From(Reset);
public void Reset()
{
SavegameService.Reset();
}
}

@ -94,4 +94,10 @@ public static class SavegameService
_loaded = true;
}
public static void Reset()
{
SaveDatas = new ();
Save();
}
}
Loading…
Cancel
Save