24 lines
538 B
C#
24 lines
538 B
C#
using Newtonsoft.Json;
|
|
|
|
namespace ConfigPlugin;
|
|
|
|
public class Config
|
|
{
|
|
public string? CustomMessage;
|
|
public string? Player;
|
|
|
|
public void Write()
|
|
{
|
|
File.WriteAllText(ConfigPlugin.ConfigPath, JsonConvert.SerializeObject(this, Formatting.Indented));
|
|
}
|
|
|
|
public static Config? Read()
|
|
{
|
|
if (!File.Exists(ConfigPlugin.ConfigPath))
|
|
{
|
|
return new Config();
|
|
}
|
|
|
|
return JsonConvert.DeserializeObject<Config>(File.ReadAllText(ConfigPlugin.ConfigPath));
|
|
}
|
|
} |