From 96f107f1d296af8185802607e57b9b8700ebf2ef Mon Sep 17 00:00:00 2001 From: Kaeno Date: Sat, 10 Feb 2024 18:07:45 +0000 Subject: [PATCH] Adds the ability to see items required by pmc quests as a scav like live on Found in Raid Items --- project/Aki.Custom/AkiCustomPlugin.cs | 3 +- .../Patches/ScavItemCheckmarkPatch.cs | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs diff --git a/project/Aki.Custom/AkiCustomPlugin.cs b/project/Aki.Custom/AkiCustomPlugin.cs index 578096c..e3062ef 100644 --- a/project/Aki.Custom/AkiCustomPlugin.cs +++ b/project/Aki.Custom/AkiCustomPlugin.cs @@ -65,7 +65,8 @@ namespace Aki.Custom new BTREndRaidItemDeliveryPatch().Enable(); new BTRDestroyAtRaidEndPatch().Enable(); new BTRVehicleMovementSpeedPatch().Enable(); - } + new ScavItemCheckmarkPatch().Enable(); + } catch (Exception ex) { Logger.LogError($"A PATCH IN {GetType().Name} FAILED. SUBSEQUENT PATCHES HAVE NOT LOADED"); diff --git a/project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs b/project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs new file mode 100644 index 0000000..7093524 --- /dev/null +++ b/project/Aki.Custom/Patches/ScavItemCheckmarkPatch.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Aki.Reflection.Patching; +using Aki.Reflection.Utils; +using EFT.UI.DragAndDrop; +using HarmonyLib; + +namespace Aki.Custom.Patches +{ + + public class ScavItemCheckmarkPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return AccessTools.Method(typeof(QuestItemViewPanel), nameof(QuestItemViewPanel.smethod_0)); + } + + [PatchPrefix] + public static void PatchPreFix(ref IEnumerable quests) + { + var pmcQuests = PatchConstants.BackEndSession.Profile.QuestsData; + var scavQuests = PatchConstants.BackEndSession.ProfileOfPet.QuestsData; + + quests = pmcQuests.Concat(scavQuests); + } + } +} \ No newline at end of file