Opened 8 years ago

Last modified 16 months ago

#1492 new enhancement

[PATCH] working hotkeys for building, training, un- & garrisoning, formation & stance

Reported by: picobyte Owned by:
Priority: Nice to Have Milestone: Backlog
Component: UI – In-game Keywords: patch
Cc: Patch:

Description

See default.cfg: The keys H to backslash are implemented as numbers for hotkey actions. to control the actions for currently selected buildings or workers/units. Modified behaviour: watermark and camera reset hotkeys are altered.

For example to build a house: select a villager (with mouse or with idle hot-key '.') J, H and select the location to place the house.

H is garrison for all units. For a villager the option to build is J. For buildings, K and L are train and ungarrison respectively. Military units can use K, L for formation and stance. barter and trader options aren't implemented yet.

The second press of the H to backslash button has a different meaning: It indicates how many' or which', in the same order as the buttons in the user interface. From H to backslash means 0 to 6, with shift, capital H to doublequote means 7-12. Except when garrisoning, then H to backslash means garrisoning 1 to 7 units.

Attachments (8)

hotkeys.patch (22.5 KB) - added by picobyte 8 years ago.
hot patch
hotkeys2.patch (15.5 KB) - added by picobyte 8 years ago.
incremental patch, fixes some issues and improves behavior
hotkeys3.patch (5.8 KB) - added by picobyte 8 years ago.
fixes a few bugs
hotkeys4.patch (4.7 KB) - added by picobyte 8 years ago.
Allows hotkeys shift ./,/U/I/O/P to slect all idle villagers/warriors or building types (with my previous patch)
hotkeys5.patch (3.5 KB) - added by picobyte 8 years ago.
This allows two actions: to follow units when unload all hotkey is pressed and to ungarrison n units. hotkey J = 1, K = 2, etc.
hotkeys6.patch (40.0 KB) - added by picobyte 8 years ago.
Default available actions dependent on selection, non-default actions remapped
hotkeys_total.2.patch (35.3 KB) - added by picobyte 8 years ago.
hotkeys_total.patch (125.2 KB) - added by picobyte 8 years ago.
latest, shift+ A,S,W,D for mouse cursor movement (e.g. for placing buildings)

Download all attachments as: .zip

Change History (27)

Changed 8 years ago by picobyte

Attachment: hotkeys.patch added

hot patch

comment:1 Changed 8 years ago by picobyte

Cc: roel.kluin@… added
Component: Core engineUI & Simulation
Priority: Should HaveMust Have

comment:2 Changed 8 years ago by picobyte

Summary: [PATCH] working hotkeys for building, training, formation & stance[PATCH] working hotkeys for building, training, un- & garrisoning, formation & stance

Changed 8 years ago by picobyte

Attachment: hotkeys2.patch added

incremental patch, fixes some issues and improves behavior

Changed 8 years ago by picobyte

Attachment: hotkeys3.patch added

fixes a few bugs

comment:3 Changed 8 years ago by picobyte

Owner: set to picobyte

Changed 8 years ago by picobyte

Attachment: hotkeys4.patch added

Allows hotkeys shift ./,/U/I/O/P to slect all idle villagers/warriors or building types (with my previous patch)

Changed 8 years ago by picobyte

Attachment: hotkeys5.patch added

This allows two actions: to follow units when unload all hotkey is pressed and to ungarrison n units. hotkey J = 1, K = 2, etc.

Changed 8 years ago by picobyte

Attachment: hotkeys6.patch added

Default available actions dependent on selection, non-default actions remapped

comment:4 Changed 8 years ago by picobyte

Changelog:

Date: Thu Jun 14 00:54:35 2012 +0200

This implements the V, B, N and M hotkeys for non-default actions Stance, Formation, garrison, ungarrison respectively

Date: Wed Jun 13 23:25:14 2012 +0200

Generalize All unloaded following

Date: Wed Jun 13 22:45:44 2012 +0200

This patch makes a default choice active. e.g. for a worker the default action is to build, for a building to train. keys G to singlequote are implemented as choices. Setting non-default options aren't available anymore but a next patch will implement hotkeys for that.

Date: Wed Jun 13 20:35:27 2012 +0200

as suggested by historic_bruno the backslash isn't always in line Also use Ctrl rather than shift for the 7+ keys (we may want to use shift for batchtrain later).

Date: Wed Jun 13 20:16:55 2012 +0200

Unload all from all selected buildings, ensure selection occurs

Date: Wed Jun 13 01:59:38 2012 +0200

This allows two actions: to follow units when unload all hotkey is pressed and to ungarrison n units. hotkey J = 1, K = 2, etc.

Date: Tue Jun 12 01:24:00 2012 +0200

Find all visible idle workers,warriors,buildings with Shift ./,/U/etc

Date: Mon Jun 11 00:20:19 2012 +0200

during building placement we can now correctly select another idle villager for the job.

Date: Sun Jun 10 21:37:36 2012 +0200

Building placement is now shown immediately, not after mouse movement. User can use the same several hotkey more times, e.g. for training. Or for iterate over the possible options using hotkeys, changing the Formation or Stance of the selected units or choosing different buildings during placement.

Formation fix: don't allow hotkey if selection is only one unit

Add forwardslash as hotkey to reset action hotkey

Last edited 8 years ago by picobyte (previous) (diff)

comment:5 Changed 8 years ago by picobyte

Milestone: BacklogAlpha 11

comment:6 Changed 8 years ago by historic_bruno

Keywords: patch review added; hotkeys building training formation stance removed

comment:7 Changed 8 years ago by historic_bruno

Can you attach a single cumulative patch?

Changed 8 years ago by picobyte

Attachment: hotkeys_total.2.patch added

comment:8 Changed 8 years ago by picobyte

dang now there's two total patches.

comment:9 Changed 8 years ago by picobyte

Cc: roel.kluin@… removed
Owner: picobyte deleted
Priority: Must HaveNice to Have

Changed 8 years ago by picobyte

Attachment: hotkeys_total.patch added

latest, shift+ A,S,W,D for mouse cursor movement (e.g. for placing buildings)

comment:10 Changed 8 years ago by picobyte

Since no one seems to pick this up, am I doing something wrong?

comment:11 Changed 8 years ago by Kieran P

Hey. Thanks for your work. Your changes are quite big, and we're short on developers able to review it at the moment. It will get reviewed eventually.

Last edited 8 years ago by Kieran P (previous) (diff)

comment:12 Changed 8 years ago by picobyte

Ok, if I need to do something like split this up in more tickets, provide patches in a different format, please let me know. BTW I apply this patch by running from the 0ad directory:

patch -p1 < path/to/hotkeys_total.patch

Last edited 8 years ago by picobyte (previous) (diff)

comment:13 Changed 8 years ago by Jonathan Waller

Sorry for the delay in replying. I have failed to get this to apply cleanly. Could you create a patch with monolithic changesets? My patch software doesn't like the multiple changesets per file (even running your recommended command on Linux doesn't work).

comment:14 in reply to:  12 Changed 8 years ago by historic_bruno

I think the problem is they are git serial patches. It will be far easier to apply them with git.

Replying to picobyte:

Ok, if I need to do something like split this up in more tickets, provide patches in a different format, please let me know

Indeed, it might be best if you could separate this into a few tickets. I notice there are a variety of new features added, rather than just hotkeys as the summary implies. If you could upload a patch just with hotkeys for existing features, then add new tickets for new features and hotkeys, that would be great.

I'm not saying we wouldn't review the patch(es) as-is, but that could help expedite the process.

comment:15 Changed 8 years ago by Kieran P

Milestone: Alpha 11Alpha 12

comment:16 Changed 8 years ago by historic_bruno

Keywords: review removed
Milestone: Alpha 12Backlog

comment:17 Changed 8 years ago by historic_bruno

I can't apply these patches, no matter what I try, git doesn't seem to like them either.

comment:18 Changed 4 years ago by elexis

Some feedback after reading all the different kinds of broken patches uploaded:

  • the findEntity change seems nice and could be reused for other things as well (f.e. selecting a civic center of the viewed player when changing the perspective in observermode)
  • You add hotkeys to select a civic center, structure, dropsites, markets, but not barracks and fortress??
  • Not convinced to use J to unload one unit, K for two etc.. It seems the player should just press that button multiple times to unload multiple units, as noone will recall which button stands for which number. (However unloading consecutively likely means messing up your idea to follow units after unloading).
  • using preSelectedAction indeed seems to be the way to go to avoid hotkey conflicts (i.e. one hotkey to enter contruction mode, then another hotkey to select that building) Those ACTION_FOO states look like they shouldn't be flags that can be combined, but should rather be in only one state at the time (i.e. 0, 1, 2, ... could have been used).
  • GameView.cpp adds nothing but unmarked TODOs

Unfortunately the patches are completely inapplicable and I'm not sure all the things you implemented are wanted. #1312 aims at adding building hotkeys. #1899 deals with selecting entities.

comment:19 Changed 16 months ago by Imarok

Component: UI & SimulationIn-game UI

Move tickets to In-game UI as UI & Simulation got some sub components.

Note: See TracTickets for help on using tickets.