Autofill quest items
This commit is contained in:
24
Patches/AutofillQuestItemsPatch.cs
Normal file
24
Patches/AutofillQuestItemsPatch.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Aki.Reflection.Patching;
|
||||
using EFT.UI;
|
||||
using HarmonyLib;
|
||||
using System.Reflection;
|
||||
|
||||
namespace UIFixes
|
||||
{
|
||||
public class AutofillQuestItemsPatch : ModulePatch
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.DeclaredMethod(typeof(HandoverQuestItemsWindow), nameof(HandoverQuestItemsWindow.Show));
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
public static void Postfix(HandoverQuestItemsWindow __instance)
|
||||
{
|
||||
if (Settings.AutofillQuestTurnIns.Value)
|
||||
{
|
||||
__instance.AutoSelectButtonPressedHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,10 +20,7 @@ namespace UIFixes
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
// The parent has a Show() so need to be specific
|
||||
return AccessTools.GetDeclaredMethods(typeof(HandoverRagfairMoneyWindow)).First(
|
||||
m => m.Name == nameof(HandoverRagfairMoneyWindow.Show) &&
|
||||
m.GetParameters()[0].ParameterType == typeof(Inventory));
|
||||
return AccessTools.DeclaredMethod(typeof(HandoverRagfairMoneyWindow), nameof(HandoverRagfairMoneyWindow.Show));
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
@@ -39,10 +36,7 @@ namespace UIFixes
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
// The parent has a Show() so need to be specific
|
||||
return AccessTools.GetDeclaredMethods(typeof(HandoverExchangeableItemsWindow)).First(
|
||||
m => m.Name == nameof(HandoverExchangeableItemsWindow.Show) &&
|
||||
m.GetParameters()[0].ParameterType == typeof(EExchangeableWindowType));
|
||||
return AccessTools.DeclaredMethod(typeof(HandoverExchangeableItemsWindow), nameof(HandoverExchangeableItemsWindow.Show));
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace UIFixes
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(ScrollRectNoDrag), nameof(ScrollRectNoDrag.OnScroll)); //type.GetMethod("OnScroll");
|
||||
return AccessTools.Method(typeof(ScrollRectNoDrag), nameof(ScrollRectNoDrag.OnScroll));
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace UIFixes
|
||||
KeepOfferWindowOpenPatches.Enable();
|
||||
AddOfferClickablePricesPatches.Enable();
|
||||
new AssortUnlocksPatch().Enable();
|
||||
new AutofillQuestItemsPatch().Enable();
|
||||
}
|
||||
|
||||
public static bool InRaid()
|
||||
|
||||
10
Settings.cs
10
Settings.cs
@@ -31,6 +31,7 @@ namespace UIFixes
|
||||
// General
|
||||
public static ConfigEntry<WeaponPresetConfirmationOption> ShowPresetConfirmations { get; set; }
|
||||
public static ConfigEntry<TransferConfirmationOption> ShowTransferConfirmations { get; set; }
|
||||
public static ConfigEntry<bool> AutofillQuestTurnIns { get; set; }
|
||||
|
||||
// Input
|
||||
public static ConfigEntry<bool> UseHomeEnd { get; set; }
|
||||
@@ -87,6 +88,15 @@ namespace UIFixes
|
||||
null,
|
||||
new ConfigurationManagerAttributes { })));
|
||||
|
||||
configEntries.Add(AutofillQuestTurnIns = config.Bind(
|
||||
GeneralSection,
|
||||
"Autofill Quest Item Turn-ins",
|
||||
true,
|
||||
new ConfigDescription(
|
||||
"Auto-select matching items when turning in quest items. Like pushing the AUTO button for you.",
|
||||
null,
|
||||
new ConfigurationManagerAttributes { })));
|
||||
|
||||
// Input
|
||||
configEntries.Add(UseHomeEnd = config.Bind(
|
||||
InputSection,
|
||||
|
||||
Reference in New Issue
Block a user