SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Add API for per-save JSON data

Pathoschild opened this issue ยท 4 comments

commented

Extend the JSON API (#292) to support per-save JSON files, which will be stored automatically in the save folder to allow GOG/Steam cloud sync.

commented

Possible usage:

// save to <app data>/Saves/mod data/<mod id>/data.json
helper.Data.Write("data.json", data);

// save to <app data>/Saves/mod data/<mod id>/Name_0123456789_data.json
helper.Data.Write("data.json", data, perSave: true);

Possibly combine with config.json:

// read config.json
TModel config = helper.Data.ReadConfig<TModel>();

// write config.json
helper.Data.WriteConfig(config);
commented

I thought this was going to go into individual save folder so that it would cloud sync?

commented

If I recall correctly, we tested it and cloud sync saves everything under <app data>/Saves?

commented

Closing in favor of #468.