allow partial transfers in multiselect
This commit is contained in:
@@ -483,6 +483,7 @@ namespace UIFixes
|
||||
{
|
||||
if (Settings.GreedyStackMove.Value && !isGridPlacement && selectedItemContext.Item.StackObjectsCount > 1)
|
||||
{
|
||||
int originalStackCount = selectedItemContext.Item.StackObjectsCount;
|
||||
int stackCount = int.MaxValue;
|
||||
bool failed = false;
|
||||
while (selectedItemContext.Item.StackObjectsCount > 0)
|
||||
@@ -498,6 +499,13 @@ namespace UIFixes
|
||||
{
|
||||
operations.Push(operation);
|
||||
}
|
||||
else if (stackCount < originalStackCount)
|
||||
{
|
||||
// Some succeeded, so stop but not a failure
|
||||
__result = true;
|
||||
operation = default;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (operation.Error is GClass3292 noRoomError)
|
||||
@@ -706,10 +714,6 @@ namespace UIFixes
|
||||
return;
|
||||
}
|
||||
|
||||
// Multiselect always disables "Transfer", which is a partial merge
|
||||
// It leaves things behind and that's not intuitive when multi-selecting
|
||||
// order &= ~PartialMerge;
|
||||
|
||||
if (DisableMerge)
|
||||
{
|
||||
order &= ~InteractionsHandlerClass.EMoveItemOrder.TryMerge;
|
||||
@@ -836,6 +840,7 @@ namespace UIFixes
|
||||
}
|
||||
else
|
||||
{
|
||||
int originalStackCount = itemContext.Item.StackObjectsCount;
|
||||
int stackCount = int.MaxValue;
|
||||
bool failed = false;
|
||||
while (itemContext.Item.StackObjectsCount > 0)
|
||||
@@ -852,6 +857,13 @@ namespace UIFixes
|
||||
{
|
||||
operations.Push(operation);
|
||||
}
|
||||
else if (stackCount < originalStackCount)
|
||||
{
|
||||
// Some succeeded, stop but not failure
|
||||
__result = true;
|
||||
operation = default;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Need to double-break
|
||||
|
Reference in New Issue
Block a user