mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Todo: * BTR trader services requires implementation server-side * Send items to player stash (2x4) * Provide covering fire * Taxi to a specific location on Streets * Fix turret aiming at player from raid start * Make turret shoot at enemies (including player) Co-authored-by: Nympfonic <arys.steam@gmail.com> Reviewed-on: SPT-AKI/Modules#52 Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com> Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
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()
|
|
{
|
|
var targetType = typeof(GClass1854).GetNestedTypes(PatchConstants.PrivateFlags).Where(x => x.Name == "Class1469").First();
|
|
return AccessTools.Method(targetType, "method_2");
|
|
}
|
|
|
|
[PatchPrefix]
|
|
public static bool PatchPrefix()
|
|
{
|
|
var gameWorld = Singleton<GameWorld>.Instance;
|
|
var player = gameWorld.MainPlayer;
|
|
|
|
var questController = (GClass3201)AccessTools.Field(player.GetType(), "_questController").GetValue(player);
|
|
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;
|
|
}
|
|
}
|
|
}
|