Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a hotkey to select the current production facility #17490

Merged

Conversation

@dragunoff
Copy link
Contributor

dragunoff commented Dec 21, 2019

The hotkey works like this:

  • Selects the facility associated with the current production tab (the primary building in classic queues)
  • If the building is already selected (i.e. doble-tap the hotkey) - center the viewport on the facility

The second commit binds the hotkey to Tab and changes the binding for "Next facility" hotkey to Ctrl + Tab (I think Ctrl+Tab is better suited for cycling). I'd be fine with leaving it undefined if that's controversial.

Remarks:

  • In case of classic queues the most recently constructed facility gets selected
  • In case of different buildings that operate on the same queue (barracks and kennel in RA) the most recently constructed one is selected
  • In both cases the primary building is selected if the player has manually set one
  • This hotkey is most useful with multiple production queues (e.g. in Tiberian Dawn) because in mid to late-game it's quite common to have a lot of facilities scattered across the map and it's difficult to locate them and rally the production

Closes #5486
Closes #15842

Copy link
Member

Mailaender left a comment

Works as promised.

Copy link
Member

pchote left a comment

Looks good overall, just a couple of minor requests.
Adding to the milestone because this shouldn't add much more review overhead and it fits well with the other hotkey changes that are already in.

mods/common/hotkeys/production-common.yaml Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs Outdated Show resolved Hide resolved
@pchote pchote added this to the Next Release milestone Feb 16, 2020
@dragunoff dragunoff force-pushed the dragunoff:feature/select-current-production-facility branch from d8795f8 to 9b97dc5 Feb 19, 2020
var facility = CurrentQueue.MostLikelyProducer().Actor;

if (facility == null)
return true;

This comment has been minimized.

Copy link
@dragunoff

dragunoff Feb 19, 2020

Author Contributor

Had to put this null check here because this was crashing mods with classic production when using the hotkey at the start of the game (before the MCV is unpacked).

@pchote
pchote approved these changes Feb 22, 2020
@pchote pchote merged commit 2e8740d into OpenRA:bleed Feb 22, 2020
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@dragunoff dragunoff deleted the dragunoff:feature/select-current-production-facility branch Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.