global usings, some reflection, part 1
This commit is contained in:
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace UIFixes.ContextMenus
|
||||
{
|
||||
public class EmptySlotMenu(Slot slot, ItemContextAbstractClass itemContext, ItemUiContext itemUiContext, Action closeAction) : GClass3042(itemContext, itemUiContext, closeAction)
|
||||
public class EmptySlotMenu(Slot slot, ItemContextAbstractClass itemContext, ItemUiContext itemUiContext, Action closeAction) : BaseItemInfoInteractions(itemContext, itemUiContext, closeAction)
|
||||
{
|
||||
private static readonly List<EItemInfoButton> Actions = [EItemInfoButton.LinkedSearch];
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace UIFixes.ContextMenus
|
||||
switch (interaction)
|
||||
{
|
||||
case EItemInfoButton.LinkedSearch:
|
||||
Search(new GClass3219(EFilterType.LinkedSearch, slot.ParentItem.TemplateId + ":" + slot.Id, true));
|
||||
Search(new(EFilterType.LinkedSearch, slot.ParentItem.TemplateId + ":" + slot.Id, true));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@@ -12,17 +12,17 @@ namespace UIFixes
|
||||
private readonly InsuranceCompanyClass insurance = uiContext.Session.InsuranceCompany;
|
||||
private readonly List<Item> items = items.ToList();
|
||||
private readonly int playerRubles = playerRubles;
|
||||
private List<ItemClass> insurableItems;
|
||||
private List<InsuranceItem> insurableItems;
|
||||
private readonly Dictionary<string, int> prices = [];
|
||||
|
||||
public InsuranceInteractions(Item item, ItemUiContext uiContext, int playerRubles) : this([item], uiContext, playerRubles) { }
|
||||
|
||||
public void LoadAsync(Action callback)
|
||||
{
|
||||
IEnumerable<ItemClass> itemClasses = items.Select(ItemClass.FindOrCreate);
|
||||
insurableItems = itemClasses.SelectMany(insurance.GetItemChildren)
|
||||
IEnumerable<InsuranceItem> InsuranceItemes = items.Select(InsuranceItem.FindOrCreate);
|
||||
insurableItems = InsuranceItemes.SelectMany(insurance.GetItemChildren)
|
||||
.Flatten(insurance.GetItemChildren)
|
||||
.Concat(itemClasses)
|
||||
.Concat(InsuranceItemes)
|
||||
.Where(i => insurance.ItemTypeAvailableForInsurance(i) && !insurance.InsuredItems.Contains(i))
|
||||
.ToList();
|
||||
|
||||
|
30
GlobalUsings.cs
Normal file
30
GlobalUsings.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
// These shouln't change (unless they do)
|
||||
global using GridItemAddress = ItemAddressClass;
|
||||
global using DragItemContext = ItemContextClass;
|
||||
global using InsuranceItem = ItemClass;
|
||||
|
||||
// Everything below will change between EFT builds
|
||||
global using BaseItemInfoInteractions = GClass3042;
|
||||
global using GenericItemContext = GClass2833;
|
||||
global using KeyCombination = GClass1911;
|
||||
global using ToggleKeyCombination = GClass1912;
|
||||
global using Stackable = GClass2751;
|
||||
global using RagfairSearch = GClass3219;
|
||||
global using CurrencyInfo = GClass2531;
|
||||
global using Scheme = GClass1939;
|
||||
|
||||
// Errors
|
||||
global using DestroyError = GClass3344;
|
||||
global using GridModificationsUnavailableError = StashGridClass.GClass3315;
|
||||
global using NoRoomError = GClass3316;
|
||||
global using NoPossibleActionsError = GClass3317;
|
||||
global using MoveSameSpaceError = InteractionsHandlerClass.GClass3353;
|
||||
|
||||
// Operations
|
||||
global using ItemOperation = GStruct413;
|
||||
global using MoveOperation = GClass2802;
|
||||
global using NoOpMove = GClass2795;
|
||||
global using TargetItemOperation = TraderControllerClass.Struct775;
|
||||
|
||||
// Interfaces
|
||||
global using IApplicable = GInterface321;
|
@@ -12,7 +12,7 @@ namespace UIFixes
|
||||
private static readonly Dictionary<string, Dictionary<string, Vector2Int>> GridOffsets = [];
|
||||
private static readonly Dictionary<string, Dictionary<int, Dictionary<int, string>>> GridsByLocation = [];
|
||||
|
||||
public static LocationInGrid GetGridLocation(ItemAddressClass realAddress)
|
||||
public static LocationInGrid GetGridLocation(GridItemAddress realAddress)
|
||||
{
|
||||
if (!IsMultiGrid(realAddress))
|
||||
{
|
||||
@@ -23,7 +23,7 @@ namespace UIFixes
|
||||
return new LocationInGrid(realAddress.LocationInGrid.x + gridOffset.x, realAddress.LocationInGrid.y + gridOffset.y, realAddress.LocationInGrid.r);
|
||||
}
|
||||
|
||||
public static ItemAddressClass GetRealAddress(StashGridClass originGrid, LocationInGrid multigridLocation)
|
||||
public static GridItemAddress GetRealAddress(StashGridClass originGrid, LocationInGrid multigridLocation)
|
||||
{
|
||||
if (!IsMultiGrid(originGrid.ParentItem))
|
||||
{
|
||||
@@ -31,7 +31,7 @@ namespace UIFixes
|
||||
multigridLocation.x = Math.Max(0, Math.Min(originGrid.GridWidth.Value, multigridLocation.x));
|
||||
multigridLocation.y = Math.Max(0, Math.Min(originGrid.GridHeight.Value, multigridLocation.y));
|
||||
|
||||
return new ItemAddressClass(originGrid, multigridLocation);
|
||||
return new GridItemAddress(originGrid, multigridLocation);
|
||||
}
|
||||
|
||||
var gridsByLocation = GridsByLocation[originGrid.ParentItem.TemplateId];
|
||||
@@ -53,7 +53,7 @@ namespace UIFixes
|
||||
Vector2Int offsets = GridOffsets[originGrid.ParentItem.TemplateId][gridId];
|
||||
|
||||
LocationInGrid location = new(x - offsets.x, y - offsets.y, multigridLocation.r);
|
||||
return new ItemAddressClass(grid, location);
|
||||
return new GridItemAddress(grid, location);
|
||||
}
|
||||
|
||||
public static void Cache(GridView initialGridView)
|
||||
@@ -109,7 +109,7 @@ namespace UIFixes
|
||||
GridsByLocation.Add(parent.TemplateId, gridsByLocation);
|
||||
}
|
||||
|
||||
private static bool IsMultiGrid(ItemAddressClass itemAddress)
|
||||
private static bool IsMultiGrid(GridItemAddress itemAddress)
|
||||
{
|
||||
return IsMultiGrid(itemAddress.Container.ParentItem);
|
||||
}
|
||||
|
@@ -196,12 +196,12 @@ namespace UIFixes
|
||||
SecondaryItems.Clear();
|
||||
}
|
||||
|
||||
public static IEnumerable<ItemContextClass> ItemContexts
|
||||
public static IEnumerable<DragItemContext> ItemContexts
|
||||
{
|
||||
get { return SelectedItems.Keys; }
|
||||
}
|
||||
|
||||
public static IEnumerable<ItemContextClass> SecondaryContexts
|
||||
public static IEnumerable<DragItemContext> SecondaryContexts
|
||||
{
|
||||
get { return SecondaryItems.Keys; }
|
||||
}
|
||||
@@ -223,15 +223,15 @@ namespace UIFixes
|
||||
|
||||
// Sort the items to prioritize the items that share a grid with the dragged item, prepend the dragContext as the first one
|
||||
// Can pass no itemContext, and it just sorts items by their grid order
|
||||
public static IEnumerable<MultiSelectItemContext> SortedItemContexts(ItemContextClass first = null, bool prepend = true)
|
||||
public static IEnumerable<MultiSelectItemContext> SortedItemContexts(DragItemContext first = null, bool prepend = true)
|
||||
{
|
||||
static int gridOrder(LocationInGrid loc) => 100 * loc.y + loc.x;
|
||||
|
||||
var result = SelectedItems.Keys
|
||||
.Where(ic => first == null || ic.Item != first.Item)
|
||||
.OrderByDescending(ic => ic.ItemAddress is ItemAddressClass)
|
||||
.OrderByDescending(ic => ic.ItemAddress is GridItemAddress)
|
||||
.ThenByDescending(ic => first != null && first.ItemAddress.Container.ParentItem == ic.ItemAddress.Container.ParentItem)
|
||||
.ThenBy(ic => ic.ItemAddress is ItemAddressClass selectedGridAddress ? gridOrder(MultiGrid.GetGridLocation(selectedGridAddress)) : 0);
|
||||
.ThenBy(ic => ic.ItemAddress is GridItemAddress selectedGridAddress ? gridOrder(MultiGrid.GetGridLocation(selectedGridAddress)) : 0);
|
||||
|
||||
if (first != null && prepend)
|
||||
{
|
||||
@@ -272,7 +272,7 @@ namespace UIFixes
|
||||
return ItemContexts.Count(ic => InteractionAvailable(ic, interaction, itemUiContext));
|
||||
}
|
||||
|
||||
private static bool InteractionAvailable(ItemContextClass itemContext, EItemInfoButton interaction, ItemUiContext itemUiContext)
|
||||
private static bool InteractionAvailable(DragItemContext itemContext, EItemInfoButton interaction, ItemUiContext itemUiContext)
|
||||
{
|
||||
// Since itemContext is for "drag", no context actions are allowed. Get the underlying "inventory" context
|
||||
ItemContextAbstractClass innerContext = itemContext.ItemContextAbstractClass;
|
||||
@@ -447,7 +447,7 @@ namespace UIFixes
|
||||
}
|
||||
}
|
||||
|
||||
public class MultiSelectItemContext : ItemContextClass
|
||||
public class MultiSelectItemContext : DragItemContext
|
||||
{
|
||||
public MultiSelectItemContext(ItemContextAbstractClass itemContext, ItemRotation rotation) : base(itemContext, rotation)
|
||||
{
|
||||
@@ -466,7 +466,7 @@ namespace UIFixes
|
||||
return new MultiSelectItemContext(ItemContextAbstractClass, ItemRotation);
|
||||
}
|
||||
|
||||
public void UpdateDragContext(ItemContextClass itemContext)
|
||||
public void UpdateDragContext(DragItemContext itemContext)
|
||||
{
|
||||
SetPosition(itemContext.CursorPosition, itemContext.ItemPosition);
|
||||
ItemRotation = itemContext.ItemRotation;
|
||||
@@ -491,7 +491,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
// used by ItemUiContext.QuickFindAppropriatePlace, the one that picks a container, i.e. ctrl-click
|
||||
// ItemContextClass (drag) defaults to None, but we want what the underlying item allows
|
||||
// DragItemContext (drag) defaults to None, but we want what the underlying item allows
|
||||
public override bool CanQuickMoveTo(ETargetContainer targetContainer)
|
||||
{
|
||||
if (ItemContextAbstractClass != null)
|
||||
|
@@ -34,9 +34,9 @@ namespace UIFixes
|
||||
builder.AppendFormat("Active: <color={0}>{1}</color>\n", MultiSelect.Active ? "green" : "red", MultiSelect.Active);
|
||||
builder.AppendFormat("Items: <color=yellow>{0}</color>\n", MultiSelect.Count);
|
||||
|
||||
foreach (ItemContextClass itemContext in MultiSelect.SortedItemContexts())
|
||||
foreach (DragItemContext itemContext in MultiSelect.SortedItemContexts())
|
||||
{
|
||||
LocationInGrid location = itemContext.ItemAddress is ItemAddressClass gridAddress ? MultiGrid.GetGridLocation(gridAddress) : null;
|
||||
LocationInGrid location = itemContext.ItemAddress is GridItemAddress gridAddress ? MultiGrid.GetGridLocation(gridAddress) : null;
|
||||
builder.AppendFormat("x{0} {1} {2} {3}\n",
|
||||
itemContext.Item.StackObjectsCount,
|
||||
itemContext.ItemAddress.Container.ID,
|
||||
@@ -47,7 +47,7 @@ namespace UIFixes
|
||||
if (MultiSelect.SecondaryContexts.Any())
|
||||
{
|
||||
builder.AppendFormat("Secondary Items: <color=yellow>{0}</color>\n", MultiSelect.SecondaryCount);
|
||||
foreach (ItemContextClass itemContext in MultiSelect.SecondaryContexts)
|
||||
foreach (DragItemContext itemContext in MultiSelect.SecondaryContexts)
|
||||
{
|
||||
builder.AppendFormat("x{0} {1}\n", itemContext.Item.StackObjectsCount, itemContext.Item.ToString());
|
||||
}
|
||||
|
@@ -27,19 +27,19 @@ namespace UIFixes
|
||||
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
StateMachineArray = AccessTools.Field(typeof(GClass1911), "keyCombinationState_1");
|
||||
return AccessTools.Constructor(typeof(GClass1912), [typeof(EGameKey), typeof(ECommand), typeof(ECommand), typeof(int)]);
|
||||
StateMachineArray = AccessTools.Field(typeof(KeyCombination), "keyCombinationState_1");
|
||||
return AccessTools.Constructor(typeof(ToggleKeyCombination), [typeof(EGameKey), typeof(ECommand), typeof(ECommand), typeof(int)]);
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
public static void Postfix(GClass1912 __instance, EGameKey gameKey, ECommand disableCommand, GClass1911.KeyCombinationState[] ___keyCombinationState_1)
|
||||
public static void Postfix(ToggleKeyCombination __instance, EGameKey gameKey, ECommand disableCommand, KeyCombination.KeyCombinationState[] ___keyCombinationState_1)
|
||||
{
|
||||
if (!Settings.ToggleOrHoldAim.Value || gameKey != EGameKey.Aim)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<GClass1911.KeyCombinationState> states = new(___keyCombinationState_1)
|
||||
List<KeyCombination.KeyCombinationState> states = new(___keyCombinationState_1)
|
||||
{
|
||||
new ToggleHoldIdleState(__instance),
|
||||
new ToggleHoldClickOrHoldState(__instance),
|
||||
@@ -54,18 +54,18 @@ namespace UIFixes
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(GClass1911), nameof(GClass1911.UpdateInput));
|
||||
return AccessTools.Method(typeof(KeyCombination), nameof(KeyCombination.UpdateInput));
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
public static void Postfix(GClass1911 __instance)
|
||||
public static void Postfix(KeyCombination __instance)
|
||||
{
|
||||
if (!Settings.ToggleOrHoldAim.Value || __instance.GameKey != EGameKey.Aim)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
__instance.method_0((GClass1911.EKeyState)ToggleHoldState.Idle);
|
||||
__instance.method_0((KeyCombination.EKeyState)ToggleHoldState.Idle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ namespace UIFixes
|
||||
if (caption == EItemInfoButton.Insure.ToString())
|
||||
{
|
||||
InsuranceCompanyClass insurance = ItemUiContext.Instance.Session.InsuranceCompany;
|
||||
int count = MultiSelect.ItemContexts.Select(ic => ItemClass.FindOrCreate(ic.Item))
|
||||
int count = MultiSelect.ItemContexts.Select(ic => InsuranceItem.FindOrCreate(ic.Item))
|
||||
.Where(i => insurance.ItemTypeAvailableForInsurance(i) && !insurance.InsuredItems.Contains(i))
|
||||
.Count();
|
||||
|
||||
@@ -386,10 +386,10 @@ namespace UIFixes
|
||||
InsuranceCompanyClass insurance = new R.ContextMenuHelper(__instance).InsuranceCompany;
|
||||
|
||||
IEnumerable<Item> items = MultiSelect.Active ? MultiSelect.ItemContexts.Select(ic => ic.Item) : [___item_0];
|
||||
IEnumerable<ItemClass> itemClasses = items.Select(ItemClass.FindOrCreate);
|
||||
IEnumerable<ItemClass> insurableItems = itemClasses.SelectMany(insurance.GetItemChildren)
|
||||
IEnumerable<InsuranceItem> InsuranceItemes = items.Select(InsuranceItem.FindOrCreate);
|
||||
IEnumerable<InsuranceItem> insurableItems = InsuranceItemes.SelectMany(insurance.GetItemChildren)
|
||||
.Flatten(insurance.GetItemChildren)
|
||||
.Concat(itemClasses)
|
||||
.Concat(InsuranceItemes)
|
||||
.Where(i => insurance.ItemTypeAvailableForInsurance(i) && !insurance.InsuredItems.Contains(i));
|
||||
|
||||
if (insurableItems.Any())
|
||||
|
@@ -16,15 +16,15 @@ namespace UIFixes
|
||||
// Recreating this function to add the comment section, so calling this with simulate = false doesn't break everything
|
||||
[PatchPrefix]
|
||||
[HarmonyPriority(Priority.Last)]
|
||||
public static bool Prefix(TraderControllerClass __instance, ItemContextAbstractClass itemContext, Item targetItem, bool partialTransferOnly, bool simulate, ref GStruct413 __result)
|
||||
public static bool Prefix(TraderControllerClass __instance, ItemContextAbstractClass itemContext, Item targetItem, bool partialTransferOnly, bool simulate, ref ItemOperation __result)
|
||||
{
|
||||
TraderControllerClass.Struct775 opStruct;
|
||||
TargetItemOperation opStruct;
|
||||
opStruct.targetItem = targetItem;
|
||||
opStruct.traderControllerClass = __instance;
|
||||
opStruct.simulate = simulate;
|
||||
opStruct.item = itemContext.Item;
|
||||
|
||||
Error error = new GClass3317(opStruct.item);
|
||||
Error error = new NoPossibleActionsError(opStruct.item);
|
||||
bool mergeAvailable = itemContext.MergeAvailable;
|
||||
bool splitAvailable = itemContext.SplitAvailable;
|
||||
partialTransferOnly &= splitAvailable;
|
||||
@@ -45,7 +45,7 @@ namespace UIFixes
|
||||
}
|
||||
}
|
||||
|
||||
if (opStruct.targetItem is GInterface321 applicable)
|
||||
if (opStruct.targetItem is IApplicable applicable)
|
||||
{
|
||||
var operation = __instance.method_23(applicable, ref error, ref opStruct);
|
||||
if (operation.Succeeded)
|
||||
|
@@ -192,12 +192,11 @@ namespace UIFixes
|
||||
}
|
||||
}
|
||||
|
||||
// Using GClass because it's easier
|
||||
// Copied from RagFairClass.AddSearchesInRule, but actually all of the properties
|
||||
private void ApplyFullFilter(FilterRule filterRule)
|
||||
{
|
||||
// Order impacts the order the filters show in the UI
|
||||
var searches = new List<GClass3219>();
|
||||
var searches = new List<RagfairSearch>();
|
||||
|
||||
// This part was tricky to figure out. Adding OR removing any of these ID filters will clear the others, so you can only do one of them.
|
||||
// When going to a state with no id filter, you MUST remove something (or all to be safe)
|
||||
|
@@ -21,19 +21,19 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static void Prefix(GClass3219[] searches, ref string __state, HandbookClass ___handbookClass)
|
||||
public static void Prefix(RagfairSearch[] searches, ref string __state, HandbookClass ___handbookClass)
|
||||
{
|
||||
if (!Settings.EnableSlotSearch.Value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GClass3219 search = searches.FirstOrDefault(s => s.Type == EFilterType.LinkedSearch && s.StringValue.Contains(":"));
|
||||
var search = searches.FirstOrDefault(s => s.Type == EFilterType.LinkedSearch && s.StringValue.Contains(":"));
|
||||
if (search != null)
|
||||
{
|
||||
__state = search.StringValue.Split(':')[0];
|
||||
___handbookClass[__state].Data.Id = search.StringValue;
|
||||
searches[searches.IndexOf(search)] = new GClass3219(EFilterType.LinkedSearch, __state, search.Add);
|
||||
searches[searches.IndexOf(search)] = new(EFilterType.LinkedSearch, __state, search.Add);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -113,9 +113,9 @@ namespace UIFixes
|
||||
|
||||
NumberFormatInfo numberFormatInfo = new() { NumberGroupSeparator = " " };
|
||||
|
||||
____roubles.text = GClass2531.GetCurrencyChar(ECurrencyType.RUB) + " " + sums[ECurrencyType.RUB].ToString("N0", numberFormatInfo);
|
||||
____euros.text = GClass2531.GetCurrencyChar(ECurrencyType.EUR) + " " + sums[ECurrencyType.EUR].ToString("N0", numberFormatInfo);
|
||||
____dollars.text = GClass2531.GetCurrencyChar(ECurrencyType.USD) + " " + sums[ECurrencyType.USD].ToString("N0", numberFormatInfo);
|
||||
____roubles.text = CurrencyInfo.GetCurrencyChar(ECurrencyType.RUB) + " " + sums[ECurrencyType.RUB].ToString("N0", numberFormatInfo);
|
||||
____euros.text = CurrencyInfo.GetCurrencyChar(ECurrencyType.EUR) + " " + sums[ECurrencyType.EUR].ToString("N0", numberFormatInfo);
|
||||
____dollars.text = CurrencyInfo.GetCurrencyChar(ECurrencyType.USD) + " " + sums[ECurrencyType.USD].ToString("N0", numberFormatInfo);
|
||||
gpCoins.text = "GP " + sums[ECurrencyType.GP].ToString("N0", numberFormatInfo);
|
||||
|
||||
return false;
|
||||
|
@@ -121,11 +121,11 @@ namespace UIFixes
|
||||
return AccessTools.Method(typeof(ProductionPanel), nameof(ProductionPanel.method_9));
|
||||
}
|
||||
|
||||
// Copied directly from method_9. Working with GClasses directly here, because this would be a nightmare with reflection
|
||||
// Copied directly from method_9
|
||||
[PatchPrefix]
|
||||
public static bool Prefix(ref IEnumerable<GClass1939> __result, ProductionPanel __instance, ProductionBuildAbstractClass[] ___gclass1938_0, ValidationInputField ____searchInputField)
|
||||
public static bool Prefix(ProductionPanel __instance, ref IEnumerable<Scheme> __result, ValidationInputField ____searchInputField)
|
||||
{
|
||||
__result = ___gclass1938_0.OfType<GClass1939>().Where(scheme => !scheme.locked)
|
||||
__result = __instance.R().ProductionBuilds.OfType<Scheme>().Where(scheme => !scheme.locked)
|
||||
.OrderBy(scheme => scheme.endProduct.LocalizedName().Contains(____searchInputField.text) ? 0 : 1) // search-matching items first
|
||||
.ThenBy(__instance.method_18)
|
||||
.ThenBy(scheme => scheme.FavoriteIndex)
|
||||
|
@@ -17,17 +17,6 @@ using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
using BaseItemInfoInteractions = GClass3042;
|
||||
using DestroyError = GClass3344;
|
||||
using GenericItemContext = GClass2833;
|
||||
using GridModificationsUnavailableError = StashGridClass.GClass3315;
|
||||
using ItemOperation = GStruct413;
|
||||
using MoveOperation = GClass2802;
|
||||
using MoveSameSpaceError = InteractionsHandlerClass.GClass3353;
|
||||
using NoOpMove = GClass2795;
|
||||
using NoRoomError = GClass3316;
|
||||
using Stackable = GClass2751;
|
||||
|
||||
namespace UIFixes
|
||||
{
|
||||
public static class MultiSelectPatches
|
||||
@@ -39,7 +28,7 @@ namespace UIFixes
|
||||
private static readonly List<Image> Previews = [];
|
||||
|
||||
// Point that various QuickFindPlace overrides should start at
|
||||
private static ItemAddressClass FindOrigin = null;
|
||||
private static GridItemAddress FindOrigin = null;
|
||||
private static bool FindVerticalFirst = false;
|
||||
|
||||
// Prevents QuickFind from attempting a merge
|
||||
@@ -230,7 +219,7 @@ namespace UIFixes
|
||||
DisableMerge = true;
|
||||
IgnoreItemParent = true;
|
||||
Stack<ItemOperation> operations = new();
|
||||
foreach (ItemContextClass selectedItemContext in MultiSelect.SortedItemContexts())
|
||||
foreach (DragItemContext selectedItemContext in MultiSelect.SortedItemContexts())
|
||||
{
|
||||
ItemOperation operation = itemUiContext.QuickFindAppropriatePlace(selectedItemContext, itemController, false /*forceStash*/, false /*showWarnings*/, false /*simulate*/);
|
||||
if (operation.Succeeded && itemController.CanExecute(operation.Value))
|
||||
@@ -444,7 +433,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static bool Prefix(GridView __instance, ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, ref ItemOperation operation, ref bool __result, ItemUiContext ___itemUiContext_0)
|
||||
public static bool Prefix(GridView __instance, DragItemContext itemContext, ItemContextAbstractClass targetItemContext, ref ItemOperation operation, ref bool __result, ItemUiContext ___itemUiContext_0)
|
||||
{
|
||||
if (InPatch || !MultiSelect.Active)
|
||||
{
|
||||
@@ -485,7 +474,7 @@ namespace UIFixes
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemAddressClass hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
GridItemAddress hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
if (!item.CheckAction(hoveredAddress))
|
||||
{
|
||||
return false;
|
||||
@@ -499,7 +488,7 @@ namespace UIFixes
|
||||
bool allowPartialSuccess = targetItem != null && itemContext.Item is Stackable && MultiSelect.ItemContexts.All(ic => ic.Item.TemplateId == itemContext.Item.TemplateId);
|
||||
|
||||
Stack<ItemOperation> operations = new();
|
||||
foreach (ItemContextClass selectedItemContext in MultiSelect.SortedItemContexts(itemContext))
|
||||
foreach (DragItemContext selectedItemContext in MultiSelect.SortedItemContexts(itemContext))
|
||||
{
|
||||
if (Settings.GreedyStackMove.Value && !isGridPlacement && selectedItemContext.Item.StackObjectsCount > 1)
|
||||
{
|
||||
@@ -648,7 +637,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static bool Prefix(GridView __instance, ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, ref Task __result, ItemUiContext ___itemUiContext_0)
|
||||
public static bool Prefix(GridView __instance, DragItemContext itemContext, ItemContextAbstractClass targetItemContext, ref Task __result, ItemUiContext ___itemUiContext_0)
|
||||
{
|
||||
// Need to fully implement AcceptItem for the sorting table - normally that just uses null targetItemContext
|
||||
if (InPatch && targetItemContext?.Item is SortingTableClass)
|
||||
@@ -667,7 +656,7 @@ namespace UIFixes
|
||||
DisableMerge = targetItemContext == null;
|
||||
|
||||
LocationInGrid hoveredLocation = __instance.CalculateItemLocation(itemContext);
|
||||
ItemAddressClass hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
GridItemAddress hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
|
||||
if (__instance.Grid.ParentItem is SortingTableClass)
|
||||
{
|
||||
@@ -699,7 +688,7 @@ namespace UIFixes
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void MoveToSortingTable(GridView gridView, ItemContextClass itemContext, ItemUiContext itemUiContext)
|
||||
private static void MoveToSortingTable(GridView gridView, DragItemContext itemContext, ItemUiContext itemUiContext)
|
||||
{
|
||||
var itemController = gridView.R().TraderController;
|
||||
|
||||
@@ -818,7 +807,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
Stack<ItemOperation> operations = new();
|
||||
foreach (ItemContextClass itemContext in MultiSelect.SortedItemContexts())
|
||||
foreach (DragItemContext itemContext in MultiSelect.SortedItemContexts())
|
||||
{
|
||||
if (!Settings.GreedyStackMove.Value || itemContext.Item.StackObjectsCount <= 1)
|
||||
{
|
||||
@@ -926,7 +915,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static bool Prefix(TradingTableGridView __instance, ItemContextClass itemContext, ref ItemOperation operation, ref bool __result)
|
||||
public static bool Prefix(TradingTableGridView __instance, DragItemContext itemContext, ref ItemOperation operation, ref bool __result)
|
||||
{
|
||||
if (!MultiSelect.Active)
|
||||
{
|
||||
@@ -943,12 +932,12 @@ namespace UIFixes
|
||||
bool firstItem = true;
|
||||
|
||||
LocationInGrid hoveredLocation = __instance.CalculateItemLocation(itemContext);
|
||||
ItemAddressClass hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
GridItemAddress hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
|
||||
DisableMerge = true;
|
||||
|
||||
Stack<ItemOperation> operations = new();
|
||||
foreach (ItemContextClass selectedItemContext in MultiSelect.SortedItemContexts(itemContext))
|
||||
foreach (DragItemContext selectedItemContext in MultiSelect.SortedItemContexts(itemContext))
|
||||
{
|
||||
if (traderAssortmentController.CanPrepareItemToSell(selectedItemContext.Item))
|
||||
{
|
||||
@@ -956,7 +945,7 @@ namespace UIFixes
|
||||
FindVerticalFirst = selectedItemContext.ItemRotation == ItemRotation.Vertical;
|
||||
|
||||
operation = firstItem ?
|
||||
InteractionsHandlerClass.Move(selectedItemContext.Item, new ItemAddressClass(__instance.Grid, __instance.CalculateItemLocation(selectedItemContext)), traderAssortmentController.TraderController, false) :
|
||||
InteractionsHandlerClass.Move(selectedItemContext.Item, new GridItemAddress(__instance.Grid, __instance.CalculateItemLocation(selectedItemContext)), traderAssortmentController.TraderController, false) :
|
||||
InteractionsHandlerClass.QuickFindAppropriatePlace(selectedItemContext.Item, traderAssortmentController.TraderController, [__instance.Grid.ParentItem as LootItemClass], InteractionsHandlerClass.EMoveItemOrder.Apply, false);
|
||||
|
||||
FindVerticalFirst = false;
|
||||
@@ -1010,7 +999,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static bool Prefix(TradingTableGridView __instance, ItemContextClass itemContext, ref Task __result)
|
||||
public static bool Prefix(TradingTableGridView __instance, DragItemContext itemContext, ref Task __result)
|
||||
{
|
||||
if (!MultiSelect.Active)
|
||||
{
|
||||
@@ -1020,7 +1009,7 @@ namespace UIFixes
|
||||
TraderAssortmentControllerClass traderAssortmentController = __instance.R().TraderAssortmentController;
|
||||
|
||||
LocationInGrid hoveredLocation = __instance.CalculateItemLocation(itemContext);
|
||||
ItemAddressClass hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
GridItemAddress hoveredAddress = new(__instance.Grid, hoveredLocation);
|
||||
|
||||
itemContext.DragCancelled();
|
||||
traderAssortmentController.PrepareToSell(itemContext.Item, hoveredLocation);
|
||||
@@ -1029,7 +1018,7 @@ namespace UIFixes
|
||||
DisableMerge = true;
|
||||
|
||||
// For the rest of the items, still need to use quickfind
|
||||
foreach (ItemContextClass selectedItemContext in MultiSelect.SortedItemContexts(itemContext, false))
|
||||
foreach (DragItemContext selectedItemContext in MultiSelect.SortedItemContexts(itemContext, false))
|
||||
{
|
||||
FindOrigin = GetTargetGridAddress(itemContext, selectedItemContext, hoveredAddress);
|
||||
FindVerticalFirst = selectedItemContext.ItemRotation == ItemRotation.Vertical;
|
||||
@@ -1038,7 +1027,7 @@ namespace UIFixes
|
||||
|
||||
FindVerticalFirst = false;
|
||||
|
||||
if (operation.Failed || operation.Value is not MoveOperation moveOperation || moveOperation.To is not ItemAddressClass gridAddress)
|
||||
if (operation.Failed || operation.Value is not MoveOperation moveOperation || moveOperation.To is not GridItemAddress gridAddress)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1281,16 +1270,16 @@ namespace UIFixes
|
||||
}
|
||||
}
|
||||
|
||||
private static void ShowPreview(GridView gridView, ItemContextClass itemContext, ItemOperation operation)
|
||||
private static void ShowPreview(GridView gridView, DragItemContext itemContext, ItemOperation operation)
|
||||
{
|
||||
ItemAddressClass gridAddress = null;
|
||||
GridItemAddress gridAddress = null;
|
||||
if (operation.Value is MoveOperation moveOperation)
|
||||
{
|
||||
gridAddress = moveOperation.To as ItemAddressClass;
|
||||
gridAddress = moveOperation.To as GridItemAddress;
|
||||
}
|
||||
else if (operation.Value is NoOpMove noopMove)
|
||||
{
|
||||
gridAddress = itemContext.ItemAddress as ItemAddressClass;
|
||||
gridAddress = itemContext.ItemAddress as GridItemAddress;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1313,7 +1302,7 @@ namespace UIFixes
|
||||
ShowPreview(gridView, itemContext, gridAddress, backgroundColor);
|
||||
}
|
||||
|
||||
private static void ShowPreview(GridView gridView, ItemContextClass itemContext, ItemAddressClass gridAddress, Color backgroundColor)
|
||||
private static void ShowPreview(GridView gridView, DragItemContext itemContext, GridItemAddress gridAddress, Color backgroundColor)
|
||||
{
|
||||
Image preview = UnityEngine.Object.Instantiate(gridView.R().HighlightPanel, gridView.transform, false);
|
||||
preview.gameObject.SetActive(true);
|
||||
@@ -1356,8 +1345,8 @@ namespace UIFixes
|
||||
Previews.Clear();
|
||||
}
|
||||
|
||||
private static ItemAddressClass GetTargetGridAddress(
|
||||
ItemContextClass itemContext, ItemContextClass selectedItemContext, ItemAddressClass hoveredGridAddress)
|
||||
private static GridItemAddress GetTargetGridAddress(
|
||||
DragItemContext itemContext, DragItemContext selectedItemContext, GridItemAddress hoveredGridAddress)
|
||||
{
|
||||
if (Settings.MultiSelectStrat.Value == MultiSelectStrategy.FirstOpenSpace)
|
||||
{
|
||||
@@ -1366,8 +1355,8 @@ namespace UIFixes
|
||||
|
||||
if (Settings.MultiSelectStrat.Value == MultiSelectStrategy.OriginalSpacing &&
|
||||
itemContext.Item != selectedItemContext.Item &&
|
||||
itemContext.ItemAddress is ItemAddressClass itemGridAddress &&
|
||||
selectedItemContext.ItemAddress is ItemAddressClass selectedGridAddress &&
|
||||
itemContext.ItemAddress is GridItemAddress itemGridAddress &&
|
||||
selectedItemContext.ItemAddress is GridItemAddress selectedGridAddress &&
|
||||
itemGridAddress.Container.ParentItem == selectedGridAddress.Container.ParentItem)
|
||||
{
|
||||
// Shared a parent with the dragged item - try to keep position
|
||||
|
@@ -53,7 +53,7 @@ namespace UIFixes
|
||||
if (containerCollection.GetContainer(newItem.slotId) is StashGridClass grid)
|
||||
{
|
||||
LocationInGrid location = GClass1496.CreateItemLocation<LocationInGrid>(newItem.location);
|
||||
ItemAddress itemAddress = new ItemAddressClass(grid, location);
|
||||
ItemAddress itemAddress = new GridItemAddress(grid, location);
|
||||
|
||||
GStruct414<GClass2798> operation = InteractionsHandlerClass.Add(item, itemAddress, ___gclass2780_0, false);
|
||||
if (operation.Succeeded)
|
||||
|
@@ -27,7 +27,7 @@ namespace UIFixes
|
||||
|
||||
[PatchPrefix]
|
||||
[HarmonyPriority(Priority.LowerThanNormal)]
|
||||
public static bool Prefix(GridView __instance, ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, ref Task __result)
|
||||
public static bool Prefix(GridView __instance, DragItemContext itemContext, ItemContextAbstractClass targetItemContext, ref Task __result)
|
||||
{
|
||||
return AcceptStackable(__instance, itemContext, targetItemContext, ref __result);
|
||||
}
|
||||
@@ -42,16 +42,16 @@ namespace UIFixes
|
||||
|
||||
[PatchPrefix]
|
||||
[HarmonyPriority(Priority.LowerThanNormal)]
|
||||
public static bool Prefix(SlotView __instance, ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, ref Task __result)
|
||||
public static bool Prefix(SlotView __instance, DragItemContext itemContext, ItemContextAbstractClass targetItemContext, ref Task __result)
|
||||
{
|
||||
return AcceptStackable(__instance, itemContext, targetItemContext, ref __result);
|
||||
}
|
||||
}
|
||||
|
||||
// Specific type of TaskSerializer because Unity can't understand generics
|
||||
public class ItemContextTaskSerializer : TaskSerializer<ItemContextClass> { }
|
||||
public class ItemContextTaskSerializer : TaskSerializer<DragItemContext> { }
|
||||
|
||||
private static bool AcceptStackable<T>(T __instance, ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, ref Task __result) where T : MonoBehaviour, IContainer
|
||||
private static bool AcceptStackable<T>(T __instance, DragItemContext itemContext, ItemContextAbstractClass targetItemContext, ref Task __result) where T : MonoBehaviour, IContainer
|
||||
{
|
||||
if (!Settings.GreedyStackMove.Value || InPatch || itemContext.Item.StackObjectsCount <= 1 || targetItemContext == null)
|
||||
{
|
||||
|
@@ -52,7 +52,7 @@ namespace UIFixes
|
||||
new HideScaryTooltipPatch().Enable();
|
||||
}
|
||||
|
||||
private static bool ValidPrerequisites(ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, IInventoryEventResult operation)
|
||||
private static bool ValidPrerequisites(DragItemContext itemContext, ItemContextAbstractClass targetItemContext, IInventoryEventResult operation)
|
||||
{
|
||||
if (!Settings.SwapItems.Value)
|
||||
{
|
||||
@@ -118,7 +118,7 @@ namespace UIFixes
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool CouldEverFit(ItemContextClass itemContext, ItemContextAbstractClass containerItemContext)
|
||||
private static bool CouldEverFit(DragItemContext itemContext, ItemContextAbstractClass containerItemContext)
|
||||
{
|
||||
Item item = itemContext.Item;
|
||||
if (containerItemContext.Item is not LootItemClass container)
|
||||
@@ -185,7 +185,7 @@ namespace UIFixes
|
||||
return false;
|
||||
}
|
||||
|
||||
if (itemAddressA is ItemAddressClass gridItemAddressA && itemAddressB is ItemAddressClass gridItemAddressB)
|
||||
if (itemAddressA is GridItemAddress gridItemAddressA && itemAddressB is GridItemAddress gridItemAddressB)
|
||||
{
|
||||
LocationInGrid locationA = gridItemAddressA.LocationInGrid;
|
||||
LocationInGrid locationB = gridItemAddressB.LocationInGrid;
|
||||
@@ -219,7 +219,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
public static void Postfix(GridView __instance, ItemContextClass itemContext, ItemContextAbstractClass targetItemContext, ref IInventoryEventResult operation, ref bool __result, Dictionary<string, ItemView> ___dictionary_0)
|
||||
public static void Postfix(GridView __instance, DragItemContext itemContext, ItemContextAbstractClass targetItemContext, ref IInventoryEventResult operation, ref bool __result, Dictionary<string, ItemView> ___dictionary_0)
|
||||
{
|
||||
if (!ValidPrerequisites(itemContext, targetItemContext, operation))
|
||||
{
|
||||
@@ -249,16 +249,16 @@ namespace UIFixes
|
||||
LocationInGrid itemToLocation = __instance.CalculateItemLocation(itemContext);
|
||||
|
||||
// Target is a grid because this is the GridView patch, i.e. you're dragging it over a grid
|
||||
var targetGridItemAddress = targetItemAddress as ItemAddressClass;
|
||||
ItemAddress itemToAddress = new ItemAddressClass(targetGridItemAddress.Grid, itemToLocation);
|
||||
var targetGridItemAddress = targetItemAddress as GridItemAddress;
|
||||
ItemAddress itemToAddress = new GridItemAddress(targetGridItemAddress.Grid, itemToLocation);
|
||||
|
||||
ItemAddress targetToAddress;
|
||||
if (itemAddress is ItemAddressClass gridItemAddress)
|
||||
if (itemAddress is GridItemAddress gridItemAddress)
|
||||
{
|
||||
LocationInGrid targetToLocation = gridItemAddress.LocationInGrid.Clone();
|
||||
targetToLocation.r = targetGridItemAddress.LocationInGrid.r;
|
||||
|
||||
targetToAddress = new ItemAddressClass(gridItemAddress.Grid, targetToLocation);
|
||||
targetToAddress = new GridItemAddress(gridItemAddress.Grid, targetToLocation);
|
||||
}
|
||||
else if (R.SlotItemAddress.Type.IsInstanceOfType(itemAddress))
|
||||
{
|
||||
@@ -286,7 +286,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
// If the target is going to a grid, try rotating it. This address is already a new object, safe to modify
|
||||
if (targetToAddress is ItemAddressClass targetToGridItemAddress)
|
||||
if (targetToAddress is GridItemAddress targetToGridItemAddress)
|
||||
{
|
||||
targetToGridItemAddress.LocationInGrid.r = targetToGridItemAddress.LocationInGrid.r == ItemRotation.Horizontal ? ItemRotation.Vertical : ItemRotation.Horizontal;
|
||||
if (!ItemsOverlap(item, itemToAddress, targetItem, targetToAddress))
|
||||
@@ -369,11 +369,11 @@ namespace UIFixes
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return AccessTools.Method(typeof(ItemContextClass), nameof(ItemContextClass.CanAccept));
|
||||
return AccessTools.Method(typeof(DragItemContext), nameof(DragItemContext.CanAccept));
|
||||
}
|
||||
|
||||
[PatchPostfix]
|
||||
public static void Postfix(ItemContextClass __instance, Slot slot, ItemContextAbstractClass targetItemContext, ref IInventoryEventResult operation, TraderControllerClass itemController, bool simulate, ref bool __result)
|
||||
public static void Postfix(DragItemContext __instance, Slot slot, ItemContextAbstractClass targetItemContext, ref IInventoryEventResult operation, TraderControllerClass itemController, bool simulate, ref bool __result)
|
||||
{
|
||||
// targetItemContext here is not the target item, it's the *parent* context, i.e. the owner of the slot
|
||||
// Do a few more checks
|
||||
@@ -514,8 +514,8 @@ namespace UIFixes
|
||||
{
|
||||
Slot slot = new R.SlotItemAddress(__instance.ItemAddress).Slot;
|
||||
|
||||
// ItemContextClass must be disposed after using, or its buggy implementation causes an infinite loop / stack overflow
|
||||
using ItemContextClass itemUnderCursorContext = itemUnderCursor != null ? new ItemContextClass(itemUnderCursor, ItemRotation.Horizontal) : null;
|
||||
// DragItemContext must be disposed after using, or its buggy implementation causes an infinite loop / stack overflow
|
||||
using DragItemContext itemUnderCursorContext = itemUnderCursor != null ? new DragItemContext(itemUnderCursor, ItemRotation.Horizontal) : null;
|
||||
panel.method_15(slot, itemUnderCursorContext);
|
||||
}
|
||||
}
|
||||
|
6
R.cs
6
R.cs
@@ -26,6 +26,7 @@ namespace UIFixes
|
||||
// Order is significant, as some reference each other
|
||||
UIElement.InitUITypes();
|
||||
UIInputNode.InitUITypes();
|
||||
|
||||
UIContext.InitTypes();
|
||||
DialogWindow.InitTypes();
|
||||
ControlSettings.InitTypes();
|
||||
@@ -135,14 +136,17 @@ namespace UIFixes
|
||||
{
|
||||
public static Type Type { get; private set; }
|
||||
private static FieldInfo SearchInputFieldField;
|
||||
private static FieldInfo ProductionBuildsField;
|
||||
|
||||
public static void InitTypes()
|
||||
{
|
||||
Type = typeof(EFT.Hideout.ProductionPanel);
|
||||
SearchInputFieldField = AccessTools.Field(Type, "_searchInputField");
|
||||
ProductionBuildsField = AccessTools.GetDeclaredFields(Type).Single(t => t.FieldType.GetElementType() == typeof(ProductionBuildAbstractClass));
|
||||
}
|
||||
|
||||
public ValidationInputField SeachInputField { get { return (ValidationInputField)SearchInputFieldField.GetValue(Value); } }
|
||||
public ProductionBuildAbstractClass[] ProductionBuilds { get { return (ProductionBuildAbstractClass[])ProductionBuildsField.GetValue(Value); } }
|
||||
}
|
||||
|
||||
public class ProductionPanelShowSubclass(object value) : Wrapper(value)
|
||||
@@ -270,7 +274,7 @@ namespace UIFixes
|
||||
private static FieldInfo NonInteractableField;
|
||||
private static FieldInfo HighlightPanelField;
|
||||
private static FieldInfo ValidMoveColorField;
|
||||
private static FieldInfo InvalidOperationColorField;
|
||||
private static FieldInfo InvalidOperationColorField;
|
||||
public static void InitTypes()
|
||||
{
|
||||
Type = typeof(EFT.UI.DragAndDrop.GridView);
|
||||
|
@@ -9,7 +9,7 @@ namespace UIFixes
|
||||
Holding = 15
|
||||
}
|
||||
|
||||
public class ToggleHoldIdleState(GClass1911 keyCombination) : GClass1911.KeyCombinationState(keyCombination)
|
||||
public class ToggleHoldIdleState(KeyCombination keyCombination) : KeyCombination.KeyCombinationState(keyCombination)
|
||||
{
|
||||
public override ECommand GetCommand(float deltaTime)
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
HandleKeys(false);
|
||||
KeyCombination.method_0((GClass1911.EKeyState)ToggleHoldState.ClickOrHold);
|
||||
KeyCombination.method_0((KeyCombination.EKeyState)ToggleHoldState.ClickOrHold);
|
||||
return GetCommandInternal();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace UIFixes
|
||||
}
|
||||
}
|
||||
|
||||
public class ToggleHoldClickOrHoldState(GClass1911 keyCombination) : GClass1911.KeyCombinationState(keyCombination)
|
||||
public class ToggleHoldClickOrHoldState(KeyCombination keyCombination) : KeyCombination.KeyCombinationState(keyCombination)
|
||||
{
|
||||
public override void Enter()
|
||||
{
|
||||
@@ -45,7 +45,7 @@ namespace UIFixes
|
||||
HandleKeys(false);
|
||||
if (LongEnough(deltaTime))
|
||||
{
|
||||
KeyCombination.method_0((GClass1911.EKeyState)ToggleHoldState.Holding);
|
||||
KeyCombination.method_0((KeyCombination.EKeyState)ToggleHoldState.Holding);
|
||||
}
|
||||
|
||||
return ECommand.None;
|
||||
@@ -53,7 +53,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
UnhandleKeys(null);
|
||||
KeyCombination.method_0((GClass1911.EKeyState)ToggleHoldState.Idle);
|
||||
KeyCombination.method_0((KeyCombination.EKeyState)ToggleHoldState.Idle);
|
||||
return ECommand.None;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace UIFixes
|
||||
private float timer;
|
||||
}
|
||||
|
||||
public class ToggleHoldHoldState(GClass1911 keyCombination, ECommand disableCommand) : GClass1911.KeyCombinationState(keyCombination)
|
||||
public class ToggleHoldHoldState(KeyCombination keyCombination, ECommand disableCommand) : KeyCombination.KeyCombinationState(keyCombination)
|
||||
{
|
||||
private readonly ECommand disableCommand = disableCommand;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace UIFixes
|
||||
}
|
||||
|
||||
UnhandleKeys(null);
|
||||
KeyCombination.method_0((GClass1911.EKeyState)ToggleHoldState.Idle);
|
||||
KeyCombination.method_0((KeyCombination.EKeyState)ToggleHoldState.Idle);
|
||||
return disableCommand;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user