feat: added inventory patch, in-raid and stash
This commit is contained in:
23
Plugin/Patches/Screens/InventoryScreenPatch.cs
Normal file
23
Plugin/Patches/Screens/InventoryScreenPatch.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Reflection;
|
||||
using EFT;
|
||||
using EFT.HealthSystem;
|
||||
using EFT.UI;
|
||||
using LootValueEX.Extensions;
|
||||
using SPT.Reflection.Patching;
|
||||
|
||||
namespace LootValueEX.Patches.Screens
|
||||
{
|
||||
internal class InventoryScreenPatch : ModulePatch
|
||||
{
|
||||
protected override MethodBase GetTargetMethod() => typeof(InventoryScreen).GetMethods().SingleOrDefault(method => method.Name == "Show" && method.GetParameters()[0].ParameterType == typeof(IHealthController));
|
||||
|
||||
[PatchPostfix]
|
||||
private static void PatchPostfix(ref Profile ___profile_0, ref LootItemClass ___lootItemClass)
|
||||
{
|
||||
___profile_0.Inventory.GetPlayerItems(EFT.InventoryLogic.EPlayerItems.Equipment).ExecuteForEach(item => Plugin.Log.LogDebug($"{item.LocalizedName()} ({item.TemplateId}): {item.GetCustomHash()}"));
|
||||
|
||||
if(___lootItemClass != null)
|
||||
___lootItemClass.GetAllItems().ExecuteForEach(item => Plugin.Log.LogDebug($"{item.LocalizedName()} ({item.TemplateId}): {item.GetCustomHash()}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user