Always highlight hp bars of the slected unit,

...not only the one under the mouse

More consistent with the highlighting of the unit's sprite and prevent
a sort of false de-selection feeling when the bar darkening

Thanks to uso for the idea.
This commit is contained in:
Ali El Gariani 2008-02-15 02:53:27 +00:00
parent b528e49333
commit 184372e0dc

View File

@ -1832,7 +1832,7 @@ void unit::redraw_unit(game_display& disp, const gamemap::location& loc, const b
#endif
const int hp_bar_height = static_cast<int>(max_hitpoints()*game_config::hp_bar_scaling);
const fixed_t bar_alpha = loc == disp.mouseover_hex() ? ftofxp(1.0): ftofxp(0.8);
const fixed_t bar_alpha = (loc == disp.mouseover_hex() || loc == disp.selected_hex()) ? ftofxp(1.0): ftofxp(0.8);
disp.draw_bar(*energy_file, xsrc+bar_shift, ysrc_adjusted, hp_bar_height, unit_energy,hp_color(), bar_alpha);