-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefaultLanguage.cs
43 lines (36 loc) · 1.16 KB
/
DefaultLanguage.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
42
43
using Kingmaker.EntitySystem.Persistence.JsonUtility;
using ModMaker;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
namespace TutorialCanvas
{
[JsonObject(MemberSerialization.OptOut)]
public class DefaultLanguage : ILanguage
{
[JsonProperty]
public string Language { get; set; } = "English (Default)";
[JsonProperty]
public Version Version { get; set; }
[JsonProperty]
public string Contributors { get; set; }
[JsonProperty]
public string HomePage { get; set; }
[JsonProperty]
public Dictionary<string, string> Strings { get; set; } = new Dictionary<string, string>()
{
{ "Menu_Tab_Gameplay", "Gameplay" },
};
public T Deserialize<T>(TextReader reader)
{
DefaultJsonSettings.Initialize();
return JsonConvert.DeserializeObject<T>(reader.ReadToEnd());
}
public void Serialize<T>(TextWriter writer, T obj)
{
DefaultJsonSettings.Initialize();
writer.Write(JsonConvert.SerializeObject(obj, Formatting.Indented));
}
}
}