mirror of
https://gitea.tendokyu.moe/yellowberry/WACCALauncher.git
synced 2026-09-22 22:58:00 +03:00
42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using Newtonsoft.Json;
|
|
using System.IO;
|
|
|
|
namespace WACCALauncher
|
|
{
|
|
// TODO: implement themes
|
|
public enum LauncherTheme
|
|
{
|
|
Dark
|
|
}
|
|
|
|
[JsonObject]
|
|
public class LauncherSettings
|
|
{
|
|
[JsonProperty]
|
|
public string DefaultProfile { get; set; } = string.Empty;
|
|
|
|
[JsonProperty]
|
|
public bool UseWatchdog { get; set; } = true;
|
|
|
|
[JsonProperty]
|
|
public LauncherTheme Theme { get; set; } = LauncherTheme.Dark;
|
|
|
|
[JsonProperty]
|
|
public bool StrictMode { get; set; } = true;
|
|
|
|
[JsonProperty]
|
|
public string ProfileDir { get; set; } = "_profiles";
|
|
|
|
public static LauncherSettings Load()
|
|
{
|
|
return JsonConvert.DeserializeObject<LauncherSettings>(File.ReadAllText("launcher.json"));
|
|
}
|
|
|
|
public static void Save(LauncherSettings settings)
|
|
{
|
|
if (settings == null) settings = new LauncherSettings();
|
|
|
|
File.WriteAllText("launcher.json", JsonConvert.SerializeObject(settings, Formatting.Indented));
|
|
}
|
|
}
|
|
} |