v1.2.0: 重构为插件+独立Manager架构,横版UI,精确保留文本框边距的文档转换

This commit is contained in:
雾启工作室
2026-06-28 11:12:26 +08:00
parent 790f5901cf
commit 063850ec56
38 changed files with 2669 additions and 1556 deletions

View File

@@ -0,0 +1,44 @@
using System.IO;
using System.Text.Json;
namespace BetterSeewo.Manager.Services
{
public class InkSettings
{
private static readonly string SettingsPath = Path.Combine(
System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData),
"BetterEN5", "ink-settings.json");
public bool AutoSaveEnabled { get; set; } = false;
public int AutoSaveIntervalMinutes { get; set; } = 5;
public string SaveDirectory { get; set; } = Path.Combine(
System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments),
"Better-Seewo", "Ink");
public static InkSettings Load()
{
try
{
if (File.Exists(SettingsPath))
{
var json = File.ReadAllText(SettingsPath);
return JsonSerializer.Deserialize<InkSettings>(json) ?? new InkSettings();
}
}
catch { }
return new InkSettings();
}
public void Save()
{
try
{
var dir = Path.GetDirectoryName(SettingsPath);
if (!string.IsNullOrEmpty(dir) && !Directory.Exists(dir))
Directory.CreateDirectory(dir);
File.WriteAllText(SettingsPath, JsonSerializer.Serialize(this, new JsonSerializerOptions { WriteIndented = true }));
}
catch { }
}
}
}