Fixed mangled grids in hideout

This commit is contained in:
Tyfon
2024-07-11 11:59:13 -07:00
parent 0629ebae70
commit a4f1590b5d
3 changed files with 43 additions and 58 deletions

32
ExtraProperties.cs Normal file
View File

@@ -0,0 +1,32 @@
using EFT.InventoryLogic;
using EFT.UI.DragAndDrop;
using System.Runtime.CompilerServices;
namespace UIFixes
{
public static class ExtraItemProperties
{
private static readonly ConditionalWeakTable<Item, Properties> properties = new();
private class Properties
{
public bool Reordered;
}
public static bool GetReordered(this Item item) => properties.GetOrCreateValue(item).Reordered;
public static void SetReordered(this Item item, bool value) => properties.GetOrCreateValue(item).Reordered = value;
}
public static class ExtraTemplatedGridsViewProperties
{
private static readonly ConditionalWeakTable<TemplatedGridsView, Properties> properties = new();
private class Properties
{
public bool Reordered;
}
public static bool GetReordered(this TemplatedGridsView gridsView) => properties.GetOrCreateValue(gridsView).Reordered;
public static void SetReordered(this TemplatedGridsView gridsView, bool value) => properties.GetOrCreateValue(gridsView).Reordered = value;
}
}