Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#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 leper)

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)

health_garrisoned_v1.patch (4.7 KB ) - added by Imarok 8 years ago.
Show a health bar for garrisoned units. Also replaced some var with let
health_garrisoned_v2.patch (3.4 KB ) - added by Imarok 8 years ago.
Move the code of the health bar to selection_details

Download all attachments as: .zip

Change History (11)

comment:1 by sanderd17, 9 years ago

Keywords: simple added

comment:2 by sanderd17, 9 years ago

Component: Core engineUI & Simulation

comment:3 by leper, 9 years ago

Description: modified (diff)
Summary: Display healing process of quartered unitsDisplay healing process of garrisoned units

comment:4 by Imarok, 8 years ago

Owner: set to Imarok

by Imarok, 8 years ago

Attachment: health_garrisoned_v1.patch added

Show a health bar for garrisoned units. Also replaced some var with let

comment:5 by Imarok, 8 years ago

Keywords: review patch added
Milestone: BacklogAlpha 21
Summary: Display healing process of garrisoned units[PATCH] Display healing process of garrisoned units

comment:6 by sanderd17, 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 Imarok, 8 years ago

Attachment: health_garrisoned_v2.patch added

Move the code of the health bar to selection_details

comment:7 by sanderd17, 8 years ago

Resolution: fixed
Status: newclosed

In 18094:

Display health bar for garrisoned units. Patch by Imarok. Fixes #3114

comment:8 by sanderd17, 8 years ago

Keywords: review removed

comment:9 by elexis, 8 years ago

Keywords: simple removed
Note: See TracTickets for help on using tickets.