mirror of
https://github.com/Jacobwasbeast/LegacyWeaveLoader.git
synced 2026-05-21 21:24:30 +00:00
SKSE-style external mod loader with zero game source modifications. - LegacyForge.Launcher: C# console app that injects runtime DLL into game process - LegacyForgeRuntime: C++ DLL with PDB symbol resolution, MinHook function hooking, and .NET CoreCLR hosting - LegacyForge.Core: C# mod discovery and lifecycle management - LegacyForge.API: Fabric-style mod API with namespaced string IDs, fluent property builders, and event system - ExampleMod: Sample mod demonstrating block/item registration
36 lines
748 B
C#
36 lines
748 B
C#
using System.Text.Json;
|
|
|
|
namespace LegacyForge.Launcher;
|
|
|
|
public class Config
|
|
{
|
|
public string? GameExePath { get; set; }
|
|
|
|
private static readonly JsonSerializerOptions JsonOptions = new()
|
|
{
|
|
WriteIndented = true
|
|
};
|
|
|
|
public static Config Load(string path)
|
|
{
|
|
if (!File.Exists(path))
|
|
return new Config();
|
|
|
|
try
|
|
{
|
|
var json = File.ReadAllText(path);
|
|
return JsonSerializer.Deserialize<Config>(json, JsonOptions) ?? new Config();
|
|
}
|
|
catch
|
|
{
|
|
return new Config();
|
|
}
|
|
}
|
|
|
|
public void Save(string path)
|
|
{
|
|
var json = JsonSerializer.Serialize(this, JsonOptions);
|
|
File.WriteAllText(path, json);
|
|
}
|
|
}
|