Opened 2 years ago

Closed 21 months ago

Last modified 17 months ago

#4008 closed enhancement (fixed)

[PATCH] Missing unit action hotkeys

Reported by: elexis Owned by:
Priority: Nice to Have Milestone: Alpha 21
Component: UI & Simulation Keywords: simple patch
Cc: Patch:

Description (last modified by Imarok)

There are hotkeys for almost all unit actions (destroy, garrison, guard, ...), but some are missing: back-to-work, heal and capture. They should be added for completeness.

The most problematic part will be finding an unused key for back-to-work, see default.cfg. (heal and capture should be set to unused(#3051), as they are the default actions)

The files to modify can be found in binaries/data/mod/public/gui/session/. unit_actions.js should show that hotkey in the tooltips, see also r18252.

Attachments (7)

missingunitactionhotkeys.patch (4.8 KB) - added by Sandarac 2 years ago.
Adds hotkeys as suggested by Imarok, and "Y" for rally point focusing
missingunitactionhotkeys_v2.patch (5.2 KB) - added by Imarok 2 years ago.
This is a fixed and rebased version of your patch
missingunitactionhotkeys_v2.1.patch (5.2 KB) - added by Imarok 2 years ago.
Uses "J" for repairing
missingunitactionhotkeys_v2.2.patch (5.2 KB) - added by Imarok 2 years ago.
Setting the rallypoint focus hotkey to unused (refs #3051)
missingunitactionhotkeys_v2.3.patch (6.5 KB) - added by Imarok 23 months ago.
Fixed some style mentioned by elexis in irc today
4008_back_to_work.patch (2.6 KB) - added by Imarok 22 months ago.
Add a hotkey for back-to-work
4008_back_to_work_v1.1.patch (2.7 KB) - added by Imarok 22 months ago.
Removed the dot

Download all attachments as: .zip

Change History (24)

comment:1 Changed 2 years ago by Imarok

What about Alt + Right click for repairing and 'U' for unloading?

comment:2 Changed 2 years ago by elexis

That seems ok to me (especially since garrisoning works like that too).

comment:3 Changed 2 years ago by Sandarac

Keywords: review patch added
Milestone: BacklogAlpha 21
Summary: Missing unit action hotkeys[PATCH] Missing unit action hotkeys

Changed 2 years ago by Sandarac

Adds hotkeys as suggested by Imarok, and "Y" for rally point focusing

comment:4 Changed 2 years ago by elexis

Notice #1720 suggesting Y = patrol, but maybe that one can use "P" as that seems to be unused for now.

comment:5 Changed 2 years ago by elexis

Not sure whether we actually need an assigned key for the rallypoint. With #3051 / #3990 it could add an unassigned hotkey that could be assigned by people who really want that.

comment:6 Changed 2 years ago by Imarok

  • Your patch only adds the repair hotkey when setting up a rallypoint. When commanding a unit it doesn't work.
Last edited 2 years ago by Imarok (previous) (diff)

Changed 2 years ago by Imarok

This is a fixed and rebased version of your patch

comment:7 Changed 2 years ago by elexis

Keywords: review removed

A repair hotkey should certainly work too when selecting units. It should have the same effect as when clicking on that button.

This however will conflict with other uses of Alt, for example Alt+doubleclick means selecting all units of that kind.

Changed 2 years ago by Imarok

Uses "J" for repairing

comment:8 Changed 2 years ago by Imarok

Keywords: review added

Changed 2 years ago by Imarok

Setting the rallypoint focus hotkey to unused (refs #3051)

Changed 23 months ago by Imarok

Fixed some style mentioned by elexis in irc today

comment:9 Changed 23 months ago by elexis

In 18578:

Hotkeys to repair, ungarrison and focus on the rallypoint. Patch by Imarok, refs #4008.

comment:10 Changed 23 months ago by elexis

Keywords: review removed
Milestone: Alpha 21Backlog
Type: defectenhancement

Changes to the committed patch:

  • Repairing is also expected to work with foundations
  • It is unexpected that the hotkey does something other than pressing it does. But since this is the case for the other unit action buttons, we'll go with it.
  • default.cfg: Ungarrisoning isn't a modifier.
  • Using ["Player", "Ally"] instead of ["Ally"] for consistency (despite not being mandatory). Not switching to MutualAlly since the simulation checks for Ally too.
  • Notice the repair hotkey is actually useful and not equivalent to a simple right click as it allows forcing units to repair a building even if they could dropoff carried resources or capture it.
  • Updated wiki:HotKeys.

Remaining TODO:

  • No hotkey for back-to-work. That should be a useful one.
  • Heal, capture, returnresource don't have hotkeys. Not sure if they are useful. Capture hotkeys probably, since a unit might be repairable and capturable at the same time f.e..

comment:11 Changed 22 months ago by Imarok

Description: modified (diff)
Keywords: patch removed
Summary: [PATCH] Missing unit action hotkeysMissing unit action hotkeys

Changed 22 months ago by Imarok

Attachment: 4008_back_to_work.patch added

Add a hotkey for back-to-work

comment:12 Changed 22 months ago by Imarok

Keywords: review patch added
Milestone: BacklogAlpha 21
Summary: Missing unit action hotkeys[PATCH] Missing unit action hotkeys

comment:13 Changed 22 months ago by fatherbushido

  • Can you argue for the choice of the Y key ?
  • Perhaps you can remove the dot at the end of L72 binaries/data/mods/public/gui/manual/intro.txt (it's not in your patch but...)
Last edited 22 months ago by fatherbushido (previous) (diff)

Changed 22 months ago by Imarok

Removed the dot

comment:14 Changed 21 months ago by elexis

In 18747:

Back to work hotkey. Patch by Imarok, refs #4008.

comment:15 Changed 21 months ago by elexis

Keywords: review removed
Resolution: fixed
Status: newclosed

Thanks for all the patches! Closing the ticket as good enough for now. If we have the hotkey dialog, we can think about adding more.

comment:16 Changed 17 months ago by elexis

(14:42:00) Grugnas: the only annoying thing is that u have to hold J for order your units to repair
(14:42:14) Grugnas: pressing it 1 time only would be more comfortable

should be possible by calling g_EntityCommands.repair.execute() if the hotkey is pressed instead of having it depend dynamically on the hotkey state like the garrison hotkey.

comment:17 Changed 17 months ago by Imarok

I think this behaviour would be inconsistent

Note: See TracTickets for help on using tickets.