Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions NFMFix/NoteMovementFix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.DotnetExtension.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BGLib.AppFlow, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.AppFlow.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BGLib.UnityExtension, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.UnityExtension.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="DataModels, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Private>False</Private>
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll</HintPath>
Expand Down
37 changes: 29 additions & 8 deletions NFMFix/Patches/Yeet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ internal class DisableFloorMovement
{
static bool Prefix(ref NoteFloorMovement __instance, ref Vector3 __result)
{
if (!Plugin.AllowedToPatch)
{
return true;
}

// Skip floor movement if disabled
if (Config.Instance.Enabled && !Plugin.InReplay && Config.Instance.HiddenFloorMovement)
{
Expand Down Expand Up @@ -40,6 +45,11 @@ static bool Prefix(ref NoteJump __instance, ref Vector3 __result, ref Action ___
ref Action ___noteJumpDidPassMissedMarkerEvent, ref Action<NoteJump> ___noteJumpDidPassThreeQuartersEvent, ref Action ___noteJumpDidPassHalfEvent,
ref Action<float> ___noteJumpDidUpdateProgressEvent)
{
if (!Plugin.AllowedToPatch)
{
return true;
}

if (Config.Instance.Enabled && !Plugin.InReplay)
{
if (!__instance._missedMarkReported)
Expand Down Expand Up @@ -233,6 +243,11 @@ internal class FakeGhostMode
{
static void Prefix(ref NoteFloorMovement __instance)
{
if (!Plugin.AllowedToPatch)
{
return;
}

if (Config.Instance.Enabled && Config.Instance.FakeGhostMode && Config.Instance.FakeGhostNote)
{
var p = __instance._rotatedObject.parent;
Expand All @@ -244,18 +259,24 @@ static void Prefix(ref NoteFloorMovement __instance)
}
}

[HarmonyPatch(typeof(GameplayCoreInstaller), nameof(GameplayCoreInstaller.InstallBindings))]
static class DisableNE
[HarmonyPatch]
internal static class DisableNE
{
static void Postfix(ref GameplayCoreInstaller __instance)
[HarmonyPatch(typeof(LevelScenesTransitionSetupDataSO),
nameof(LevelScenesTransitionSetupDataSO.BeforeScenesWillBeActivated))]
[HarmonyPatch(typeof(LevelScenesTransitionSetupDataSO),
nameof(LevelScenesTransitionSetupDataSO.BeforeScenesWillBeActivatedAsync))]
[HarmonyPostfix]
private static void LevelScenesTransitionSetupDataSO_BeforeScenesWillBeActivated(LevelScenesTransitionSetupDataSO __instance)
{
var key = (BeatmapKey)__instance._sceneSetupData?.beatmapKey;
BeatmapKey? key = __instance.gameplayCoreSceneSetupData?.beatmapKey;
if (key != null)
{
var hasRequirement = SongCore.Collections.GetCustomLevelSongDifficultyData(key)?
.additionalDifficultyData?
._requirements?.Any(x => x == "Noodle Extensions" || x == "Mapping Extensions") == true;
if (hasRequirement) Config.Instance.Enabled = false;
bool hasRequirement = SongCore.Collections.GetCustomLevelSongDifficultyData(key.Value)?
.additionalDifficultyData
._requirements.Any(x => x == "Noodle Extensions" || x == "Mapping Extensions") == true;

Plugin.AllowedToPatch = !hasRequirement;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions NFMFix/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Plugin
internal static Harmony harmony;
internal static bool InReplay = false;
internal static bool Submission = true;
internal static bool AllowedToPatch = true;

static class BsmlWrapper
{
Expand Down