public void OnActiveSceneChanged(Scene prevScene, Scene nextScene) { if (nextScene.name == "MenuCore") { if (Gamemode.IsIsolatedLevel) // Only remove is necessary. { Logger.Log("Removing Isolated Level"); } Gamemode.IsIsolatedLevel = false; Gamemode.IsolatingMod = ""; LevelData.Clear(); } }
internal static void ApplyHarmonyPatches() { if (patched) { return; } try { Logger.Log("Applying Harmony Patches", LogLevel.Debug); harmony.PatchAll(System.Reflection.Assembly.GetExecutingAssembly()); patched = true; } catch (Exception ex) { Logger.Log("Exception Trying to Apply Harmony Patches", LogLevel.Error); Logger.Log(ex.ToString(), LogLevel.Error); } }
internal static void DisableScoreSaberScoreSubmission() { if (ScoreSaberSubmissionProperty != null) { ScoreSaberSubmissionProperty.SetValue(null, false); } else { StandardLevelScenesTransitionSetupDataSO setupDataSO = Resources.FindObjectsOfTypeAll <StandardLevelScenesTransitionSetupDataSO>().FirstOrDefault(); if (setupDataSO == null) { Logger.Log("ScoreSubmission: StandardLevelScenesTransitionSetupDataSO not found - exiting...", LogLevel.Warning); return; } DisableEvent(setupDataSO, "didFinishEvent", "Five"); } }
public void OnActiveSceneChanged(Scene prevScene, Scene nextScene) { if (nextScene.name == "HealthWarning") { Gameplay.GetUserInfo.TriggerReady(); } if (nextScene.name == "MenuCore") { Gameplay.GetUserInfo.TriggerReady(); if (Gamemode.IsIsolatedLevel) // Only remove is necessary. { Logger.Log("Removing Isolated Level"); } Gamemode.IsIsolatedLevel = false; Gamemode.IsolatingMod = ""; LevelData.Clear(); } }
// Used for debugging purposes private static void LogEvents(object target, string eventName) { FieldInfo fieldInfo = target.GetType().GetField(eventName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); var eventDelegate = fieldInfo.GetValue(target) as MulticastDelegate; if (eventDelegate == null) { Logger.Log("ScoreSubmission: Unable to get eventDelegate from StandardLevelScenesTransitionSetupDataSO - exiting...", LogLevel.Debug); } var delegates = eventDelegate.GetInvocationList(); Logger.Log("ScoreSubmission: Getting list of delegates for didFinish event...", LogLevel.Debug); foreach (var item in delegates) { Logger.Log(String.Format("ScoreSubmission: Found delegate named '{0}' by Module '{1}', part of Assembly '{2}'", item.Method.Name, item.Method.Module.Name, item.Method.Module.Assembly.FullName), LogLevel.Debug); } }
public void OnActiveSceneChanged(Scene prevScene, Scene nextScene) { if (nextScene.name == SceneNames.Menu) { GetUserInfo.TriggerReady(); } if (nextScene.name == SceneNames.PostSongMenu) { GetUserInfo.TriggerReady(); if (Gamemode.IsIsolatedLevel) // Only remove is necessary. { Logger.Log("Removing Isolated Level"); } Gamemode.IsIsolatedLevel = false; Gamemode.IsolatingMod = ""; scenesTransitionSetupData = null; LevelData.Clear(); } }