feat(ui): add decision-log reader and overlay components

This commit is contained in:
0xrsydn 2026-09-22 12:45:46 +07:00
commit 2dc711a55c
9 changed files with 469 additions and 0 deletions

View file

@ -0,0 +1,21 @@
using System.Text.Json;
namespace JevOverlay.Core;
public static class OverlayConfig
{
public const string FileName = "JevOverlay.config.json";
public static string LoadLogPath(string modDirectory)
{
using var document = JsonDocument.Parse(File.ReadAllText(Path.Combine(modDirectory, FileName)));
var root = document.RootElement;
if (root.ValueKind != JsonValueKind.Object ||
!root.TryGetProperty("log_path", out var value) ||
value.ValueKind != JsonValueKind.String ||
string.IsNullOrWhiteSpace(value.GetString()) ||
!Path.IsPathFullyQualified(value.GetString()!))
throw new FormatException("log_path must be an absolute file path.");
return Path.GetFullPath(value.GetString()!);
}
}