Mod weapons in hands/in raid; Move add offer setting
This commit is contained in:
22
Extensions.cs
Normal file
22
Extensions.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using EFT.InventoryLogic;
|
||||||
|
|
||||||
|
namespace UIFixes;
|
||||||
|
|
||||||
|
public static class Extensions
|
||||||
|
{
|
||||||
|
public static Item GetRootItemNotEquipment(this Item item)
|
||||||
|
{
|
||||||
|
return item.GetAllParentItemsAndSelf(true).LastOrDefault(i => i is not EquipmentClass) ?? item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Item GetRootItemNotEquipment(this ItemAddress itemAddress)
|
||||||
|
{
|
||||||
|
if (itemAddress.Container == null || itemAddress.Container.ParentItem == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemAddress.Container.ParentItem.GetRootItemNotEquipment();
|
||||||
|
}
|
||||||
|
}
|
@@ -39,6 +39,9 @@ global using NoPossibleActionsError = GClass3317;
|
|||||||
global using CannotSortError = GClass3325;
|
global using CannotSortError = GClass3325;
|
||||||
global using FailedToSortError = GClass3326;
|
global using FailedToSortError = GClass3326;
|
||||||
global using MoveSameSpaceError = InteractionsHandlerClass.GClass3353;
|
global using MoveSameSpaceError = InteractionsHandlerClass.GClass3353;
|
||||||
|
global using NotModdableInRaidError = GClass3321;
|
||||||
|
global using MultitoolNeededError = GClass3322;
|
||||||
|
global using ModVitalPartInRaidError = GClass3323;
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
global using ItemOperation = GStruct413;
|
global using ItemOperation = GStruct413;
|
||||||
|
@@ -263,11 +263,6 @@ public static class TacticalBindsPatches
|
|||||||
|
|
||||||
Quickbind.SetType(index, Quickbind.ItemType.Other);
|
Quickbind.SetType(index, Quickbind.ItemType.Other);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Item GetRootItemNotEquipment(this Item item)
|
|
||||||
{
|
|
||||||
return item.GetAllParentItemsAndSelf(true).LastOrDefault(i => i is not EquipmentClass) ?? item;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Quickbind
|
public static class Quickbind
|
||||||
|
@@ -1,16 +1,23 @@
|
|||||||
using Diz.LanguageExtensions;
|
using Comfort.Common;
|
||||||
|
using EFT;
|
||||||
using EFT.InventoryLogic;
|
using EFT.InventoryLogic;
|
||||||
|
using EFT.UI.DragAndDrop;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using SPT.Reflection.Patching;
|
using SPT.Reflection.Patching;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace UIFixes;
|
namespace UIFixes;
|
||||||
|
|
||||||
public static class WeaponModdingPatches
|
public static class WeaponModdingPatches
|
||||||
{
|
{
|
||||||
|
private const string MultitoolId = "544fb5454bdc2df8738b456a";
|
||||||
|
private static readonly string[] EquippedSlots = ["FirstPrimaryWeapon", "SecondPrimaryWeapon", "Holster"];
|
||||||
|
|
||||||
public static void Enable()
|
public static void Enable()
|
||||||
{
|
{
|
||||||
new ResizePatch().Enable();
|
new ResizePatch().Enable();
|
||||||
@@ -18,8 +25,13 @@ public static class WeaponModdingPatches
|
|||||||
new ResizeOperationRollbackPatch().Enable();
|
new ResizeOperationRollbackPatch().Enable();
|
||||||
new MoveBeforeNetworkTransactionPatch().Enable();
|
new MoveBeforeNetworkTransactionPatch().Enable();
|
||||||
|
|
||||||
//new ModdingMoveToSortingTablePatch().Enable();
|
new ModEquippedPatch().Enable();
|
||||||
//new PresetMoveToSortingTablePatch().Enable();
|
new InspectLockedPatch().Enable();
|
||||||
|
new ModCanBeMovedPatch().Enable();
|
||||||
|
new ModCanDetachPatch().Enable();
|
||||||
|
new ModCanApplyPatch().Enable();
|
||||||
|
new ModRaidModdablePatch().Enable();
|
||||||
|
new EmptyVitalPartsPatch().Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ResizePatch : ModulePatch
|
public class ResizePatch : ModulePatch
|
||||||
@@ -192,124 +204,332 @@ public static class WeaponModdingPatches
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public class ModdingMoveToSortingTablePatch : ModulePatch
|
public class ModEquippedPatch : ModulePatch
|
||||||
// {
|
{
|
||||||
// private static bool InPatch = false;
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Method(R.ContextMenuHelper.Type, "IsInteractive");
|
||||||
|
}
|
||||||
|
|
||||||
// protected override MethodBase GetTargetMethod()
|
// Enable/disable options in the context menu
|
||||||
// {
|
[PatchPostfix]
|
||||||
// return AccessTools.DeclaredMethod(typeof(GClass2848), nameof(GClass2848.Select));
|
public static void Postfix(EItemInfoButton button, ref IResult __result, Item ___item_0)
|
||||||
// }
|
{
|
||||||
|
// These two are only visible out of raid, enable them
|
||||||
|
if (Settings.ModifyEquippedWeapons.Value && (button == EItemInfoButton.Modding || button == EItemInfoButton.EditBuild))
|
||||||
|
{
|
||||||
|
if (__result.Succeed || !Singleton<BonusController>.Instance.HasBonus(EBonusType.UnlockWeaponModification))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// [PatchPostfix]
|
__result = SuccessfulResult.New;
|
||||||
// public static void Postfix(GClass2848 __instance, Item item, ItemAddress itemAddress, bool simulate, ref Error error, ref bool __result)
|
return;
|
||||||
// {
|
}
|
||||||
// if (!Settings.MoveBuildsToSortingTable.Value || InPatch || __result || error is not InteractionsHandlerClass.GClass3363)
|
|
||||||
// {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // get top level item (weapon)
|
// This is surprisingly active in raid? Only enable out of raid.
|
||||||
// Item rootItem = itemAddress.Container.ParentItem.GetRootMergedItem();
|
if (button == EItemInfoButton.Disassemble)
|
||||||
// if (rootItem == null)
|
{
|
||||||
// {
|
if (!Plugin.InRaid() && Settings.ModifyEquippedWeapons.Value)
|
||||||
// return;
|
{
|
||||||
// }
|
__result = SuccessfulResult.New;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// // move it to sorting table
|
// These are on mods; normally the context menu is disabled so these are individually not disabled
|
||||||
// SortingTableClass sortingTable = __instance.InventoryControllerClass.Inventory.SortingTable;
|
// Need to do the disabling as appropriate
|
||||||
// if (sortingTable == null)
|
if (___item_0 is Mod mod && (button == EItemInfoButton.Uninstall || button == EItemInfoButton.Discard))
|
||||||
// {
|
{
|
||||||
// return;
|
if (!CanModify(mod, out string error))
|
||||||
// }
|
{
|
||||||
|
__result = new FailedResult(error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ItemAddressClass sortingTableAddress = sortingTable.Grid.FindLocationForItem(rootItem);
|
public class InspectLockedPatch : ModulePatch
|
||||||
// if (sortingTableAddress == null)
|
{
|
||||||
// {
|
protected override MethodBase GetTargetMethod()
|
||||||
// return;
|
{
|
||||||
// }
|
return AccessTools.Method(typeof(ModSlotView), nameof(ModSlotView.method_14));
|
||||||
|
}
|
||||||
|
|
||||||
// var sortingTableMove = InteractionsHandlerClass.Move(rootItem, sortingTableAddress, __instance.InventoryControllerClass, simulate);
|
// Enable context menu on normally unmoddable slots, maybe keep them gray
|
||||||
// if (sortingTableMove.Failed || sortingTableMove.Value == null)
|
[PatchPostfix]
|
||||||
// {
|
public static void Postfix(ModSlotView __instance, ref bool ___bool_1, CanvasGroup ____canvasGroup)
|
||||||
// return;
|
{
|
||||||
// }
|
// Keep it grayed out and warning text if its not draggable, even if context menu is enabled
|
||||||
|
if (__instance.Slot.ContainedItem is Mod mod && CanModify(mod, out string error))
|
||||||
|
{
|
||||||
|
___bool_1 = false;
|
||||||
|
____canvasGroup.alpha = 1f;
|
||||||
|
}
|
||||||
|
|
||||||
// if (simulate)
|
____canvasGroup.blocksRaycasts = true;
|
||||||
// {
|
____canvasGroup.interactable = true;
|
||||||
// // Just testing, and it was moveable to sorting table, so assume everything is fine.
|
}
|
||||||
// error = null;
|
}
|
||||||
// __result = true;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Actually selecting it, so do it and then redo the select
|
public class ModCanBeMovedPatch : ModulePatch
|
||||||
// __instance.InventoryControllerClass.RunNetworkTransaction(sortingTableMove.Value);
|
{
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Method(typeof(Mod), nameof(Mod.CanBeMoved));
|
||||||
|
}
|
||||||
|
|
||||||
// InPatch = true;
|
// As far as I can tell this never gets called, but hey
|
||||||
// __result = __instance.Select(item, itemAddress, simulate, out error);
|
[PatchPostfix]
|
||||||
// InPatch = false;
|
public static void Postfix(Mod __instance, IContainer toContainer, ref GStruct416<bool> __result)
|
||||||
// }
|
{
|
||||||
// }
|
if (__result.Succeeded)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// public class PresetMoveToSortingTablePatch : ModulePatch
|
if (!CanModify(__instance, out string itemError))
|
||||||
// {
|
{
|
||||||
// private static bool InPatch = false;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// protected override MethodBase GetTargetMethod()
|
if (toContainer is not Slot toSlot || !CanModify(R.SlotItemAddress.Create(toSlot), out string slotError))
|
||||||
// {
|
{
|
||||||
// return AccessTools.Method(typeof(GClass2849), nameof(GClass2849.method_2));
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// [PatchPostfix]
|
__result = true;
|
||||||
// public static void Postfix(
|
}
|
||||||
// GClass2849 __instance,
|
}
|
||||||
// Item item,
|
|
||||||
// List<GClass2849.Class2174> modsWithSlots,
|
|
||||||
// TraderControllerClass itemController,
|
|
||||||
// bool simulate,
|
|
||||||
// ref GStruct416<List<GStruct414<GClass2802>>> __result)
|
|
||||||
// {
|
|
||||||
// if (!Settings.MoveBuildsToSortingTable.Value ||
|
|
||||||
// InPatch ||
|
|
||||||
// __result.Succeeded ||
|
|
||||||
// __result.Error is not InteractionsHandlerClass.GClass3363 ||
|
|
||||||
// itemController is not InventoryControllerClass inventoryController)
|
|
||||||
// {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // move it to sorting table
|
public class ModCanDetachPatch : ModulePatch
|
||||||
// SortingTableClass sortingTable = inventoryController.Inventory.SortingTable;
|
{
|
||||||
// if (sortingTable == null)
|
private static Type TargetMethodReturnType;
|
||||||
// {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ItemAddressClass sortingTableAddress = sortingTable.Grid.FindLocationForItem(item);
|
protected override MethodBase GetTargetMethod()
|
||||||
// if (sortingTableAddress == null)
|
{
|
||||||
// {
|
MethodInfo method = AccessTools.Method(typeof(InteractionsHandlerClass), nameof(InteractionsHandlerClass.smethod_1));
|
||||||
// return;
|
TargetMethodReturnType = method.ReturnType;
|
||||||
// }
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
// var sortingTableMove = InteractionsHandlerClass.Move(item, sortingTableAddress, inventoryController, simulate); // only called with simulate = false
|
// This gets invoked when dragging items around between slots
|
||||||
// if (sortingTableMove.Failed || sortingTableMove.Value == null)
|
[PatchPostfix]
|
||||||
// {
|
public static void Postfix(Item item, ItemAddress to, TraderControllerClass itemController, ref GStruct416<GClass3372> __result)
|
||||||
// return;
|
{
|
||||||
// }
|
if (item is not Mod mod)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// InPatch = true;
|
if (Plugin.InRaid() && __result.Succeeded)
|
||||||
// __result = __instance.method_2(item, modsWithSlots, itemController, simulate);
|
{
|
||||||
// InPatch = false;
|
// In raid successes are all fine
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// if (__result.Succeeded)
|
bool canModify = CanModify(mod, out string error) && CanModify(to, out error);
|
||||||
// {
|
if (canModify == __result.Succeeded)
|
||||||
// __result.Value.Prepend(sortingTableMove);
|
{
|
||||||
// }
|
// In agreement, just check the error is best to show
|
||||||
// else
|
if (Settings.ModifyRaidWeapons.Value == ModRaidWeapon.WithTool &&
|
||||||
// {
|
(__result.Error is NotModdableInRaidError || __result.Error is ModVitalPartInRaidError))
|
||||||
// sortingTableMove.Value.RollBack();
|
{
|
||||||
// }
|
// Double check this is an unequipped weapon
|
||||||
// }
|
Weapon weapon = item.GetRootItemNotEquipment() as Weapon ?? to.GetRootItemNotEquipment() as Weapon;
|
||||||
// }
|
if (weapon != null && !EquippedSlots.Contains(weapon.Parent.Container.ID))
|
||||||
|
{
|
||||||
|
__result = new MultitoolNeededError(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (__result.Failed && canModify)
|
||||||
|
{
|
||||||
|
// Override result with success if DestinationCheck passes
|
||||||
|
var destinationCheck = InteractionsHandlerClass.DestinationCheck(item.Parent, to, itemController.OwnerType);
|
||||||
|
if (destinationCheck.Failed)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
__result = default;
|
||||||
|
}
|
||||||
|
else if (__result.Succeeded && !canModify)
|
||||||
|
{
|
||||||
|
// Out of raid, likely dragging a mod that was previously non-interactive, need to actually block
|
||||||
|
__result = new VitalPartInHandsError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class VitalPartInHandsError : InventoryError
|
||||||
|
{
|
||||||
|
public override string GetLocalizedDescription()
|
||||||
|
{
|
||||||
|
return "Vital mod weapon in hands".Localized();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return "Vital mod weapon in hands";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ModCanApplyPatch : ModulePatch
|
||||||
|
{
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Method(typeof(LootItemClass), nameof(LootItemClass.Apply));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gets called when dropping mods on top of weapons
|
||||||
|
[PatchPrefix]
|
||||||
|
public static void Prefix(LootItemClass __instance, Item item)
|
||||||
|
{
|
||||||
|
if (!Plugin.InRaid())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (__instance is not Weapon weapon || item is not Mod mod || EquippedSlots.Contains(weapon.Parent.Container.ID))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CanModify(mod, out string error))
|
||||||
|
{
|
||||||
|
ModRaidModdablePatch.Override = true;
|
||||||
|
EmptyVitalPartsPatch.Override = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[PatchPostfix]
|
||||||
|
public static void Postfix(LootItemClass __instance, ref ItemOperation __result)
|
||||||
|
{
|
||||||
|
ModRaidModdablePatch.Override = false;
|
||||||
|
EmptyVitalPartsPatch.Override = false;
|
||||||
|
|
||||||
|
// If setting is multitool, may need to change some errors
|
||||||
|
if (Settings.ModifyRaidWeapons.Value == ModRaidWeapon.WithTool)
|
||||||
|
{
|
||||||
|
if (__instance is not Weapon weapon || EquippedSlots.Contains(weapon.Parent.Container.ID))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (__result.Error is NotModdableInRaidError || __result.Error is ModVitalPartInRaidError)
|
||||||
|
{
|
||||||
|
__result = new MultitoolNeededError(__instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ModRaidModdablePatch : ModulePatch
|
||||||
|
{
|
||||||
|
public static bool Override = false;
|
||||||
|
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Property(typeof(Mod), nameof(Mod.RaidModdable)).GetMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
[PatchPostfix]
|
||||||
|
public static void Postfix(ref bool __result)
|
||||||
|
{
|
||||||
|
__result = __result || Override;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EmptyVitalPartsPatch : ModulePatch
|
||||||
|
{
|
||||||
|
public static bool Override = false;
|
||||||
|
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Property(typeof(LootItemClass), nameof(LootItemClass.VitalParts)).GetMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
[PatchPrefix]
|
||||||
|
public static bool Prefix(ref IEnumerable<Slot> __result)
|
||||||
|
{
|
||||||
|
if (Override)
|
||||||
|
{
|
||||||
|
__result = [];
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool CanModify(Mod item, out string error)
|
||||||
|
{
|
||||||
|
return CanModify(item, item?.Parent, out error);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool CanModify(ItemAddress itemAddress, out string error)
|
||||||
|
{
|
||||||
|
return CanModify(null, itemAddress, out error);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool CanModify(Mod item, ItemAddress itemAddress, out string error)
|
||||||
|
{
|
||||||
|
error = null;
|
||||||
|
|
||||||
|
// If it's raidmoddable and not in a vital slot, then it's all good
|
||||||
|
if ((item == null || item.RaidModdable) &&
|
||||||
|
(!R.SlotItemAddress.Type.IsAssignableFrom(itemAddress.GetType()) || !new R.SlotItemAddress(itemAddress).Slot.Required))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Item rootItem = itemAddress.GetRootItemNotEquipment();
|
||||||
|
if (rootItem is not Weapon weapon)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can't modify weapon in hands
|
||||||
|
if (EquippedSlots.Contains(weapon.Parent.Container.ID))
|
||||||
|
{
|
||||||
|
if (Plugin.InRaid())
|
||||||
|
{
|
||||||
|
error = "Inventory Errors/Not moddable in raid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!Settings.ModifyEquippedWeapons.Value)
|
||||||
|
{
|
||||||
|
error = "Vital mod weapon in hands";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not in raid, not in hands: anything is possible
|
||||||
|
if (!Plugin.InRaid())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Settings.ModifyRaidWeapons.Value == ModRaidWeapon.Never)
|
||||||
|
{
|
||||||
|
error = "Inventory Errors/Not moddable in raid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = Singleton<GameWorld>.Instance.MainPlayer;
|
||||||
|
bool hasMultitool = player.Equipment.GetAllItems().Any(i => i.TemplateId == MultitoolId);
|
||||||
|
|
||||||
|
if (Settings.ModifyRaidWeapons.Value == ModRaidWeapon.WithTool && !hasMultitool)
|
||||||
|
{
|
||||||
|
error = "Inventory Errors/Not moddable without multitool";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
49
Settings.cs
49
Settings.cs
@@ -52,6 +52,14 @@ internal enum TacticalBindModifier
|
|||||||
Alt
|
Alt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal enum ModRaidWeapon
|
||||||
|
{
|
||||||
|
Never,
|
||||||
|
[Description("With Multitool")]
|
||||||
|
WithTool,
|
||||||
|
Always
|
||||||
|
}
|
||||||
|
|
||||||
internal class Settings
|
internal class Settings
|
||||||
{
|
{
|
||||||
// Categories
|
// Categories
|
||||||
@@ -94,7 +102,6 @@ internal class Settings
|
|||||||
public static ConfigEntry<KeyboardShortcut> UnpackKeyBind { get; set; }
|
public static ConfigEntry<KeyboardShortcut> UnpackKeyBind { get; set; }
|
||||||
public static ConfigEntry<KeyboardShortcut> FilterByKeyBind { get; set; }
|
public static ConfigEntry<KeyboardShortcut> FilterByKeyBind { get; set; }
|
||||||
public static ConfigEntry<KeyboardShortcut> LinkedSearchKeyBind { get; set; }
|
public static ConfigEntry<KeyboardShortcut> LinkedSearchKeyBind { get; set; }
|
||||||
public static ConfigEntry<bool> AddOfferContextMenu { get; set; } // Advanced
|
|
||||||
public static ConfigEntry<KeyboardShortcut> AddOfferKeyBind { get; set; }
|
public static ConfigEntry<KeyboardShortcut> AddOfferKeyBind { get; set; }
|
||||||
public static ConfigEntry<KeyboardShortcut> SortingTableKeyBind { get; set; }
|
public static ConfigEntry<KeyboardShortcut> SortingTableKeyBind { get; set; }
|
||||||
public static ConfigEntry<bool> LimitNonstandardDrags { get; set; } // Advanced
|
public static ConfigEntry<bool> LimitNonstandardDrags { get; set; } // Advanced
|
||||||
@@ -112,6 +119,8 @@ internal class Settings
|
|||||||
public static ConfigEntry<bool> AlwaysSwapMags { get; set; }
|
public static ConfigEntry<bool> AlwaysSwapMags { get; set; }
|
||||||
public static ConfigEntry<bool> UnloadAmmoBoxInPlace { get; set; } // Advanced
|
public static ConfigEntry<bool> UnloadAmmoBoxInPlace { get; set; } // Advanced
|
||||||
public static ConfigEntry<bool> SwapImpossibleContainers { get; set; }
|
public static ConfigEntry<bool> SwapImpossibleContainers { get; set; }
|
||||||
|
public static ConfigEntry<bool> ModifyEquippedWeapons { get; set; } // Advanced
|
||||||
|
public static ConfigEntry<ModRaidWeapon> ModifyRaidWeapons { get; set; }
|
||||||
public static ConfigEntry<bool> ReorderGrids { get; set; }
|
public static ConfigEntry<bool> ReorderGrids { get; set; }
|
||||||
public static ConfigEntry<bool> SynchronizeStashScrolling { get; set; }
|
public static ConfigEntry<bool> SynchronizeStashScrolling { get; set; }
|
||||||
public static ConfigEntry<bool> GreedyStackMove { get; set; }
|
public static ConfigEntry<bool> GreedyStackMove { get; set; }
|
||||||
@@ -122,6 +131,7 @@ internal class Settings
|
|||||||
public static ConfigEntry<bool> AutoOpenSortingTable { get; set; }
|
public static ConfigEntry<bool> AutoOpenSortingTable { get; set; }
|
||||||
public static ConfigEntry<bool> DefaultSortingTableBind { get; set; } // Advanced
|
public static ConfigEntry<bool> DefaultSortingTableBind { get; set; } // Advanced
|
||||||
public static ConfigEntry<bool> ContextMenuOnRight { get; set; }
|
public static ConfigEntry<bool> ContextMenuOnRight { get; set; }
|
||||||
|
public static ConfigEntry<bool> AddOfferContextMenu { get; set; }
|
||||||
public static ConfigEntry<bool> ShowGPCurrency { get; set; }
|
public static ConfigEntry<bool> ShowGPCurrency { get; set; }
|
||||||
public static ConfigEntry<bool> ShowOutOfStockCheckbox { get; set; }
|
public static ConfigEntry<bool> ShowOutOfStockCheckbox { get; set; }
|
||||||
public static ConfigEntry<SortingTableDisplay> SortingTableButton { get; set; }
|
public static ConfigEntry<SortingTableDisplay> SortingTableButton { get; set; }
|
||||||
@@ -424,15 +434,6 @@ internal class Settings
|
|||||||
null,
|
null,
|
||||||
new ConfigurationManagerAttributes { })));
|
new ConfigurationManagerAttributes { })));
|
||||||
|
|
||||||
configEntries.Add(AddOfferContextMenu = config.Bind(
|
|
||||||
InputSection,
|
|
||||||
"Add Offer Context Menu",
|
|
||||||
true,
|
|
||||||
new ConfigDescription(
|
|
||||||
"Add a context menu to list the item on the flea market",
|
|
||||||
null,
|
|
||||||
new ConfigurationManagerAttributes { IsAdvanced = true })));
|
|
||||||
|
|
||||||
configEntries.Add(AddOfferKeyBind = config.Bind(
|
configEntries.Add(AddOfferKeyBind = config.Bind(
|
||||||
InputSection,
|
InputSection,
|
||||||
"Linked Search Shortcut",
|
"Linked Search Shortcut",
|
||||||
@@ -569,6 +570,24 @@ internal class Settings
|
|||||||
null,
|
null,
|
||||||
new ConfigurationManagerAttributes { })));
|
new ConfigurationManagerAttributes { })));
|
||||||
|
|
||||||
|
configEntries.Add(ModifyEquippedWeapons = config.Bind(
|
||||||
|
InventorySection,
|
||||||
|
"Modify Equipped Weapons",
|
||||||
|
true,
|
||||||
|
new ConfigDescription(
|
||||||
|
"Enable the modification of equipped weapons, including vital parts, out of raid",
|
||||||
|
null,
|
||||||
|
new ConfigurationManagerAttributes { IsAdvanced = true })));
|
||||||
|
|
||||||
|
configEntries.Add(ModifyRaidWeapons = config.Bind(
|
||||||
|
InventorySection,
|
||||||
|
"Modify Weapons In Raid",
|
||||||
|
ModRaidWeapon.Never,
|
||||||
|
new ConfigDescription(
|
||||||
|
"When to enable the modification of vital parts of unequipped weapons, in raid",
|
||||||
|
null,
|
||||||
|
new ConfigurationManagerAttributes { })));
|
||||||
|
|
||||||
configEntries.Add(ReorderGrids = config.Bind(
|
configEntries.Add(ReorderGrids = config.Bind(
|
||||||
InventorySection,
|
InventorySection,
|
||||||
"Standardize Grid Order",
|
"Standardize Grid Order",
|
||||||
@@ -659,6 +678,15 @@ internal class Settings
|
|||||||
null,
|
null,
|
||||||
new ConfigurationManagerAttributes { })));
|
new ConfigurationManagerAttributes { })));
|
||||||
|
|
||||||
|
configEntries.Add(AddOfferContextMenu = config.Bind(
|
||||||
|
InputSection,
|
||||||
|
"Add Offer Context Menu",
|
||||||
|
true,
|
||||||
|
new ConfigDescription(
|
||||||
|
"Add a context menu to list the item on the flea market",
|
||||||
|
null,
|
||||||
|
new ConfigurationManagerAttributes { })));
|
||||||
|
|
||||||
configEntries.Add(ShowGPCurrency = config.Bind(
|
configEntries.Add(ShowGPCurrency = config.Bind(
|
||||||
InventorySection,
|
InventorySection,
|
||||||
"Show GP Coins in Currency",
|
"Show GP Coins in Currency",
|
||||||
@@ -916,7 +944,6 @@ internal class Settings
|
|||||||
|
|
||||||
RecalcOrder(configEntries);
|
RecalcOrder(configEntries);
|
||||||
|
|
||||||
|
|
||||||
MakeDependent(EnableMultiSelect, EnableMultiSelectInRaid);
|
MakeDependent(EnableMultiSelect, EnableMultiSelectInRaid);
|
||||||
MakeDependent(EnableMultiSelect, ShowMultiSelectDebug, false);
|
MakeDependent(EnableMultiSelect, ShowMultiSelectDebug, false);
|
||||||
MakeDependent(EnableMultiSelect, EnableMultiClick);
|
MakeDependent(EnableMultiSelect, EnableMultiClick);
|
||||||
|
Reference in New Issue
Block a user