-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModSettings.cs
41 lines (29 loc) · 1.33 KB
/
ModSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.DirectoryServices.ActiveDirectory;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace GH3MLGUI;
public class ModSettings
{
[JsonPropertyName("Name")]
public string Name { get; set; } = "axelsteel.newmod";
[JsonPropertyName("displayName")]
public string DisplayName { get; set; } = "My Mod";
[JsonPropertyName("description")]
public string Description { get; set; } = "GH3 Modding in 2025??";
[JsonPropertyName("version")]
public string Version { get; set; } = "1.0.0.0";
// Reserved
[JsonPropertyName("updateLink")]
public string UpdateLink { get; set; } = "";
[JsonPropertyName("paksToReplace")]
public Dictionary<string, string> PaksToReplace { get; set; } = new Dictionary<string, string>();
[JsonPropertyName("paksToLoad")]
public string[] PaksToLoad { get; set; } = Array.Empty<string>();
public static ModSettings Read(string path) => JsonSerializer.Deserialize<ModSettings>(File.ReadAllText(path))!;
public static void Write(ModSettings settings, string directory) => File.WriteAllText(Path.Combine(directory, "modinfo.json"), JsonSerializer.Serialize(settings, new JsonSerializerOptions() { WriteIndented = true }));
}