Opened 8 years ago

Closed 8 years ago

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

Download all attachments as: .zip

Change History (24)

comment:1 by Imarok, 8 years ago

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

comment:2 by elexis, 8 years ago

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

comment:3 by Sandarac, 8 years ago

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

by Sandarac, 8 years ago

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

comment:4 by elexis, 8 years ago

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

comment:5 by elexis, 8 years ago

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 by Imarok, 8 years ago

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

by Imarok, 8 years ago

This is a fixed and rebased version of your patch

comment:7 by elexis, 8 years ago

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.

by Imarok, 8 years ago

Uses "J" for repairing

comment:8 by Imarok, 8 years ago

Keywords: review added

by Imarok, 8 years ago

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

by Imarok, 8 years ago

Fixed some style mentioned by elexis in irc today

comment:9 by elexis, 8 years ago

In 18578:

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

comment:10 by elexis, 8 years ago

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 by Imarok, 8 years ago

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

by Imarok, 8 years ago

Attachment: 4008_back_to_work.patch added

Add a hotkey for back-to-work

comment:12 by Imarok, 8 years ago

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

comment:13 by fatherbushido, 8 years ago

  • 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...)
Version 0, edited 8 years ago by fatherbushido (next)

by Imarok, 8 years ago

Removed the dot

comment:14 by elexis, 8 years ago

In 18747:

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

comment:15 by elexis, 8 years ago

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 by elexis, 7 years ago

(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 by Imarok, 7 years ago

I think this behaviour would be inconsistent

Note: See TracTickets for help on using tickets.