public void OnApplicationQuit() { Log.Debug("OnApplicationQuit"); _harmonyInstance.UnpatchAll("com.ryan.VisibleHitboxes"); _harmonyInstance = null; ScoreSubmission.RemoveProlongedDisable(modName); }
private void OnSceneLoaded(Scene newScene, LoadSceneMode sceneMode) { StartTurnManager(); if (newScene.name != "GameCore") { ScoreSubmission.RemoveProlongedDisable("SnapTurn"); } }
private void EnableScore() { if (Plugin.isScoreDisabled) { Logger.log.Notice("TransparentWall is disabled in HMD. ScoreSubmission has been re-enabled."); ScoreSubmission.RemoveProlongedDisable("TransparentWall"); Plugin.isScoreDisabled = false; } }
private void SetEnabled(bool value) { Config.Instance.IsEnabled = value; if (value) { ScoreSubmission.ProlongedDisableSubmission(Plugin.modName); } else { ScoreSubmission.RemoveProlongedDisable(Plugin.modName); } }
public void RemoveHarmonyPatches() { try { // Removes all patches with this HarmonyId Logger.log.Debug("Removing harmony patches"); harmony.UnpatchAll(HarmonyId); ScoreSubmission.RemoveProlongedDisable("PlaneVisualizer"); } catch (Exception ex) { Logger.log.Critical("Error removing Harmony patches: " + ex.Message); Logger.log.Debug(ex); } }
/// <summary> /// Should only be called on plugin exit! /// </summary> internal static void Cleanup() { lock (scoreBlockList) { if (ScoreIsBlocked) { Logger.log.Info("Plugin is exiting, ScoreSubmission has been re-enabled."); ScoreSubmission.RemoveProlongedDisable(Plugin.PluginName); ScoreIsBlocked = false; } if (scoreBlockList.Count != 0) { scoreBlockList.Clear(); } } }
internal static void EnableScoreSubmission(string reason) { lock (scoreBlockList) { if (scoreBlockList.Contains(reason)) { scoreBlockList.Remove(reason); } if (ScoreIsBlocked && scoreBlockList.Count == 0) { ScoreSubmission.RemoveProlongedDisable(Plugin.PluginName); ScoreIsBlocked = false; Logger.log.Info("ScoreSubmission has been re-enabled."); } } }