CWX-mods/Live/Kaeno-TraderScrolling/PlayerCardPatch.cs
2023-10-08 22:19:26 +01:00

31 lines
749 B
C#

using Aki.Reflection.Patching;
using Aki.Reflection.Utils;
using EFT.UI;
using System.Reflection;
using UnityEngine;
namespace TraderScrolling
{
public class PlayerCardPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(DisplayMoneyPanelTMPText).GetMethod("Show", PatchConstants.PublicFlags);
}
[PatchPostfix]
public static void PatchPostFix()
{
var gameObject = GameObject.Find("Menu UI");
var check = gameObject.GetComponentInChildren<PlayerCardScript>();
if (check != null)
{
return;
}
gameObject.AddComponent<PlayerCardScript>();
}
}
}