worldbox-observer-mod/IdleSpectator/Story/LifeSagaSessionPatches.cs
DazedAnon ba58a9ff38 feat(saga): deepen session cast stakes and cut idle hitch spikes
- Keep LifeSagaSession across Clear; wipe on map load/clear with bind key
- Soft-bias Prefer/cross-MC/cast and prefer roster MCs in aftermath/recover/park
- Resolve war/plot principals plus discrete/WorldLog labels from live libraries
- Amortize roster world scans, gate Relayout, and add hitch probe/save-slot helpers
2026-07-22 14:37:36 -05:00

36 lines
856 B
C#

using HarmonyLib;
namespace IdleSpectator;
/// <summary>Reset life-saga session when the live map finishes loading or is cleared.</summary>
[HarmonyPatch]
public static class LifeSagaSessionPatches
{
[HarmonyPatch(typeof(MapBox), nameof(MapBox.finishingUpLoading))]
[HarmonyPostfix]
public static void PostfixFinishingUpLoading()
{
try
{
LifeSagaSession.OnWorldLoadFinished();
}
catch
{
// Load path must not throw into the game.
}
}
[HarmonyPatch(typeof(MapBox), nameof(MapBox.clearWorld))]
[HarmonyPrefix]
public static void PrefixClearWorld()
{
try
{
LifeSagaSession.ResetForWorldChange("clear-world");
}
catch
{
// Teardown path must not throw into the game.
}
}
}