managed to actually inject something woooo

This commit is contained in:
Lea 2024-05-20 14:19:06 +02:00
parent 14deee32ce
commit f803f865f2
Signed by: Lea
GPG key ID: 1BAFFE8347019C42
3 changed files with 20 additions and 1 deletions

View file

@ -12,6 +12,7 @@
https://nuget.bepinex.dev/v3/index.json
</RestoreAdditionalProjectSources>
<RootNamespace>MetalButtplug</RootNamespace>
<NoWarn>$(NoWarn);NU1603</NoWarn>
</PropertyGroup>
<ItemGroup>

13
Patches/TestPatch.cs Normal file
View file

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

View file

@ -1,4 +1,5 @@
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
@ -6,9 +7,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 startup logic
Plugin.Log = base.Log;
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
Log.LogInfo("GAY SEX!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
harmony.PatchAll(typeof(Patches.TestPatch));
}
}