public static bool SaveHook(Func <bool> orig) { bool result = orig(); AdvancedGameStatsManager.Save(); return(result); }
/// <summary> /// Disposes SaveAPI <see cref="Hook"/>s, unloads <see cref="AdvancedGameStatsManager"/> and nulls custom <see cref="SaveManager.SaveType"/>s /// </summary> public static void Unload() { if (!m_loaded) { return; } AdvancedGameSave = null; AdvancedMidGameSave = null; saveHook?.Dispose(); loadHook?.Dispose(); resetHook?.Dispose(); beginSessionHook?.Dispose(); endSessionHook?.Dispose(); clearAllStatsHook?.Dispose(); deleteMidGameSaveHook?.Dispose(); midgameSaveHook?.Dispose(); invalidateSaveHook?.Dispose(); revalidateSaveHook?.Dispose(); frameDelayedInitizlizationHook?.Dispose(); moveSessionStatsHook?.Dispose(); prerequisiteHook?.Dispose(); clearActiveGameDataHook?.Dispose(); AdvancedGameStatsManager.Save(); AdvancedGameStatsManager.Unload(); BreachShopTool.Unload(); m_loaded = false; }