Reload in-place for fika
This commit is contained in:
@@ -103,6 +103,12 @@ public static class ReloadInPlacePatches
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
if (Plugin.FikaPresent())
|
||||
{
|
||||
Type type = Type.GetType("Fika.Core.Coop.ClientClasses.CoopClientFirearmController, Fika.Core");
|
||||
return AccessTools.Method(type, "ReloadMag");
|
||||
}
|
||||
|
||||
return AccessTools.Method(typeof(Player.FirearmController), nameof(Player.FirearmController.ReloadMag));
|
||||
}
|
||||
|
||||
|
||||
14
Plugin.cs
14
Plugin.cs
@@ -1,10 +1,12 @@
|
||||
using BepInEx;
|
||||
using BepInEx.Bootstrap;
|
||||
using Comfort.Common;
|
||||
using EFT;
|
||||
|
||||
namespace UIFixes;
|
||||
|
||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||
[BepInDependency("com.fika.core", BepInDependency.DependencyFlags.SoftDependency)]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
public void Awake()
|
||||
@@ -76,4 +78,16 @@ public class Plugin : BaseUnityPlugin
|
||||
bool? inRaid = Singleton<AbstractGame>.Instance?.InRaid;
|
||||
return inRaid.HasValue && inRaid.Value;
|
||||
}
|
||||
|
||||
private static bool? IsFikaPresent;
|
||||
|
||||
public static bool FikaPresent()
|
||||
{
|
||||
if (!IsFikaPresent.HasValue)
|
||||
{
|
||||
IsFikaPresent = Chainloader.PluginInfos.ContainsKey("com.fika.core");
|
||||
}
|
||||
|
||||
return IsFikaPresent.Value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user