Ensure selection is preserved when moving selection between columns #29899
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #29793.
I believe that the sequence of events that makes this happens is as follows:
User selects a range of objects. Some of those objects are off-screen, and thus would be presumed to be not alive - except the blueprint container forces them to remain alive, because they're part of the selection.
User moves the selection to another column, which is implemented by temporarily removing the objects from the playfield, changing their column, and re-adding them.
This sort of pattern is supposed to kick off the
HitObjectUsageTransferred
flow inHitObjectUsageEventBuffer
- and it does... for objects that are currently visible on screen and thus would be alive regardless ofSetKeepAlive()
. However, this does not hold for objects that are off-screen - nothing ensures they are kept alive again after re-adding, and thus they inadvertently become dead.Thus, this doesn't kick off the
BlueprintContainer
flows associated with transferring objects to another column, and instead fires the removal flows, which ensure that the off-screen objects that were being moved are instead deselected.I tried a few other options but found no better resolution than this - calling
SetKeepAlive()
directly would require making it public, which seems like a bad idea. There's really no good way to generically handle this either, because it is the ruleset that decides that its way of implementing this operation will be a removal and re-add of objects, so...