mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Add a version field to mod group files.
This commit is contained in:
parent
de0309bfa7
commit
e884b269a9
1 changed files with 4 additions and 0 deletions
|
|
@ -6,6 +6,8 @@ namespace Penumbra.Mods.Groups;
|
||||||
|
|
||||||
public readonly struct ModSaveGroup : ISavable
|
public readonly struct ModSaveGroup : ISavable
|
||||||
{
|
{
|
||||||
|
public const int CurrentVersion = 0;
|
||||||
|
|
||||||
private readonly DirectoryInfo _basePath;
|
private readonly DirectoryInfo _basePath;
|
||||||
private readonly IModGroup? _group;
|
private readonly IModGroup? _group;
|
||||||
private readonly int _groupIdx;
|
private readonly int _groupIdx;
|
||||||
|
|
@ -71,6 +73,8 @@ public readonly struct ModSaveGroup : ISavable
|
||||||
j.Formatting = Formatting.Indented;
|
j.Formatting = Formatting.Indented;
|
||||||
var serializer = new JsonSerializer { Formatting = Formatting.Indented };
|
var serializer = new JsonSerializer { Formatting = Formatting.Indented };
|
||||||
j.WriteStartObject();
|
j.WriteStartObject();
|
||||||
|
j.WritePropertyName("Version");
|
||||||
|
j.WriteValue(CurrentVersion);
|
||||||
if (_groupIdx >= 0)
|
if (_groupIdx >= 0)
|
||||||
_group!.WriteJson(j, serializer, _basePath);
|
_group!.WriteJson(j, serializer, _basePath);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue