beyond-all-reason / beyond-all-reason/RecoilEngine
Add a select command filter for previous selection
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
I was trying to answer a [question](https://discord.com/channels/549281623154229250/858397131148623892/1196162701680967730) about selecting the opposite of half-of-selected-units (the half selector being Ctrl+q in grid keys, or `select PrevSelection++_ClearSelection_SelectPart_50+`), and came up with what I thought was a solution:
`select AllMap+_InGroup_1_Not_InPrevSel+_ClearSelection_SelectAll+`
I imagined that this would select all units in the given control group (1 in this case) that are not currently selected.
But this doesn't work, because `InPrevSel` is actually this:
> Keep only units of the same type (unitDefID) as any unit in the selection before this select command was run.
which does not really match the name of the filter. It seems unlikely we'd change `InPrevSel` due to backwards compatibility concerns, but I think adding a filter for previously selected units would be helpful. (edit: to be more precise, a filter that works with the same concept as the `PrevSelection` source, but as a filter so it can be negated)
Contributor guide
Research direction
Start with the select command filter implementation and the PrevSelection source named in the issue, then compare their semantics with InPrevSel. Trace how filters are negated and identify the relevant selection-command tests, if present. Done means a filter can match units from the previous selection and be negated in a select command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100