static bool Prefix(IReadonlyBeatmapData beatmapData, ref IReadonlyBeatmapData __result) { if (!Configuration.PluginConfig.Instance.wallsInZenMode) { return(true); } BeatmapData copyWithoutBeatmapObjects = beatmapData.GetCopyWithoutBeatmapObjects(); BeatmapData.CopyBeatmapObjectsWaypointsOnly(beatmapData, copyWithoutBeatmapObjects); foreach (BeatmapObjectData beatmapObjectData in beatmapData.beatmapObjectsData) { if (beatmapObjectData.beatmapObjectType != BeatmapObjectType.Obstacle) { continue; } copyWithoutBeatmapObjects.AddBeatmapObjectData(beatmapObjectData.GetCopy()); } __result = copyWithoutBeatmapObjects; return(false); }
internal BeatSaver_DifficultyBeatmap(BeatSaver_DifficultyBeatmapSet p_Parent, BeatSaver_CustomBeatmapLevel p_BSBeatmapLevel, BeatmapCharacteristicSO p_CharacteristicSO, BeatmapDifficulty p_Difficulty, BeatmapCharacteristicDifficulty p_CharacteristicDifficulty) { level = p_BSBeatmapLevel; parentDifficultyBeatmapSet = p_Parent; difficulty = p_Difficulty; noteJumpMovementSpeed = p_CharacteristicDifficulty.NoteJumpSpeed; noteJumpStartBeatOffset = p_CharacteristicDifficulty.NoteJumpSpeedOffset; beatmapData = new BeatmapData(4); /// From DefaultRating switch (p_Difficulty) { case BeatmapDifficulty.Easy: difficultyRank = 1; break; case BeatmapDifficulty.Normal: difficultyRank = 3; break; case BeatmapDifficulty.Hard: difficultyRank = 5; break; case BeatmapDifficulty.Expert: difficultyRank = 7; break; case BeatmapDifficulty.ExpertPlus: difficultyRank = 9; break; } for (int l_I = 0; l_I < p_CharacteristicDifficulty.Notes; ++l_I) { beatmapData.AddBeatmapObjectData(NoteData.CreateBasicNoteData(0f, 0, NoteLineLayer.Base, ColorType.ColorA, NoteCutDirection.Any)); } }
public void UpdateBeatmap(List <BeatmapObjectData> newObjects, bool addLists = false) { BeatmapData newBeatmapData = (callbackController.GetField <IReadonlyBeatmapData, BeatmapCallbacksController>("_beatmapData") as BeatmapData); var beatmapDataItemsPerType = newBeatmapData.GetField <BeatmapDataSortedListForTypes <BeatmapDataItem>, BeatmapData>("_beatmapDataItemsPerType"); if (addLists) { beatmapDataItemsPerType.AddList <GameNote>(new SortedList <GameNote, BeatmapDataItem>(null)); beatmapDataItemsPerType.AddList <GameObstacle>(new SortedList <GameObstacle, BeatmapDataItem>(null)); } foreach (var newObject in newObjects) { newBeatmapData.AddBeatmapObjectData(newObject); } }
private static bool Prefix(IReadonlyBeatmapData beatmapData, ref IReadonlyBeatmapData __result) { if (Settings.ChromaConfig.Instance.ForceZenWallsEnabled) { BeatmapData copyWithoutBeatmapObjects = beatmapData.GetCopyWithoutBeatmapObjects(); BeatmapData.CopyBeatmapObjectsWaypointsOnly(beatmapData, copyWithoutBeatmapObjects); foreach (BeatmapObjectData beatmapObjectData in beatmapData.beatmapObjectsData) { if (beatmapObjectData is ObstacleData) { copyWithoutBeatmapObjects.AddBeatmapObjectData(beatmapObjectData.GetCopy()); } } __result = copyWithoutBeatmapObjects; return(false); } return(true); }