0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00

55 lines
1.9 KiB
C#
Raw Normal View History

2024-05-21 19:10:17 +01:00
using SPT.Reflection.Patching;
using System.Reflection;
using BepInEx.Logging;
using EFT;
using EFT.UI;
using HarmonyLib;
using TMPro;
2024-05-21 19:10:17 +01:00
namespace SPT.Debugging.Patches
{
public class EndRaidDebug : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(TraderCard), nameof(TraderCard.method_0));
}
[PatchPrefix]
private static bool PatchPreFix(ref LocalizedText ____nickName, ref TMP_Text ____standing,
2023-12-27 17:10:25 +02:00
ref RankPanel ____rankPanel, ref Profile.TraderInfo ___traderInfo_0)
{
if (____nickName.LocalizationKey == null)
{
ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord");
2024-05-21 19:10:17 +01:00
Logger.Log(LogLevel.Error, "[SPT] _nickName.LocalizationKey was null");
}
if (____standing.text == null)
{
ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord");
2024-05-21 19:10:17 +01:00
Logger.Log(LogLevel.Error, "[SPT] _standing.text was null");
}
if (____rankPanel == null)
{
2024-05-21 19:10:17 +01:00
Logger.Log(LogLevel.Error, "[SPT] _rankPanel was null, skipping method_0");
return false; // skip original
}
2023-12-27 17:10:25 +02:00
if (___traderInfo_0?.LoyaltyLevel == null)
{
ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord");
2024-05-21 19:10:17 +01:00
Logger.Log(LogLevel.Error, "[SPT] ___traderInfo_0 or ___traderInfo_0.LoyaltyLevel was null");
}
2023-12-27 17:10:25 +02:00
if (___traderInfo_0?.MaxLoyaltyLevel == null)
{
ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord");
2024-05-21 19:10:17 +01:00
Logger.Log(LogLevel.Error, "[SPT] ___traderInfo_0 or ___traderInfo_0.MaxLoyaltyLevel was null");
}
return true;
}
}
}