Showing only enery bars for selected units (configurable) from Iuri Fiedoruk

This commit is contained in:
johns 2000-06-11 21:56:23 +00:00
parent 687f78f8f4
commit 6fde56332f
4 changed files with 29 additions and 3 deletions

View file

@ -504,8 +504,11 @@
<LI>Fixed bug: Repairing buildings already at max HP from David Slimp.
<LI>Command...Fast=1 removed, use now ResetPath.
<LI>Prepared all calls for handling the new return codes of the pathfinder.
<LI>Implemented first part of Select Scenario requesters.
<LI>Implemented first part of Select Scenario requesters from ari.
<LI>Enabled real 24bpp mode.
<LI>New horizontal energy bars from Iuri Fiedoruk.
<LI>Removed old code for unit management and network.
<LI>New code for automatic target choose.
<LI>+++
</UL>

View file

@ -333,9 +333,10 @@ extern int ShowHealthBar; /// Flag: show health bar
extern int ShowHealthDot; /// Flag: show health dot
extern int ShowManaBar; /// Flag: show mana bar
extern int ShowManaDot; /// Flag: show mana dot
extern int ShowHealthHorizontal; /// Flag: show health bar horizontal
extern int ShowManaHorizontal; /// Flag: show mana bar horizontal
extern int ShowHealthHorizontal; /// Flag: show health bar horizontal
extern int ShowManaHorizontal; /// Flag: show mana bar horizontal
extern int ShowNoFull; /// Flag: show no full health or mana
extern int ShowEnergySelectedOnly; /// Flag: show energy only for selected
extern int DecorationOnTop; /// Flag: show health and mana on top
extern int ShowSightRange; /// Flag: show right range
extern int ShowReactRange; /// Flag: show react range

View file

@ -229,6 +229,17 @@ local SCM CclShowManaDot(void)
return SCM_UNSPECIFIED;
}
/**
** Enable energy bars and dots only for selected units
*/
local SCM CclShowEnergySelected(void)
{
ShowEnergySelectedOnly=1;
return SCM_UNSPECIFIED;
}
/**
** Enable display of full bars/dots.
*/
@ -906,6 +917,7 @@ global void CclInit(void)
init_subr_0("show-mana-bar",CclShowManaBar);
init_subr_0("show-mana-dot",CclShowManaDot);
init_subr_0("show-energy-selected-only",CclShowEnergySelected);
init_subr_0("show-full",CclShowFull);
init_subr_0("show-no-full",CclShowNoFull);
init_subr_0("decoration-on-top",CclDecorationOnTop);

View file

@ -58,6 +58,8 @@ global int ShowOrders; /// Flag: show orders of unit on map
global int ShowHealthHorizontal=1;
/// Flag: health horizontal instead of vertical
global int ShowManaHorizontal=1;
/// Flag: show bars and dot energy only for selected
global int ShowEnergySelectedOnly;
// FIXME: not all variables of this file are here
// FIXME: perhaps split this file into two?
@ -344,6 +346,14 @@ local void DrawDecoration(Unit* unit,const UnitType* type,int x,int y)
int color;
UnitStats* stats;
//
// Only for selected units?
//
if( ShowEnergySelectedOnly && !unit->Selected ) {
return;
}
//
// Health bar on left side of unit.
//