CWX-mods/Live/Kaeno-TraderScrolling/PlayerCardPatch.cs

31 lines
749 B
C#
Raw Normal View History

2023-10-08 16:48:28 +01:00
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()
{
2023-10-08 22:19:26 +01:00
var gameObject = GameObject.Find("Menu UI");
var check = gameObject.GetComponentInChildren<PlayerCardScript>();
2023-10-08 16:48:28 +01:00
if (check != null)
{
return;
}
2023-10-08 22:19:26 +01:00
gameObject.AddComponent<PlayerCardScript>();
2023-10-08 16:48:28 +01:00
}
}
}