2024-01-05 08:58:15 +00:00
|
|
|
|
using Aki.Reflection.Patching;
|
|
|
|
|
using Aki.Reflection.Utils;
|
|
|
|
|
using Comfort.Common;
|
|
|
|
|
using EFT;
|
|
|
|
|
using EFT.UI.Screens;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using static EFT.UI.TraderDialogScreen;
|
|
|
|
|
|
|
|
|
|
namespace Aki.Debugging.BTR.Patches
|
|
|
|
|
{
|
|
|
|
|
public class BTRActivateTraderDialogPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2024-01-05 09:27:59 +00:00
|
|
|
|
var targetType = typeof(GetActionsClass).GetNestedTypes(PatchConstants.PrivateFlags).Where(x => x.Name == "Class1469").First();
|
2024-01-05 08:58:15 +00:00
|
|
|
|
return AccessTools.Method(targetType, "method_2");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
public static bool PatchPrefix()
|
|
|
|
|
{
|
|
|
|
|
var gameWorld = Singleton<GameWorld>.Instance;
|
|
|
|
|
var player = gameWorld.MainPlayer;
|
|
|
|
|
|
2024-01-05 09:27:59 +00:00
|
|
|
|
var questController = (AbstractQuestControllerClass)AccessTools.Field(player.GetType(), "_questController").GetValue(player);
|
2024-01-05 08:58:15 +00:00
|
|
|
|
var inventoryController = (InventoryControllerClass)AccessTools.Field(player.GetType(), "_inventoryController").GetValue(player);
|
|
|
|
|
|
|
|
|
|
GClass3130 btrDialog = new GClass3130(player.Profile, Profile.TraderInfo.BTR_TRADER_ID, questController, inventoryController, null);
|
|
|
|
|
btrDialog.OnClose += player.UpdateInteractionCast;
|
|
|
|
|
btrDialog.ShowScreen(EScreenState.Queued);
|
|
|
|
|
//GClass1952.ShowDialogScreen(Profile.ETraderServiceSource.Btr, true);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|