Skip to content

Refactor previous/next target selection, add targeting keybinds#2841

Open
oznogon wants to merge 2 commits intodaid:masterfrom
oznogon:2703-target-cycle-keybinds
Open

Refactor previous/next target selection, add targeting keybinds#2841
oznogon wants to merge 2 commits intodaid:masterfrom
oznogon:2703-target-cycle-keybinds

Conversation

@oznogon
Copy link
Copy Markdown
Contributor

@oznogon oznogon commented Apr 7, 2026

Refactor TargetsContainer to handle sequentially selecting targets by their distance from the player, and by friend-or-foe relationship or other custom criteria. Add missing target selection keybinds to Weapons, Science, and Relay.

  • Centralize target set population logic used by setPrev/Next().
  • Add public setPrev/Next() overloads to pass a function override for the iteration method.
  • Add KnownFriendOrFoe enum to TargetsContainer to handle logic for building target sets by their FoF state and faction relationship to the player. This replaces the FactionRelation parameter in setPrev/Next() overloads to allow more granular selections that include or exclude entities with not-yet-known faction or FoF relationships.
  • Add prev/next selection keybinds for Weapons, Science, and Relay.
    • Add prev keybind for Weapons target and hostile target selection.
    • Add prev keybind for Science scannable target selection.
    • Add next/prev keybinds for Science target and hostile target selection.
    • Add next/prev keybinds for Relay target, hostile target, hackable target, and launched probe selection. This includes logic for selecting only targets within shared short-range radars, which relies on the new function-defined setPrev/Next().
    • Copy new/revised Weapons keybinds to Tactical and SinglePilot. (Operations inherits Science binds and doesn't need Relay's prev/next binds.)

This DOES NOT CHANGE EXISTING BEHAVIORS and DOES NOT SET DEFAULT INPUTS for these new hotkeys.

Fixes #2703 by refactoring range and hostile checks.

oznogon and others added 2 commits April 7, 2026 13:32
Refactor TargetsContainer to handle sequentially selecting targets
by their distance from the player.

- Centralize target set population logic used by setPrev/Next().
- Add public setNext/Prev() overloads to pass a function override
  for the iteration method.
- Add KnownFriendOrFoe enum to TargetsContainer to handle logic for
  building target sets by their FoF state and faction relationship
  to the player. This replaces the `FactionRelation` parameter in
  setNext/Prev() overloads to allow more granular selections that
  include or exclude entities with not-yet-known faction or FoF
  relationships.
- Add prev/next selection keybinds for Weapons, Science, and Relay.
  - Add prev keybind for Weapons target and hostile target.
  - Add prev keybind for Science scannable target.
  - Add next/prev keybinds for Science target, hostile target.
  - Add next/prev keybinds for Relay targetable, hostile target,
    hackable target, and launched probes. This includes logic for
    selecting only targets within shared short-range radars.
  - Copy new/revised Weapons keybinds to Tactical and SinglePilot.
@oznogon
Copy link
Copy Markdown
Contributor Author

oznogon commented Apr 7, 2026

Incorporated #2840, sorry @gwaland, didn't see that until after I'd opened the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] "Next hostile target" Weapons keybind selects targets outside of radar range

2 participants