예제 #1
0
        public void OnApplicationQuit()
        {
            Log.Debug("OnApplicationQuit");
            _harmonyInstance.UnpatchAll("com.ryan.VisibleHitboxes");
            _harmonyInstance = null;

            ScoreSubmission.RemoveProlongedDisable(modName);
        }
예제 #2
0
파일: Plugin.cs 프로젝트: Raemien/SnapTurn
 private void OnSceneLoaded(Scene newScene, LoadSceneMode sceneMode)
 {
     StartTurnManager();
     if (newScene.name != "GameCore")
     {
         ScoreSubmission.RemoveProlongedDisable("SnapTurn");
     }
 }
예제 #3
0
 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);
            }
        }
예제 #5
0
 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);
     }
 }
예제 #6
0
        /// <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();
                }
            }
        }
예제 #7
0
        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.");
                }
            }
        }