2024-10-13 00:38:51 +02:00
|
|
|
|
using LootValueEX.Extensions;
|
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
2024-11-04 05:37:34 +01:00
|
|
|
|
namespace LootValueEX.Patches.Tooltips
|
2024-10-13 00:38:51 +02:00
|
|
|
|
{
|
|
|
|
|
class InsuranceSlotPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod() => typeof(EFT.UI.Insurance.InsuranceSlotItemView).GetMethod("OnPointerEnter", BindingFlags.Public | BindingFlags.Instance);
|
|
|
|
|
internal static bool PatchTooltip { get; private set; } = false;
|
|
|
|
|
internal static EFT.InventoryLogic.Item? HoveredItem { get; private set; }
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
internal static void EnableTooltipPatch(EFT.UI.Insurance.InsuranceSlotItemView __instance)
|
|
|
|
|
{
|
|
|
|
|
if (!__instance.Item.IsExamined())
|
|
|
|
|
return;
|
|
|
|
|
PatchTooltip = true;
|
|
|
|
|
HoveredItem = __instance.Item;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
|
|
|
|
internal static void DisableTooltipPatch()
|
|
|
|
|
{
|
|
|
|
|
PatchTooltip = false;
|
|
|
|
|
HoveredItem = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|