Opened 14 months ago

Last modified 14 months ago

#6748 new defect

Unit hotkeys: UI and implementation errors

Reported by: Alex Theodoulidis Owned by:
Priority: Must Have Milestone: Alpha 27
Component: UI & Simulation Keywords: Hotkeys
Cc: Alex Theodoulidis Patch:

Description

Civilization: Iberians, Unit: Kantabriako Zaldun (example)

After a unit is selected, moving the cursor on a command's icon shows a description of the command and the corresponding hotkey inside brackets.

Although the attack command (three blades icon) is given by pressing Ctrl, the brackets are empty. Instead, [Ctrl] is shown on the garrison command (door and arrow icon). This is a UI problem.

Regarding the implementation errors, one I have found is the following: if a unit has gathered the maximum amount of meat from a deer and we use the "Return to Work" command (Y), the unit will not return to the city center to deliver the meat, but hunt a new deer. When the deer is dead, it will then deliver the previous collected meat.

Not a serious issue nonetheless.

Attachments (3)

call.png (253.9 KB ) - added by Langbart 14 months ago.
hot.png (93.0 KB ) - added by Langbart 14 months ago.
24668.png (182.7 KB ) - added by Langbart 14 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Alex Theodoulidis, 14 months ago

Milestone: Backlog

in reply to:  description comment:2 by Langbart, 14 months ago

Replying to Alex Theodoulidis:

Although the attack command (three blades icon) is given by pressing Ctrl, the brackets are empty. Instead, [Ctrl] is shown on the garrison command (door and arrow icon). This is a UI problem.

The attack-move source:ps/trunk/binaries/data/mods/public/art/textures/cursors/action-attack-move.png@27562 is set by default to ctrl.

No hotkey is assigned to calltoarms source:ps/trunk/binaries/data/mods/public/art/textures/cursors/action-attack.png@27562 by default, which is similar to attack-move source:ps/trunk/binaries/data/mods/public/art/textures/cursors/action-attack-move.png@27562but not the same.


The ticket is still valid, the user does not know the name of the hotkey (calltoarms) to change it, and the description suggests that it has something to do with attack-move.

Course of action could be to adjust the description by including the phrase call to arms, change the cursor to source:ps/trunk/binaries/data/mods/public/art/textures/cursors/action-attack-move.png@27562 rather than source:ps/trunk/binaries/data/mods/public/art/textures/cursors/action-attack.png@27562 and also give a default hotkey, e.g. Alt-a.

Last edited 14 months ago by Langbart (previous) (diff)

by Langbart, 14 months ago

Attachment: call.png added

by Langbart, 14 months ago

Attachment: hot.png added

comment:3 by Freagarach, 14 months ago

I remember there being a placeholder for non-set hotkeys? (With the hotkey identifier.)

comment:4 by Freagarach, 14 months ago

Patch: Alpha 26

in reply to:  3 comment:5 by Langbart, 14 months ago

Milestone: BacklogAlpha 27
Priority: Nice to HaveMust Have

Replying to Freagarach:

I remember there being a placeholder for non-set hotkeys? (With the hotkey identifier.)

bisect

[24668]

possible solution

  • use Array.prototype.{flat,flatMap} (added with ECMA 2019, Spidermonkey 62)
    • binaries/data/mods/public/gui/common/color.js

      a b function colorizeHotkey(text, hotkey)  
      175175    // TODO: Be more efficient in retrieving the mapping(s) for a specific hotkey
      176176    let key = Engine.GetHotkeyMap()[hotkey];
      177177
      178     if (!key)
       178    if (!key?.flat().length)
      179179        key = sprintf(translate("Unassigned hotkey: %(hotkeyName)s"), {
      180180            "hotkeyName": hotkey
      181181        });

by Langbart, 14 months ago

Attachment: 24668.png added
Note: See TracTickets for help on using tickets.