Ticket #1210 (closed enhancement: fixed)
[PATCH] Player should be able to train units over all buildings in a selection.
| Reported by: | michael | Owned by: | Spahbod |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Alpha 10 |
| Component: | UI & Simulation | Keywords: | patch |
| Cc: |
Description
Players should be able to train units in multiple buildings in a selection at the same time. For instance, if multiple Barracks are selected (usually via double click), then if the player clicks the "train spearman" button, a spearman should be added to the queues of all of the selected barracks. This removes unnecessary clicks and helps prevent carpal tunnel and tendonitis in players (known from experience).
Attachments
Change History
comment:1 Changed 14 months ago by k776
- Priority changed from Must Have to Nice to Have
- Component changed from Game engine to Simulation
comment:3 Changed 14 months ago by k776
- Keywords patch, review added; buildings "unit training" multi-selection multiple selection removed
- Owner set to Spahbod
- Summary changed from Player should be able to train units over all buildings in a selection. to [PATCH] Player should be able to train units over all buildings in a selection.
comment:4 Changed 14 months ago by mammadori
"This removes unnecessary clicks and helps prevent carpal tunnel and tendonitis in players (known from experience)."
Regarding this definition I think this could be related also with #1226, in 1226 there is the code to queue a unit in all selected buildings, in a positional (and easy to remember) way. ZXCV keys queue to 1234 kind of unit.
comment:5 Changed 14 months ago by Spahbod
Simplified the patch according to instructions from Philip.
comment:6 Changed 14 months ago by leper
Just noticed that this ticket is a dupe of #959 (maybe except the rally point setting, but that is already implemented).
comment:7 follow-up: ↓ 9 Changed 14 months ago by leper
- Keywords patch added; patch, review removed
I took a look at your patch and you could improve it a bit:
- You should use FilterEntitiesList?(cmd.entities, player, controlAllUnits) in Commands.js instead of the if block.
- Remove entity and replace it with entities altogether. This way you can use the loop code for both cases in Commands.js
Apart from those points it is looking good. It would be good if you could try to provide a single patch file that only includes changes relevant to this ticket and maybe timestamp your patch.
comment:9 in reply to: ↑ 7 Changed 13 months ago by Spahbod
Replying to leper:
I took a look at your patch and you could improve it a bit:
- You should use FilterEntitiesList?(cmd.entities, player, controlAllUnits) in Commands.js instead of the if block.
- Remove entity and replace it with entities altogether. This way you can use the loop code for both cases in Commands.js
Apart from those points it is looking good. It would be good if you could try to provide a single patch file that only includes changes relevant to this ticket and maybe timestamp your patch.
Sorry for the delay. About first point:That should work. but i did that because we need the player be able to control the first selected building (which is entity or entities[0]). But there is also a problem. It seems that FilterEntitiesList? can't be used in Command.js so I hardcoded the thing.
If we remove "entity" it causes the AI to stop training units. That needs a much broader change that needs quantumstate's approval.
comment:10 Changed 13 months ago by Spahbod
Feel free to change the patch if necessary if i didn't return for so long.
comment:12 Changed 13 months ago by leper
- Status changed from new to closed
- Resolution set to fixed
In 11592:
comment:13 Changed 13 months ago by leper
- Keywords review removed
Thanks for your patch. I rewrote most of it as some of the code was changed by r11584 and my version adds the ability to add to batches if we have more than one building selected.
