Opened 3 years ago

Closed 19 months ago

Last modified 19 months 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 19 months ago.
Show a health bar for garrisoned units. Also replaced some var with let
health_garrisoned_v2.patch (3.4 KB) - added by Imarok 19 months ago.
Move the code of the health bar to selection_details

Download all attachments as: .zip

Change History (11)

comment:1 Changed 3 years ago by sanderd17

Keywords: simple added

comment:2 Changed 3 years ago by sanderd17

Component: Core engineUI & Simulation

comment:3 Changed 3 years ago by leper

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

comment:4 Changed 19 months ago by Imarok

Owner: set to Imarok

Changed 19 months ago by Imarok

Attachment: health_garrisoned_v1.patch added

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

comment:5 Changed 19 months ago by Imarok

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

comment:6 Changed 19 months ago by sanderd17

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.

Changed 19 months ago by Imarok

Attachment: health_garrisoned_v2.patch added

Move the code of the health bar to selection_details

comment:7 Changed 19 months ago by sanderd17

Resolution: fixed
Status: newclosed

In 18094:

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

comment:8 Changed 19 months ago by sanderd17

Keywords: review removed

comment:9 Changed 19 months ago by elexis

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