diff --git a/PIRM.csproj b/MIR.csproj
similarity index 97%
rename from PIRM.csproj
rename to MIR.csproj
index cfa2254..ab8df29 100644
--- a/PIRM.csproj
+++ b/MIR.csproj
@@ -7,8 +7,8 @@
{A4E590D6-3C04-419D-A00D-B0A7E6C9BD7D}
Library
Properties
- dvize.PIRM
- dvize.PIRM
+ dvize.MIR
+ dvize.MIR
v4.7.1
512
true
@@ -109,8 +109,8 @@
-
-
+
+
diff --git a/PIRMPatcher.cs b/MIRPatcher.cs
similarity index 69%
rename from PIRMPatcher.cs
rename to MIRPatcher.cs
index 200f96d..4e2d5c6 100644
--- a/PIRMPatcher.cs
+++ b/MIRPatcher.cs
@@ -9,23 +9,23 @@
using EFT.UI.DragAndDrop;
using HarmonyLib;
-namespace PIRM
+namespace MIR
{
- public class PIRMMethod17Patch : ModulePatch
+ public class MIRMethod21Patch : ModulePatch
{
- protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(ItemSpecificationPanel), "method_17");
+ protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(ItemSpecificationPanel), "method_21");
[PatchPrefix]
- public static bool PatchPrefix(ref KeyValuePair __result, Slot slot)
+ public static bool PatchPrefix(ref KeyValuePair __result, Slot slot)
{
string itemName = slot.ContainedItem != null ? slot.ContainedItem.Name.Localized() : string.Empty;
- ModSlotView.GStruct398 structValue = new ModSlotView.GStruct398
+ ModSlotView.GStruct430 structValue = new ModSlotView.GStruct430
{
ItemName = itemName,
Error = string.Empty
};
- __result = new KeyValuePair(EModLockedState.Unlocked, structValue);
+ __result = new KeyValuePair(EModLockedState.Unlocked, structValue);
return false;
}
@@ -36,14 +36,13 @@ public class InteractionsHandlerPatch : ModulePatch
protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(InteractionsHandlerClass), "smethod_1");
[PatchPrefix]
- public static bool Prefix(Item item, ItemAddress to, TraderControllerClass itemController, ref GStruct416 __result)
+ public static bool Prefix(Item item, ItemAddress to, TraderControllerClass itemController, ref GStruct448 __result)
{
- if (GClass1864.InRaid)
+ if (GClass2064.InRaid)
{
- __result = GClass3372._;
+ __result = GClass3759._;
return false;
}
-
return true;
}
}
@@ -53,12 +52,11 @@ public class ItemCheckAction : ModulePatch
protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(EFT.InventoryLogic.Item), "CheckAction");
[PatchPrefix]
- public static bool Prefix(ItemAddress location, ref bool __result)
+ public static GStruct447 Prefix(ItemAddress location, ref GStruct447 __result, Item __instance)
{
- __result = true;
- return false;
+ __result = default(GStruct447);
+ return new InteractionsHandlerClass.GClass3736(null);
}
-
}
@@ -68,7 +66,7 @@ public class EFTInventoryLogicModPatch : ModulePatch
protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(EFT.InventoryLogic.Mod), "CanBeMoved");
[PatchPrefix]
- public static bool Prefix(IContainer toContainer, ref GStruct416 __result)
+ public static bool Prefix(IContainer toContainer, ref GStruct448 __result)
{
__result = true;
return false;
@@ -76,7 +74,7 @@ public static bool Prefix(IContainer toContainer, ref GStruct416 __result)
}
public class CanAcceptRaidPatch : ModulePatch
{
- protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(GClass2525), (nameof(GClass2525.CanAcceptRaid)));
+ protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(GClass2862), (nameof(GClass2862.CanAcceptRaid)));
[PatchPostfix]
public static void Postfix(ref bool __result, ref InventoryError error)
@@ -86,18 +84,17 @@ public static void Postfix(ref bool __result, ref InventoryError error)
}
}
-
//Gets rid of the compatibility check (even when ui highlights the slot as incompatible)
- public class SlotMethod4Patch : ModulePatch
+ public class SlotMethod5Patch : ModulePatch
{
- protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(Slot), (nameof(Slot.method_4)));
+ protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(EFT.InventoryLogic.Slot), (nameof(Slot.method_5)));
[PatchPrefix]
- public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunction, ref GStruct416 __result, Slot __instance)
+ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunction, ref GStruct448 __result, Slot __instance)
{
if (__instance.ContainedItem != null)
{
- __result = new Slot.GClass3339(item, __instance);
+ __result = new Slot.GClass3722(item, __instance);
return false;
}
if (ignoreRestrictions)
@@ -107,7 +104,7 @@ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunc
}
if (__instance.Locked)
{
- __result = new Slot.GClass3332(__instance);
+ __result = new Slot.GClass3715(__instance);
return false;
}
InventoryError inventoryError;
@@ -116,17 +113,17 @@ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunc
__result = inventoryError;
return false;
}
- if (!__instance.Examined(item) && !(item is BulletClass))
+ if (!__instance.method_2(item) && !(item is AmmoItemClass))
{
- __result = new Slot.GClass3336(item, __instance);
+ __result = new Slot.GClass3719(item, __instance);
return false;
}
if (__instance.BlockerSlots.Count > 0)
{
- __result = new Slot.GClass3333(item, __instance);
+ __result = new Slot.GClass3716(item, __instance);
return false;
}
- GStruct416 gstruct = __instance.method_3(item);
+ GStruct448 gstruct = __instance.method_4(item);
if (gstruct.Failed)
{
__result = gstruct.Error;
@@ -134,19 +131,19 @@ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunc
}
if (item.IsSpecialSlotOnly && !__instance.IsSpecial)
{
- __result = new Slot.GClass3340(item, __instance);
+ __result = new Slot.GClass3723(item, __instance);
return false;
}
if (__instance.ConflictingSlots != null)
{
- using (IEnumerator enumerator = __instance.method_2(item).GetEnumerator())
+ using (IEnumerator enumerator = __instance.method_3(item).GetEnumerator())
{
while (enumerator.MoveNext())
{
Slot slot = enumerator.Current;
if (slot.ContainedItem != null)
{
- __result = new Slot.GClass3334(item, __instance, slot);
+ __result = new Slot.GClass3717(item, __instance, slot);
return false;
}
}
@@ -163,7 +160,7 @@ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunc
{
if (!__instance.CheckCompatibility(item))
{
- __result = new Slot.GClass3340(item, __instance);
+ __result = new Slot.GClass3723(item, __instance);
return false;
}
}
@@ -192,7 +189,7 @@ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunc
{
if (!__instance.CheckCompatibility(item))
{
- __result = new Slot.GClass3340(item, __instance);
+ __result = new Slot.GClass3723(item, __instance);
return false;
}
}
@@ -202,16 +199,16 @@ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunc
Weapon weapon;
if (!ignoreMalfunction && (weapon = __instance.ParentItem.GetRootItem() as Weapon) != null && weapon.IncompatibleByMalfunction(item))
{
- __result = new InteractionsHandlerClass.GClass3352(item, weapon);
+ __result = new InteractionsHandlerClass.GClass3734(item, weapon);
return false;
}
Weapon weapon2;
- if ((weapon2 = item as Weapon) != null && __instance.Id != "BuildSlot")
+ if ((weapon2 = item as Weapon) != null && __instance.ID != "BuildSlot")
{
List list = weapon2.MissingVitalParts.ToList();
if (list.Any())
{
- __result = new Slot.GClass3338(weapon2, __instance, list);
+ __result = new Slot.GClass3721(weapon2, __instance, list);
return false;
}
}
@@ -219,65 +216,48 @@ public static bool Prefix(Item item, bool ignoreRestrictions, bool ignoreMalfunc
return false;
}
}
+
public class IsModSuitablePatch : ModulePatch
{
protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(ArmorHolderComponent), (nameof(ArmorHolderComponent.IsModSuitable)));
[PatchPrefix]
- public static bool Prefix(Item item, ArmorHolderComponent __instance, ref bool __result, LootItemClass ___lootItemClass)
+ public static bool Prefix(Item item, ArmorHolderComponent __instance, ref bool __result, CompoundItem ___compoundItem_0)
{
- //if armormod and PIRMPlugin.AllowSwapAnyArmorPlate is true then assume its suitable
- if (item.IsArmorMod() && PIRMPlugin.AllowSwapAnyArmorPlate.Value)
+ //if armormod and MIRPlugin.AllowSwapAnyArmorPlate is true then assume its suitable
+ if (item.IsArmorMod() && MIRPlugin.AllowSwapAnyArmorPlate.Value)
{
__result = true;
return false;
}
-
+
//return true to check the original logic
return true;
}
-
}
-
public class SlotRemoveItemPatch : ModulePatch
{
- protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(Slot), nameof(Slot.RemoveItem));
-
- [PatchPrefix]
- public static bool Prefix(ref GStruct416 __result, Slot __instance)
+ protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(EFT.InventoryLogic.Slot), "RemoveItemInternal");
+ private static bool Prefix(ref Slot __instance, ref GStruct446 __result, bool simulate, bool ignoreRestrictions)
{
- //display parent of item for logging purposes
- /* if (__instance.ContainedItem != null)
- {
- UnityEngine.Debug.LogWarning($"Parent of item: {__instance.ContainedItem.Parent}");
- }*/
-
- //Seems if its unlocked then we can't restore the default when toggled. decided not to use dictionary to restore since slots for every item? too much shit
- if (PIRMPlugin.AllowSwapAnyArmorPlate.Value)
- {
- if (__instance.Locked)
- {
- __instance.Locked = false;
- }
- }
-
- return true;
+ return true;
}
}
+
public class LootItemApplyPatch : ModulePatch
{
- protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(LootItemClass), "Apply");
+ protected override MethodBase GetTargetMethod() => AccessTools.Method(typeof(CompoundItem), "Apply");
[PatchPrefix]
- private static bool Prefix(ref LootItemClass __instance, ref GStruct413 __result, TraderControllerClass itemController, Item item, int count, bool simulate)
+ private static bool Prefix(ref CompoundItem __instance, ref GStruct445 __result, TraderControllerClass itemController, Item item, int count, bool simulate) /// GStruct425 >> GStruct445
{
if (!item.ParentRecursiveCheck(__instance))
{
- __result = new GClass3324(item, __instance);
+ __result = new GClass3701(item, __instance);
return false;
}
- //bool inRaid = GClass1849.InRaid;
+ //bool inRaid = GClass1849.InRaid; /// GClass1849 >> GClass2064
bool inRaid = false;
Error error = null;
@@ -285,11 +265,11 @@ private static bool Prefix(ref LootItemClass __instance, ref GStruct413 __result
Mod mod = item as Mod;
Slot[] array = ((mod != null && inRaid) ? __instance.VitalParts.ToArray() : null);
- Slot.GClass3338 gclass;
+ Slot.GClass3721 gclass;
if (inRaid && mod != null && !mod.RaidModdable)
{
- error2 = new GClass3321(mod);
+ error2 = new GClass3698(mod);
}
else if (!InteractionsHandlerClass.CheckMissingParts(mod, __instance.CurrentAddress, itemController, out gclass))
{
@@ -303,34 +283,34 @@ private static bool Prefix(ref LootItemClass __instance, ref GStruct413 __result
{
if (error2 != null)
{
- Slot.GClass3338 gclass2;
- if ((gclass2 = error2 as Slot.GClass3338) != null)
+ Slot.GClass3721 gclass2;
+ if ((gclass2 = error2 as Slot.GClass3721) != null)
{
- error2 = new Slot.GClass3338(gclass2.Item, slot, gclass2.MissingParts);
+ error2 = new Slot.GClass3721(gclass2.Item, slot, gclass2.MissingParts);
}
flag = true;
}
else if (array != null && array.Contains(slot))
{
- error = new GClass3322(mod);
+ error = new GClass3699(mod);
}
else
{
- GClass2783 gclass3 = new GClass2783(slot);
- GStruct414 gstruct = InteractionsHandlerClass.Move(item, gclass3, itemController, simulate);
+ ItemAddress to = slot.CreateItemAddress();
+ GStruct446 gstruct = InteractionsHandlerClass.Move(item, to, itemController, simulate);
if (gstruct.Succeeded)
{
__result = gstruct;
return false;
}
- GStruct414 gstruct2 = InteractionsHandlerClass.SplitMax(item, int.MaxValue, gclass3, itemController, itemController, simulate);
+ GStruct446 gstruct2 = InteractionsHandlerClass.SplitMax(item, int.MaxValue, to, itemController, itemController, simulate);
if (gstruct2.Succeeded)
{
__result = gstruct2;
return false;
}
error = gstruct.Error;
- if (!GClass748.DisabledForNow && GClass2791.CanSwap(item, slot))
+ if (!GClass810.DisabledForNow && GClass3117.CanSwap(item, slot))
{
__result = null;
return false;
@@ -342,37 +322,23 @@ private static bool Prefix(ref LootItemClass __instance, ref GStruct413 __result
{
error2 = null;
}
- GStruct414 gstruct3 = InteractionsHandlerClass.QuickFindAppropriatePlace(item, itemController, __instance.ToEnumerable(), InteractionsHandlerClass.EMoveItemOrder.Apply, simulate);
+ GStruct446 gstruct3 = InteractionsHandlerClass.QuickFindAppropriatePlace(item, itemController, __instance.ToEnumerable(), InteractionsHandlerClass.EMoveItemOrder.Apply, simulate);
if (gstruct3.Succeeded)
{
__result = gstruct3;
return false;
}
- if (!(gstruct3.Error is GClass3317))
+ if (!(gstruct3.Error is GClass3601))
{
error = gstruct3.Error;
}
Error error3;
if ((error3 = error2) == null)
{
- error3 = error ?? new GClass3324(item, __instance);
+ error3 = error ?? new GClass3701(item, __instance);
}
__result = error3;
return false;
}
-
}
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
+}
\ No newline at end of file
diff --git a/PIRMPlugin.cs b/MIRPlugin.cs
similarity index 71%
rename from PIRMPlugin.cs
rename to MIRPlugin.cs
index 8ca3cbd..b88ab9c 100644
--- a/PIRMPlugin.cs
+++ b/MIRPlugin.cs
@@ -2,12 +2,12 @@
using BepInEx;
using BepInEx.Configuration;
-namespace PIRM
+namespace MIR
{
- [BepInPlugin("com.dvize.PIRM", "dvize.PIRM", "2.0.1")]
+ [BepInPlugin("com.dvize.MIR", "dvize.MIR", "3.0.0")]
//[BepInDependency("com.spt-aki.core", "3.7.4")]
- class PIRMPlugin : BaseUnityPlugin
+ class MIRPlugin : BaseUnityPlugin
{
internal static ConfigEntry AllowSwapAnyArmorPlate
{
@@ -15,21 +15,21 @@ internal static ConfigEntry AllowSwapAnyArmorPlate
}
private void Awake()
{
- AllowSwapAnyArmorPlate = Config.Bind("1. Main Settings", "AllowSwapAnyArmorPlate", false,
- new ConfigDescription("Allows swapping different types of armor plates in eachothers slots", null,
+ AllowSwapAnyArmorPlate = Config.Bind("1. Main Settings", "AllowSwapAnyArmorPlate", false,
+ new ConfigDescription("Allows swapping different types of armor plates in eachothers slots", null,
new ConfigurationManagerAttributes { IsAdvanced = false, Order = 1 }));
}
private void Start()
{
- new PIRMMethod17Patch().Enable();
+ new MIRMethod21Patch().Enable();
new InteractionsHandlerPatch().Enable();
- new ItemCheckAction().Enable();
+ /// new ItemCheckAction().Enable();
new EFTInventoryLogicModPatch().Enable();
new LootItemApplyPatch().Enable();
new SlotRemoveItemPatch().Enable();
new CanAcceptRaidPatch().Enable();
- new SlotMethod4Patch().Enable();
+ new SlotMethod5Patch().Enable();
new IsModSuitablePatch().Enable();
}
diff --git a/PIRM.sln b/PIRM.sln
index b756db5..602c416 100644
--- a/PIRM.sln
+++ b/PIRM.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32630.192
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PIRM", "PIRM.csproj", "{A4E590D6-3C04-419D-A00D-B0A7E6C9BD7D}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MIR", "MIR.csproj", "{A4E590D6-3C04-419D-A00D-B0A7E6C9BD7D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
index 14ab43c..a059ce0 100644
--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -1,13 +1,13 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("dvize.PIRM")]
+[assembly: AssemblyTitle("dvize.MIR")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("dvize.PIRM")]
-[assembly: AssemblyCopyright("Copyright © 2024")]
+[assembly: AssemblyProduct("dvize.MIR")]
+[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]