Opened 8 years ago
Last modified 8 years ago
#3823 closed task
Correctly handle commands for multiple units — at Version 9
Reported by: | Itms | Owned by: | svott |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 21 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
When there are multiple units in the selection, we're facing several problems, which arise from the fact that the GUI uses the first unit of the selection (this first unit being the one with the lowest entity ID).
Problems include:
- The back-to-work button does not always show up (workaround included in r17880 and reverted afterwards)
- #2205
- #3302
- Building structures when female citizens and soldiers are selected together
and possibly others.
This should be fixed by passing selection
instead of unitEntState
from unit_commands to selection_panels and change the code depending on that. (comment:8)
Change History (11)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Keywords: | patch added |
---|---|
Milestone: | Backlog → Alpha 21 |
Owner: | set to |
Summary: | Correctly handle commands for multiple units → [Patch] Correctly handle commands for multiple units |
I solved the back-to-work problem again in a more general way for the middle panel, so that is should also fix problems with other commands
Further:
#2205: I think that is another problem. Related to the middle panel: there is not enough space for all icons when units and structures are selected together. Thus, it needs a redesign in another task.
#3302: It looks like that it has another cause that is not related to here.
last bullet point: I don't see the problem. maybe it is solved in another ticket already?
by , 8 years ago
Attachment: | 3823.patch added |
---|
comment:3 by , 8 years ago
Keywords: | review added |
---|---|
Summary: | [Patch] Correctly handle commands for multiple units → [PATCH] Correctly handle commands for multiple units |
comment:4 by , 8 years ago
Some remarks:
- It's not common to mark an argument as "UNUSED" in JS.
- It would be nice if you assured us that there's no problem with passing the same selection list every time (it could be modified by some methods).
- When you alter the arguments of a function that has javaDoc, you should alter the documentation too.
comment:6 by , 8 years ago
comment:7 by , 8 years ago
@bb: I don't know. Don't? @sanderd17: well, is there another way to get rid of unused arguments? I don't see a possibility in that case because the (general) getItem function needs a unitEntState argument at first place
how can I assure that there is no problem with passing the list? (There are other entries (g_SelectionPanels.Gate i.e.) those use the "selection" parameter as well)
comment:8 by , 8 years ago
As far as I can see unitEntState
shouldn't be passed at all from unit_commands to selection_panels.
In some cases it might happen to be a check that works as the player can't select multiple units if the first selected one isn't an own unit. But if the GUI should take all selected units into account, then g_Selection
must be processed in every case.
comment:9 by , 8 years ago
Description: | modified (diff) |
---|---|
Keywords: | patch review removed |
Milestone: | Alpha 21 → Backlog |
Summary: | [PATCH] Correctly handle commands for multiple units → Correctly handle commands for multiple units |
In 17885: