diff --git a/FodyWeavers.xml b/FodyWeavers.xml index 5580b93..683cfc2 100644 --- a/FodyWeavers.xml +++ b/FodyWeavers.xml @@ -1,12 +1,12 @@ - - - System.* - deniszykov.WebSocketListener - Buttplug - Buttplug.Client.Connectors.WebsocketConnector + + + System.* + deniszykov.WebSocketListener + Buttplug + Buttplug.Client.Connectors.WebsocketConnector Newtonsoft.Json - - + + \ No newline at end of file diff --git a/Patches/UpdateBeat.cs b/Patches/UpdateBeat.cs index 56a7082..4f1eaa4 100644 --- a/Patches/UpdateBeat.cs +++ b/Patches/UpdateBeat.cs @@ -15,7 +15,8 @@ internal class UpdateBeatPatch { $"Quarter beat, multiplier: {controller.GetCurrentTierIndex()}/{controller.GetNumTiers()-1} ({1 << controller.GetCurrentTierIndex()}x)" ); - ButtplugManager.Vibrate((float)controller.GetCurrentTierIndex() / ((float)controller.GetNumTiers() - 1), 100); + var scoreMultiplier = (float)controller.GetCurrentTierIndex() / ((float)controller.GetNumTiers() - 1); + ButtplugManager.Vibrate(scoreMultiplier, 100); } } diff --git a/Plugin.cs b/Plugin.cs index 4205e71..c357ab9 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -1,4 +1,5 @@ -using BepInEx; +using System.Reflection; +using BepInEx; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; @@ -8,14 +9,13 @@ namespace MetalButtplug; [BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)] public class Plugin : BasePlugin { - Harmony harmony = new Harmony(MyPluginInfo.PLUGIN_GUID); internal static new ManualLogSource Log; public override void Load() { Plugin.Log = base.Log; Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!"); - harmony.PatchAll(typeof(Patches.UpdateBeatPatch)); + Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); Log.LogInfo("Applied patches"); ButtplugManager.Init();