Try to block swapping to traders even if other mods allow it

This commit is contained in:
Tyfon
2024-05-15 02:26:00 -07:00
parent 275aabbc5c
commit a93fcd0e6b

View File

@@ -46,6 +46,8 @@ namespace UIFixes
// The most recent GridItemView that was hovered - needed to forcibly update hover state after swap
private static GridItemView LastHoveredGridItemView;
private static EOwnerType[] BannedOwnerTypes = [EOwnerType.Mail, EOwnerType.Trader];
public static void Enable()
{
GridItemAddressType = PatchConstants.EftTypes.First(t => typeof(ItemAddress).IsAssignableFrom(t) && t.GetProperty("Grid") != null); // GClass2769
@@ -92,6 +94,11 @@ namespace UIFixes
return false;
}
if (BannedOwnerTypes.Contains(itemContext.Item.Owner.OwnerType) || BannedOwnerTypes.Contains(targetItemContext.Item.Owner.OwnerType))
{
return false;
}
if (itemContext.Item == targetItemContext.Item || targetItemContext.Item.GetAllParentItems().Contains(itemContext.Item))
{
return false;