static bool Prefix(ref GameCoreSceneSetup __instance, ref GameplayCoreSceneSetupData ____sceneSetupData) { IDifficultyBeatmap difficultyBeatmap = ____sceneSetupData.difficultyBeatmap; IReadOnlyList <BeatmapEventData> beatmapEventData = difficultyBeatmap.beatmapData.beatmapEventsData; SpawnRotationProcessor rotProcessor = new SpawnRotationProcessor(); bool is360 = false; foreach (BeatmapEventData beatmapEvent in beatmapEventData) { if (beatmapEvent.type != BeatmapEventType.Event14 && beatmapEvent.type != BeatmapEventType.Event15) { continue; } if (rotProcessor.RotationForEventValue(beatmapEvent.value) != 0) { is360 = true; break; } } if (!is360) { IPAUtils.SetProperty <BeatmapData, int>(difficultyBeatmap.beatmapData, "spawnRotationEventsCount", 0); } return(true); }
internal static void Prefix(ref GameplayCoreInstaller __instance, ref GameplayCoreSceneSetupData ____sceneSetupData) { var container = GetContainer(__instance); var settings = container.Resolve <MiscSettings>(); if (settings.BPMFixEnabled) { bool actually360 = false; var data = ____sceneSetupData.difficultyBeatmap.beatmapData.beatmapEventsData; var spawnRotationProcessor = new SpawnRotationProcessor(); for (int i = 0; i < data.Count; i++) { var bmEvent = data[i]; if (bmEvent.type == BeatmapEventType.Event14 || bmEvent.type == BeatmapEventType.Event15) { if (spawnRotationProcessor.RotationForEventValue(bmEvent.value) != 0) { actually360 = true; } } } if (!actually360) { var beatmapData = ____sceneSetupData.difficultyBeatmap.beatmapData; SetRotationCount(ref beatmapData, 0); } } }
static bool Prefix(ref GameplayCoreSceneSetup __instance) { IPALogger log = Plugin._logger; log.Debug("Started patch!"); bool is360 = false; IDifficultyBeatmap difficultyBeatmap = IPAUtils.GetField <GameplayCoreSceneSetupData, GameplayCoreSceneSetup>(__instance, "_sceneSetupData").difficultyBeatmap; BeatmapEventData[] beatmapEventData = difficultyBeatmap.beatmapData.beatmapEventData; SpawnRotationProcessor rotProcessor = new SpawnRotationProcessor(); foreach (BeatmapEventData beatmapEvent in beatmapEventData) { if (!(beatmapEvent.type == BeatmapEventType.Event14 || beatmapEvent.type == BeatmapEventType.Event15)) { continue; } if (rotProcessor.RotationForEventValue(beatmapEvent.value) != 0) { log.Debug("360 is true!"); is360 = true; break; } } if (!is360) { IPAUtils.SetProperty <BeatmapData, int>(difficultyBeatmap.beatmapData, "spawnRotationEventsCount", 0); } return(true); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /// <summary> /// Prefix /// </summary> /// <param name="__instance">GameplayCoreInstaller instance</param> internal static void Prefix(ref GameplayCoreInstaller __instance, ref GameplayCoreSceneSetupData ____sceneSetupData) { if (!(Config.GameTweaker.Enabled && Config.GameTweaker.NoFake360HUD)) { return; } IDifficultyBeatmap l_IDifficultyBeatmap = ____sceneSetupData.difficultyBeatmap; IReadOnlyList <BeatmapEventData> l_BeatmapEventData = l_IDifficultyBeatmap.beatmapData.beatmapEventsData; SpawnRotationProcessor l_SpawnRotationProcessor = new SpawnRotationProcessor(); bool l_Is360 = false; foreach (BeatmapEventData l_CurrentEvent in l_BeatmapEventData) { if (!(l_CurrentEvent.type == BeatmapEventType.Event14 || l_CurrentEvent.type == BeatmapEventType.Event15)) { continue; } if (l_SpawnRotationProcessor.RotationForEventValue(l_CurrentEvent.value) != 0) { l_Is360 = true; break; } } if (!l_Is360) { /// Backup data m_BeatMapToRestore = l_IDifficultyBeatmap.beatmapData; m_BeatMapToRestoreValue = l_IDifficultyBeatmap.beatmapData.spawnRotationEventsCount; /// Add on scene change event callback SDK.Game.Logic.OnSceneChange += Game_OnSceneChange; /// Update rotation count IPA.Utilities.ReflectionUtil.SetProperty <BeatmapData, int>(l_IDifficultyBeatmap.beatmapData, "spawnRotationEventsCount", 0); } }