prettier code (me if i was code)

This commit is contained in:
Lea 2024-05-20 16:10:13 +02:00
parent 03bdf4a1e0
commit 73c65893e8
Signed by: Lea
GPG key ID: 1BAFFE8347019C42
4 changed files with 23 additions and 13 deletions

View file

@ -18,6 +18,9 @@
<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
<Reference Include="UnityEngine.CoreModule">
<HintPath>./BepInEx/interop/UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>./BepInEx/interop/Assembly-CSharp.dll</HintPath>
</Reference>

View file

@ -1,12 +0,0 @@
using HarmonyLib;
namespace MetalButtplug.Patches;
[HarmonyPatch(typeof(BeatSequencer), nameof(BeatSequencer.UpdateBeat))]
internal class TestPatch {
private static void Prefix(BeatStatusProvider beatStatus) {
if (beatStatus.BeatFlags.HasFlag(BeatFlags.Quarter)) {
Plugin.Log.LogInfo("Quarter beat");
}
}
}

19
Patches/UpdateBeat.cs Normal file
View file

@ -0,0 +1,19 @@
using HarmonyLib;
namespace MetalButtplug.Patches;
[HarmonyPatch(typeof(BeatSequencer), nameof(BeatSequencer.UpdateBeat))]
internal class UpdateBeatPatch {
private static void Prefix(BeatStatusProvider beatStatus) {
if (beatStatus.BeatFlags.HasFlag(BeatFlags.Quarter)) {
var playerController = UnityEngine.Object.FindObjectOfType<FirstPersonController>();
var player = playerController.m_player;
var controller = player.ScoreController;
Plugin.Log.LogInfo(
$"Quarter beat, multiplier: {controller.GetCurrentTierIndex()}/{controller.GetNumTiers()} ({1 << controller.GetCurrentTierIndex()}x)"
);
}
}
}

View file

@ -14,6 +14,6 @@ public class Plugin : BasePlugin {
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
Log.LogInfo("GAY SEX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
harmony.PatchAll(typeof(Patches.TestPatch));
harmony.PatchAll(typeof(Patches.UpdateBeatPatch));
}
}