#3114 closed enhancement (fixed)
[PATCH] Display healing process of garrisoned units
Reported by: | Kalle Richter | Owned by: | Imarok |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 21 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
It'd be nice to have a display of the health of garrisoned units which are healing and thus allow to monitor that healing process.
Attachments (2)
Change History (11)
comment:1 by , 9 years ago
Keywords: | simple added |
---|
comment:2 by , 9 years ago
Component: | Core engine → UI & Simulation |
---|
comment:3 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | Display healing process of quartered units → Display healing process of garrisoned units |
comment:4 by , 8 years ago
Owner: | set to |
---|
by , 8 years ago
Attachment: | health_garrisoned_v1.patch added |
---|
comment:5 by , 8 years ago
Keywords: | review patch added |
---|---|
Milestone: | Backlog → Alpha 21 |
Summary: | Display healing process of garrisoned units → [PATCH] Display healing process of garrisoned units |
comment:6 by , 8 years ago
There are some issues with this patch:
The unit_commands.js
file should be agnostic of what the panels look like. So you shouldn't have to modify it at all (unless you're adding a panel, which isn't the case here).
You should probably read the comment at the start of selection_panels.js
to see how it's used. In short, the addData adds data per button, so the ents you have there is only a list of the ents of that button.
Now, for this feature, I think the code would fit more in the selection_details.js
file.
After that, there are some small remarks you may watch out for the next time:
- It would be nice to check the hp and max hp for non-nulliness. So do something like
data.health += data.hitpoints || 0;
- Since ents is an array, you can use for..of
- The comment in the gui XML doesn't need an extra indentation level.
by , 8 years ago
Attachment: | health_garrisoned_v2.patch added |
---|
Move the code of the health bar to selection_details
comment:8 by , 8 years ago
Keywords: | review removed |
---|
comment:9 by , 8 years ago
Keywords: | simple removed |
---|
Show a health bar for garrisoned units. Also replaced some
var
withlet