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)
|
if (Settings.GreedyStackMove.Value && !isGridPlacement && selectedItemContext.Item.StackObjectsCount > 1)
|
||||||
{
|
{
|
||||||
|
int originalStackCount = selectedItemContext.Item.StackObjectsCount;
|
||||||
int stackCount = int.MaxValue;
|
int stackCount = int.MaxValue;
|
||||||
bool failed = false;
|
bool failed = false;
|
||||||
while (selectedItemContext.Item.StackObjectsCount > 0)
|
while (selectedItemContext.Item.StackObjectsCount > 0)
|
||||||
@@ -498,6 +499,13 @@ namespace UIFixes
|
|||||||
{
|
{
|
||||||
operations.Push(operation);
|
operations.Push(operation);
|
||||||
}
|
}
|
||||||
|
else if (stackCount < originalStackCount)
|
||||||
|
{
|
||||||
|
// Some succeeded, so stop but not a failure
|
||||||
|
__result = true;
|
||||||
|
operation = default;
|
||||||
|
break;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (operation.Error is GClass3292 noRoomError)
|
if (operation.Error is GClass3292 noRoomError)
|
||||||
@@ -706,10 +714,6 @@ namespace UIFixes
|
|||||||
return;
|
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)
|
if (DisableMerge)
|
||||||
{
|
{
|
||||||
order &= ~InteractionsHandlerClass.EMoveItemOrder.TryMerge;
|
order &= ~InteractionsHandlerClass.EMoveItemOrder.TryMerge;
|
||||||
@@ -836,6 +840,7 @@ namespace UIFixes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int originalStackCount = itemContext.Item.StackObjectsCount;
|
||||||
int stackCount = int.MaxValue;
|
int stackCount = int.MaxValue;
|
||||||
bool failed = false;
|
bool failed = false;
|
||||||
while (itemContext.Item.StackObjectsCount > 0)
|
while (itemContext.Item.StackObjectsCount > 0)
|
||||||
@@ -852,6 +857,13 @@ namespace UIFixes
|
|||||||
{
|
{
|
||||||
operations.Push(operation);
|
operations.Push(operation);
|
||||||
}
|
}
|
||||||
|
else if (stackCount < originalStackCount)
|
||||||
|
{
|
||||||
|
// Some succeeded, stop but not failure
|
||||||
|
__result = true;
|
||||||
|
operation = default;
|
||||||
|
break;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Need to double-break
|
// Need to double-break
|
||||||
|
|||||||
Reference in New Issue
Block a user