Files
LegacyWeaveLoader/WeaveLoader.Launcher/Config.cs
Jacobwasbeast fa195fdc2e Rebrand LegacyForge to Weave Loader
Rename across entire codebase:
- LegacyForge -> WeaveLoader (identifiers, namespaces, classes, DLLs)
- LegacyForgeRuntime -> WeaveLoaderRuntime (C++ project)
- LegacyForge.API/Core/Launcher -> WeaveLoader.API/Core/Launcher (C# projects)
- [LegacyForge] -> [WeaveLoader] (log prefixes)
- legacyforge -> weaveloader (config files, log files, backup suffixes)
- Display name "Weave Loader" in README, CONTRIBUTING, LICENSE
2026-03-06 23:31:18 -06:00

36 lines
748 B
C#

using System.Text.Json;
namespace WeaveLoader.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);
}
}