Skip to content

Commit

Permalink
Updated for 1.34.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Reezonate committed Dec 6, 2023
1 parent 80a8930 commit 99bc68d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 125 deletions.
3 changes: 1 addition & 2 deletions Source/0_Harmony/InstallersPatches/AppInstallerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ public static class AppInstallerPatch {
[UsedImplicitly]
// ReSharper disable once InconsistentNaming
private static void Postfix(PCAppInit __instance) {
var container = __instance.GetContainer();
OnAppInstaller.Install(container);
OnAppInstaller.Install(__instance.Container);
}
}
}
3 changes: 1 addition & 2 deletions Source/0_Harmony/InstallersPatches/MenuInstallerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ public static class MenuInstallerPatch {
[UsedImplicitly]
// ReSharper disable once InconsistentNaming
private static void Postfix(MainSettingsMenuViewControllersInstaller __instance) {
var container = __instance.GetContainer();
OnMenuInstaller.Install(container);
OnMenuInstaller.Install(__instance.Container);
}
}
}
25 changes: 5 additions & 20 deletions Source/0_Harmony/PermanentPatches/AppInstallerPermanentPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,17 @@

namespace EasyOffset {
public static class AppInstallerPermanentPatch {
#region ApplyPatch

private static MethodInfo OriginalMethodInfo => typeof(PCAppInit).GetMethod("InstallBindings");
private static MethodInfo PostfixMethodInfo => typeof(AppInstallerPermanentPatch).GetMethod("Postfix", BindingFlags.Static | BindingFlags.NonPublic);

public static void ApplyPatch(Harmony harmony) {
harmony.Patch(OriginalMethodInfo, null, new HarmonyMethod(PostfixMethodInfo));
var originalMethodInfo = typeof(PCAppInit).GetMethod("InstallBindings");
var postfixMethodInfo = typeof(AppInstallerPermanentPatch).GetMethod(nameof(Postfix), BindingFlags.Static | BindingFlags.NonPublic);
harmony.Patch(originalMethodInfo, null, new HarmonyMethod(postfixMethodInfo));
}

#endregion

#region Postfix

private static readonly FieldInfo MainSettingsFieldInfo = typeof(PCAppInit).GetField(
"_mainSettingsModel",
BindingFlags.Instance | BindingFlags.NonPublic
);

[UsedImplicitly]
// ReSharper disable once InconsistentNaming
private static void Postfix(PCAppInit __instance) {
var container = __instance.GetContainer();
PluginConfig.VRPlatformHelper = container.TryResolve<IVRPlatformHelper>();
PluginConfig.MainSettingsModel = (MainSettingsModelSO) MainSettingsFieldInfo.GetValue(__instance);
PluginConfig.VRPlatformHelper = __instance.Container.TryResolve<IVRPlatformHelper>();
PluginConfig.MainSettingsModel = __instance._mainSystemInit._mainSettingsModel;
}

#endregion
}
}
15 changes: 3 additions & 12 deletions Source/0_Harmony/PermanentPatches/MenuInstallerPermanentPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@

namespace EasyOffset {
public static class MenuInstallerPermanentPatch {
#region ApplyPatch

private static MethodInfo OriginalMethodInfo => typeof(MainSettingsMenuViewControllersInstaller).GetMethod("InstallBindings");
private static MethodInfo PostfixMethodInfo => typeof(MenuInstallerPermanentPatch).GetMethod("Postfix", BindingFlags.Static | BindingFlags.NonPublic);

public static void ApplyPatch(Harmony harmony) {
harmony.Patch(OriginalMethodInfo, null, new HarmonyMethod(PostfixMethodInfo));
var originalMethodInfo = typeof(MainSettingsMenuViewControllersInstaller).GetMethod("InstallBindings");
var postfixMethodInfo = typeof(MenuInstallerPermanentPatch).GetMethod(nameof(Postfix), BindingFlags.Static | BindingFlags.NonPublic);
harmony.Patch(originalMethodInfo, null, new HarmonyMethod(postfixMethodInfo));
}

#endregion

#region Postfix

[UsedImplicitly]
private static void Postfix() {
Plugin.InitializeUI();
}

#endregion
}
}
66 changes: 0 additions & 66 deletions Source/0_Harmony/UIPatches/ModMenuOrderPatch.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ internal class VRControllerUpdatePatch {
private static readonly Vector3 DefaultRightPosition = new Vector3(0.2f, 0.05f, 0.0f);

[UsedImplicitly]
// ReSharper disable InconsistentNaming
private static bool Prefix(
VRController __instance,
IVRPlatformHelper ____vrPlatformHelper,
ref Vector3 ____lastTrackedPosition,
ref Quaternion ____lastTrackedRotation
) {
if (PluginConfig.IsDeviceless && !PluginConfig.EnabledForDeviceless) return true;

if (____vrPlatformHelper.GetNodePose(__instance.node, __instance.nodeIdx, out var pos, out var rot)) {
____lastTrackedPosition = pos;
____lastTrackedRotation = rot;
Expand Down
19 changes: 0 additions & 19 deletions Source/7_Utils/StaticUtils/InstallerUtils.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Source/EasyOffset.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<Reference Include="HMUI">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\HMUI.dll</HintPath>
</Reference>
<Reference Include="Zenject">
<Reference Include="Zenject" publicize="true">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Zenject.dll</HintPath>
</Reference>
<Reference Include="Zenject-usage">
Expand Down
4 changes: 2 additions & 2 deletions Source/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"id": "EasyOffset",
"name": "EasyOffset",
"author": "Reezonate",
"version": "2.1.6",
"version": "2.1.7",
"description": "Easy controller offset adjustment tool",
"gameVersion": "1.33.0",
"gameVersion": "1.34.0",
"dependsOn": {
"BSIPA": "^4.3.0",
"BeatSaberMarkupLanguage": "^1.7.6",
Expand Down

0 comments on commit 99bc68d

Please sign in to comment.