Opened 5 years ago

Last modified 15 months ago

#5360 new enhancement

'Find idle unit' feature doesn't deselect currently selected units if no units are idle

Reported by: cpc Owned by:
Priority: Nice to Have Milestone: Backlog
Component: UI – In-game Keywords:
Cc: Patch: Phab:D1692

Description

Pressing period (hotkey.selection.idleworker) replaces the current selection with one or all idle units, depending on hotkey.selection.offscreen.

When there are no idle units, however, pressing period does nothing; in particular, it doesn't deselect the currently-selected units.  This makes it hard to know whether idle units were selected or whether the existing selection (containing busy units) was preserved.  The code says // TODO: display a message or play a sound to indicate no more idle units, or something

The attached patch resets the current selection regardless of whether there are idle units; this way, if no units are idle, the no units are selected after pressing period. The behavior of period + Shift is unchanged. Is that the right way to go?

Attachments (1)

reset-selection-even-if-no-idle-units.diff (635 bytes ) - added by cpc 5 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 by cpc, 5 years ago

Cc: cpc added

comment:2 by Imarok, 5 years ago

Thank you for the patch, but please upload it to our review platform at code.wildfiregames.com

comment:3 by cpc, 5 years ago

Will do, thanks for the pointer.

comment:4 by cpc, 5 years ago

Submitted as Phab:D1692

comment:5 by Vladislav Belov, 5 years ago

I'd prefer to use a sound/UI notification, because the reset is used only as notification in todo case, not as useful function. Example:

  1. You have few selected unit, that you're working with.
  2. You want to use some idle workers if they exist and you're pressing the hotkey.selection.idleworker.
  3. If no idle workers: with that patch, you need to select all units again, with a sound/UI notification, you don't need to do this. In both cases you'll know all workers aren't idle.

comment:6 by cpc, 5 years ago

Interesting point! I found the current behavior unintuitive, but maybe there's a case to be made that not deselecting is more convenient, and so the slight inconsistency is worth it.

comment:7 by Stan, 5 years ago

Sounds like what the TODO in that code was for. I can ask Samulis if he'd like to make a sound for that notification, what do you think ?

comment:8 by cpc, 5 years ago

Sounds great! I would be in favor of using a text notification in addition to the sound, since (especially in multiplayer LAN parties) people sometimes play without sound. I will update the patch accordingly.

comment:9 by Imarok, 5 years ago

Patch: ​Phab:D1692

comment:10 by Imarok, 5 years ago

Component: UI & SimulationIn-game UI

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

comment:11 by Silier, 3 years ago

Owner: set to cpc

comment:12 by Freagarach, 3 years ago

In 25287:

Play a sound when there are no idle entities.

If there are no idle units and the idle-unit hotkey is pressed there is now a sound played.
Beneficial when there are already units selected since selection doesn't change.

Sound courtesy of @Samualis.

Refs. #5360
Based on a patch by: @cpc
Differential revision: https://code.wildfiregames.com/D1692
Comments by: @asterix, @smiley, @Stan, @vladislavbelov

comment:13 by Stan, 15 months ago

Cc: cpc removed
Milestone: Work In ProgressBacklog
Owner: cpc removed
Note: See TracTickets for help on using tickets.