19 lines
480 B
C#
19 lines
480 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()
|
|
{
|
|
return !File.Exists(ConfigPlugin.ConfigPath) ? new Config() : JsonConvert.DeserializeObject<Config>(File.ReadAllText(ConfigPlugin.ConfigPath));
|
|
}
|
|
} |