Files
Triforce-Source/builder/HookshotBuilder/BuilderSettings.cs
ruckus7382sfgsgdf 34b3683441 Triforce v0.2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:32:48 -06:00

24 lines
1.1 KiB
C#

namespace HookshotBuilder;
/// What the player chose last time (the install folder, the game files, the shaders' tick): builder-settings.json beside the versions
sealed class BuilderSettings
{
public string? Out { get; set; }
public string? Nup { get; set; }
public string? Romfs { get; set; }
public string? Exefs { get; set; }
public bool Dlss { get; set; } // (NVIDIA DLSS ticked: NVIDIA's license was accepted)
public bool Fsr { get; set; } // (AMD FSR 4 ticked)
public bool PrepareLater { get; set; } // ("Prepare shaders now" unticked)
public static BuilderSettings? Load(string path)
{
try { return System.Text.Json.JsonSerializer.Deserialize<BuilderSettings>(System.IO.File.ReadAllText(path)); }
catch (Exception) { return null; }
}
/// (the updates, from the launcher's Update and from the --update start after a self-update, begin before ApplySettings sets
/// the tick from these settings: they read the saved choice itself. None saved: prepared, as the tick's default)
public static bool PrepareNow(string path) => Load(path)?.PrepareLater != true;
}