2023-07-08 23:42:42 +03:00
|
|
|
using Aki.Reflection.Patching;
|
|
|
|
using BepInEx;
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
namespace IcyClawz.MagazineInspector
|
|
|
|
{
|
2023-10-09 03:21:08 +03:00
|
|
|
[BepInPlugin("com.IcyClawz.MagazineInspector", "IcyClawz.MagazineInspector", "1.2.0")]
|
2023-07-08 23:42:42 +03:00
|
|
|
public class Plugin : BaseUnityPlugin
|
|
|
|
{
|
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
new MagazinePatch().Enable();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-09 22:38:08 +03:00
|
|
|
internal class MagazinePatch : ModulePatch
|
2023-07-08 23:42:42 +03:00
|
|
|
{
|
|
|
|
protected override MethodBase GetTargetMethod() =>
|
|
|
|
typeof(MagazineClass).GetConstructors()[0];
|
|
|
|
|
|
|
|
[PatchPostfix]
|
|
|
|
private static void PatchPostfix(ref MagazineClass __instance)
|
|
|
|
{
|
|
|
|
__instance.AddAmmoCountAttribute();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|