private void CheckActivation() { IDifficultyBeatmap difficultyBeatmap = BS_Utils.Plugin.LevelData.GameplayCoreSceneSetupData.difficultyBeatmap; ExtraSongData.DifficultyData difficultyData = Collections.RetrieveDifficultyData(difficultyBeatmap); if (difficultyData != null) { if (Config.swingMode) { active = true; ExtraBeatmapData.ParseExtraDataForSong(); ScoreSubmission.DisableSubmission("360 Mode"); } else { if (difficultyData.additionalDifficultyData._requirements.Contains("360 Mode")) { active = true; ExtraBeatmapData.ParseExtraDataForSong(); } else { active = false; } } } else { active = false; } }
static void Prefix(LevelCompletionResults levelCompletionResults) { if (ScoreSubmission.disabled || ScoreSubmission.prolongedDisable) { ScoreSubmission.DisableScoreSaberScoreSubmission(); } }
internal static void SetupMods() { bool disableScore = false; BS_Utils.Plugin.LevelDidFinishEvent += Plugin_LevelDidFinishEvent; MissHell.SetupHell(); ChallengeMode.SetupMode(); if (FuckeryUI.OneAtATime.Enabled) { OAAT(); } if (FuckeryUI.InvisibleSabers.Enabled) { InvisbleSabers(); } if (FuckeryUI.ModsEnabled()) { disableScore = true; } if (disableScore) { ScoreSubmission.DisableSubmission("Nova's Fuckery"); } }
#pragma warning restore IDE0051 // Used by MonoBehaviour private void Load() { // Check for modes that would force changes to the config for the current map for (int i = 0; i < SceneManager.sceneCount; i++) { // Disable hitbox scaling and cosmetic length scaling in multiplayer if (SceneManager.GetSceneAt(i).name == "MultiplayerGameplay") { LengthMultiplier = 1; EnableHitboxScaling = false; IsMultiplayerEnv = true; Logger.log.Info("Multiplayer environment detected, disabling hitbox scaling and cosmetic length scaling."); } // Disable hitbox scaling in mission gameplay if (SceneManager.GetSceneAt(i).name == "MissionGameplay") { EnableHitboxScaling = false; Logger.log.Info("Campaign environment detected, disabling hitbox scaling."); } } // Allow the user to run in any other mode, but don't allow ScoreSubmission if hitbox scaling is enabled if (EnableHitboxScaling) { ScoreSubmission.DisableSubmission(Plugin.PluginName); Logger.log.Info("ScoreSubmission has been disabled."); } StartCoroutine(ApplyGameCoreModifications()); }
public static void DisableScoreSubmissionIfNeeded() { if (PluginConfig.Instance.SlowmoDuringThrow) { ScoreSubmission.DisableSubmission("TrickSaber"); } }
private void OnSceneLoaded(Scene newScene, LoadSceneMode sceneMode) { StartTurnManager(); if (newScene.name != "GameCore") { ScoreSubmission.RemoveProlongedDisable("SnapTurn"); } }
static void Prefix(LevelCompletionResults levelCompletionResults) { if (ScoreSubmission.disabled || ScoreSubmission.prolongedDisable) { //Utilities.Logger.Log("Score Submission Disabled"); ScoreSubmission.DisableScoreSaberScoreSubmission(); } }
public void OnApplicationQuit() { Log.Debug("OnApplicationQuit"); _harmonyInstance.UnpatchAll("com.ryan.VisibleHitboxes"); _harmonyInstance = null; ScoreSubmission.RemoveProlongedDisable(modName); }
public static bool PreLevelFailed() { if (!Gamemode.IsPartyActive) { ScoreSubmission.DisableSubmission("NoFailPlus"); } return(!Plugin.config.Value.Enable); }
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 DisableScore() { if (!Plugin.isScoreDisabled) { Logger.log.Notice("TransparentWall is enabled in HMD. ScoreSubmission has been disabled."); ScoreSubmission.ProlongedDisableSubmission("TransparentWall"); Plugin.isScoreDisabled = true; } }
void OnGameLoaded(Scene loadedScene) { if (PluginConfig.Instance.Enabled) { ScoreSubmission.DisableSubmission("BSCM"); var gameCore = loadedScene.GetRootGameObjects().First(); _remoteSaber = new RemoteSaber(gameCore); } }
private void SceneManager_activeSceneChanged(Scene arg0, Scene arg1) { if (arg1.name == "GameCore") { CustomNotes.Data.CustomNote activeNote = CustomNotes.Utilities.NoteAssetLoader.CustomNoteObjects[CustomNotes.Utilities.NoteAssetLoader.SelectedNote]; if (activeNote.Descriptor.NoteName.ToLower().Contains("ddr notes")) { ScoreSubmission.DisableSubmission("DDR Saber"); } } }
private void Update() { try { var config = Settings.instance; mainController = config.SelectedController == "Left" ? InputDevices.GetDeviceAtXRNode(XRNode.LeftHand) : InputDevices.GetDeviceAtXRNode(XRNode.RightHand); mainController.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out mainStickPress); float mainStick = Input.GetAxis("Horizontal" + config.SelectedController + "Hand"); string curscene = SceneManager.GetActiveScene().name; turnStep = config.RotationStep; this.enabled = (config.EnableTurning && !(curscene == "GameCore" && !config.EnableInSongs)); if (turnStep > 5 && config.SmoothTurn) { turnStep = 5; config.RotationStep = 5; } mainController.TryGetFeatureValue(CommonUsages.secondary2DAxis, out hasJoystick); string conManu = mainController.manufacturer; if (hasJoystick != Vector2.zero || (conManu == "Oculus" || (conManu == "Valve" && config.InputType == "Default")) || config.InputType == "Touch") { mainStickPress = Math.Abs(mainStick) > 0.1; // Devices with joysticks shouldn't require a full press, unless overridden in settings. } if (!isFinished && mainStickPress) { switch (SceneManager.GetActiveScene().name) { case "GameCore" when config.EnableTurning && config.EnableInSongs: ScoreSubmission.ProlongedDisableSubmission("SnapTurn"); break; default: break; } int spinDir = mainStick < 0 ? (0 - turnStep) : turnStep; this.transform.Rotate(0, spinDir, 0, Space.World); SetSceneRotations(); } isFinished = (mainStickPress && !config.SmoothTurn); } catch (Exception) { throw; } }
private void SetEnabled(bool value) { Config.Instance.IsEnabled = value; if (value) { ScoreSubmission.ProlongedDisableSubmission(Plugin.modName); } else { ScoreSubmission.RemoveProlongedDisable(Plugin.modName); } }
public void ApplyHarmonyPatches() { try { Logger.log.Debug("Applying Harmony patches."); harmony.PatchAll(Assembly.GetExecutingAssembly()); ScoreSubmission.ProlongedDisableSubmission("PlaneVisualizer"); } catch (Exception ex) { Logger.log.Critical("Error applying Harmony patches: " + ex.Message); Logger.log.Debug(ex); } }
internal static void SetupMods() { bool disableScore = false; if (noraUI.ModsEnabled()) { disableScore = true; } if (disableScore) { ScoreSubmission.DisableSubmission("Nora's Fuckery"); } }
public void OnSuccess(ScoreSubmission scoreSubmission) { string msg = "success submitted."; msg += string.Format("leaderboard id:{0}, playerId:{1}, scoreResults: \n", scoreSubmission.LeaderboardId, scoreSubmission.PlayerId); foreach (KeyValuePair <int, ScoreSubmission.Result> r in scoreSubmission.ScoreResults) { msg += string.Format("key: {0}, rawScore:{1}, formattedScore:{2}, scoreTag:{3}, isBest:{4}; \n", r.Key, r.Value.RawScore, r.Value.FormattedScore, r.Value.ScoreTag, r.Value.IsBest); } Show(msg); }
public void GameSceneLoaded() { _currentScene = _gameSceneName; DestroyPlayerControllers(); DestroyScoreScreens(); if (Client.Instance != null && Client.Instance.connected) { StartCoroutine(WaitForControllers()); needToSendUpdates = true; if (Config.Instance.SubmitScores == 0 || Config.Instance.SpectatorMode || Client.disableScoreSubmission) { ScoreSubmission.DisableSubmission("Beat Saber Multiplayer"); } } }
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 DisableScoreSubmission(string reason) { lock (scoreBlockList) { if (!scoreBlockList.Contains(reason)) { scoreBlockList.Add(reason); } if (!ScoreIsBlocked) { ScoreSubmission.ProlongedDisableSubmission(Plugin.PluginName); ScoreIsBlocked = true; Logger.log.Info("ScoreSubmission has been disabled."); } } }
public void OnActiveSceneChanged(Scene oldScene, Scene newScene) { _init = false; if (newScene.name == "GameCore") { Config.Read(); if (Config.parabola || Config.noBlue || Config.noRed || Config.redToBlue || Config.blueToRed || Config.centering || Config.feet || Config.noDirection || Config.flatNotes || Config.superhot || Config.vacuum) { ScoreSubmission.DisableSubmission(Plugin.Name); } StartCoroutine(OnGameCoreCoroutine()); } }
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."); } } }
public void OnApplicationStart() { Log.Debug("OnApplicationStart"); new GameObject("VisibleHitboxesController").AddComponent <VisibleHitboxesController>(); _harmonyInstance = new Harmony("com.ryan.VisibleHitboxes"); _harmonyInstance.PatchAll(Assembly.GetExecutingAssembly()); if (Config.Instance.IsEnabled) { ScoreSubmission.ProlongedDisableSubmission(modName); } _menuButtonManager = new MenuButtonManager(); _menuButtonManager.Setup(); CreateMaterial(); CreateCubeMesh(); }
private static void OnGameSceneActive() { if (CurrentSceneState == SceneState.Game) { return; } if (GameNoteControllerAwakePatch.colorSuckers == null) { GameNoteControllerAwakePatch.colorSuckers = new List <ColorSucker>(); } else { GameNoteControllerAwakePatch.colorSuckers.Clear(); } if (config.Value.Enabled && (FightSabersGameplaySetup.instance.ColorSuckerEnabled || FightSabersGameplaySetup.instance.NoteShrinkerEnabled || FightSabersGameplaySetup.instance.TimeWarperEnabled)) { config.Value.Enabled = false; OverlayViewController.instance.fsDisableContainerState = !config.Value.Enabled; OverlayViewController.instance.experienceContainerState = config.Value.Enabled; configProvider.Store(config.Value); } if (config.Value.Enabled) { ScoreSubmission.DisableSubmission("FightSabers"); MonsterGenerator.Create(); QuestManager.instance.LinkGameEventsForActivatedQuests(); } else if (FightSabersGameplaySetup.instance.ColorSuckerEnabled || FightSabersGameplaySetup.instance.NoteShrinkerEnabled || FightSabersGameplaySetup.instance.TimeWarperEnabled) { ScoreSubmission.DisableSubmission("FightSabers"); var go = new GameObject("[FS|ModifierManager]"); var modifierManager = go.AddComponent <ModifierManager>(); var modifiers = new List <Type>(); if (FightSabersGameplaySetup.instance.ColorSuckerEnabled) { modifiers.Add(typeof(ColorSucker)); } if (FightSabersGameplaySetup.instance.NoteShrinkerEnabled) { modifiers.Add(typeof(NoteShrinker)); } if (FightSabersGameplaySetup.instance.TimeWarperEnabled) { modifiers.Add(typeof(TimeWarper)); } modifierManager.modifiers = modifiers.ToArray(); modifierManager.noteShrinkerStrength = FightSabersGameplaySetup.instance.NoteShrinkerStrength; modifierManager.colorSuckerStrength = FightSabersGameplaySetup.instance.ColorSuckerStrength; modifierManager.timeWarperStrength = FightSabersGameplaySetup.instance.TimeWarperStrength; new UnityTask(modifierManager.ConfigureModifiers(0.05f)); var scoreControllerManager = go.AddComponent <ScoreControllerManager>(); scoreControllerManager.BombCut += self => { modifierManager.ReduceColorSuckerColorness(); }; scoreControllerManager.NoteCut += self => { modifierManager.ImproveColorSuckerColorness(); }; scoreControllerManager.NoteMissed += self => { modifierManager.ReduceColorSuckerColorness(); }; } CurrentSceneState = SceneState.Game; }
//Send score to other apps public void ShareScore() { ScoreSubmission.SendScore(score); }