inital SK upload

This commit is contained in:
BlankenshipG 2026-04-26 14:27:26 -04:00
commit 5edb6915ed
125 changed files with 2659 additions and 107 deletions

View file

@ -13,6 +13,7 @@ internal static class EngineSettings
"engine.json");
private static List<string> _pluginPaths = new();
private static string _loggingLevel = "Info";
private static bool _loaded;
public static IReadOnlyList<string> PluginPaths
@ -24,6 +25,15 @@ internal static class EngineSettings
}
}
public static string LoggingLevel
{
get
{
EnsureLoaded();
return _loggingLevel;
}
}
public static void AddPluginPath(string path)
{
EnsureLoaded();
@ -66,6 +76,14 @@ internal static class EngineSettings
_pluginPaths.Add(val);
}
}
if (doc.RootElement.TryGetProperty("LoggingLevel", out var loggingLevelElement) &&
loggingLevelElement.ValueKind == JsonValueKind.String)
{
string? configuredLevel = loggingLevelElement.GetString();
if (!string.IsNullOrWhiteSpace(configuredLevel))
_loggingLevel = configuredLevel;
}
}
catch (Exception ex)
{
@ -88,6 +106,7 @@ internal static class EngineSettings
foreach (string p in _pluginPaths)
w.WriteStringValue(p);
w.WriteEndArray();
w.WriteString("LoggingLevel", _loggingLevel);
w.WriteEndObject();
}
File.WriteAllBytes(SettingsPath, ms.ToArray());