feat: added inventory patch, in-raid and stash
This commit is contained in:
parent
ac5140ce24
commit
fa0821686b
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()}"));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using SPT.Reflection.Patching;
|
|||
using SPT.Reflection.Utils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
/// <summary>
|
||||
/// This patch will affect the following screens: Stash, Weapon Preset Builder, Character Gear, Character Preset Selector, New Ragfair Offer, Message Items, Loot
|
|
@ -5,7 +5,7 @@ using SPT.Reflection.Patching;
|
|||
using SPT.Reflection.Utils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
/// <summary>
|
||||
/// This patch will affect the following screens: Stash, Weapon Preset Builder, Character Gear, Character Preset Selector, New Ragfair Offer, Message Items, Loot
|
||||
|
@ -14,7 +14,7 @@ namespace LootValueEX.Patches
|
|||
{
|
||||
protected override MethodBase GetTargetMethod() => typeof(GridItemView).GetMethod("ShowTooltip", BindingFlags.Instance | BindingFlags.Public);
|
||||
internal static bool PatchTooltip { get; private set; } = false;
|
||||
internal static EFT.InventoryLogic.Item? HoveredItem { get; private set; }
|
||||
internal static Item? HoveredItem { get; private set; }
|
||||
|
||||
[PatchPrefix]
|
||||
static void EnableTooltipPatch(GridItemView __instance)
|
|
@ -7,7 +7,7 @@ using System.Reflection;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
internal class HandbookPatching : ModulePatch
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
using SPT.Reflection.Patching;
|
||||
using System.Reflection;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
class InsuranceGridPatch : ModulePatch
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
using SPT.Reflection.Patching;
|
||||
using System.Reflection;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
class InsuranceSlotPatch : ModulePatch
|
||||
{
|
|
@ -1,11 +1,11 @@
|
|||
using SPT.Reflection.Patching;
|
||||
using System.Reflection;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
internal class ItemPricePatch : ModulePatch
|
||||
{
|
||||
protected override MethodBase GetTargetMethod() => typeof(EFT.UI.PriceTooltip).GetMethod("Show",
|
||||
protected override MethodBase GetTargetMethod() => typeof(EFT.UI.PriceTooltip).GetMethod("Show",
|
||||
BindingFlags.Instance | BindingFlags.Public,
|
||||
null,
|
||||
[typeof(EFT.InventoryLogic.EOwnerType), typeof(string), typeof(int), typeof(string)],
|
|
@ -10,7 +10,7 @@ using System.Reflection;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
internal class TooltipPatch : ModulePatch
|
||||
{
|
|
@ -3,7 +3,7 @@ using SPT.Reflection.Patching;
|
|||
using SPT.Reflection.Utils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace LootValueEX.Patches
|
||||
namespace LootValueEX.Patches.Tooltips
|
||||
{
|
||||
class TradingItemPatch : ModulePatch
|
||||
{
|
|
@ -11,14 +11,16 @@ namespace LootValueEX
|
|||
{
|
||||
Log = base.Logger;
|
||||
|
||||
new Patches.GridItemTooltipPatch().Enable();
|
||||
new Patches.TooltipPatch().Enable();
|
||||
new Patches.InsuranceGridPatch().Enable();
|
||||
new Patches.InsuranceSlotPatch().Enable();
|
||||
new Patches.ItemPricePatch().Enable();
|
||||
new Patches.TradingItemPatch().Enable();
|
||||
new Patches.HandbookPatching().Enable();
|
||||
new Patches.BarterItemPatch().Enable();
|
||||
new Patches.Tooltips.GridItemTooltipPatch().Enable();
|
||||
new Patches.Tooltips.TooltipPatch().Enable();
|
||||
new Patches.Tooltips.InsuranceGridPatch().Enable();
|
||||
new Patches.Tooltips.InsuranceSlotPatch().Enable();
|
||||
new Patches.Tooltips.ItemPricePatch().Enable();
|
||||
new Patches.Tooltips.TradingItemPatch().Enable();
|
||||
new Patches.Tooltips.HandbookPatching().Enable();
|
||||
new Patches.Tooltips.BarterItemPatch().Enable();
|
||||
|
||||
new Patches.Screens.InventoryScreenPatch().Enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user