2024-10-13 00:38:51 +02:00
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
internal class ItemPricePatch : ModulePatch
|
|
|
|
|
{
|
2024-11-04 05:37:34 +01:00
|
|
|
|
protected override MethodBase GetTargetMethod() => typeof(EFT.UI.PriceTooltip).GetMethod("Show",
|
2024-10-13 00:38:51 +02:00
|
|
|
|
BindingFlags.Instance | BindingFlags.Public,
|
|
|
|
|
null,
|
|
|
|
|
[typeof(EFT.InventoryLogic.EOwnerType), typeof(string), typeof(int), typeof(string)],
|
|
|
|
|
null);
|
|
|
|
|
internal static bool PatchTooltip { get; private set; } = false;
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
internal static void EnableTooltipPatch()
|
|
|
|
|
{
|
|
|
|
|
if (TradingItemPatch.HoveredItem == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
PatchTooltip = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
|
|
|
|
internal static void DisableTooltipPatch()
|
|
|
|
|
{
|
|
|
|
|
PatchTooltip = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|