Only show informations about own units or some neutral.

This commit is contained in:
johns 2000-06-08 16:34:08 +00:00
parent a5f1a0e51a
commit dfd2d7a7f8

View file

@ -167,6 +167,27 @@ global void DrawUnitInfo(Unit* unit)
DrawTextCentered(x+114,y+8+17,GameFont,type->Name);
}
//
// Show for all players.
//
if( type->GoldMine ) {
DrawText(x+37,y+8+78,GameFont,"Gold Left:");
DrawNumber(x+108,y+8+78,GameFont,unit->Value);
return;
}
if( type->GivesOil || type->OilPatch ) {
DrawText(x+47,y+8+78,GameFont,"Oil Left:");
DrawNumber(x+108,y+8+78,GameFont,unit->Value);
return;
}
//
// Only for owning player.
//
if( unit->Player!=ThisPlayer ) {
return;
}
//
// Show progress for buildings only if they are selected.
//
@ -230,13 +251,7 @@ global void DrawUnitInfo(Unit* unit)
}
}
if( type->GoldMine ) {
DrawText(x+37,y+8+78,GameFont,"Gold Left:");
DrawNumber(x+108,y+8+78,GameFont,unit->Value);
} else if( type->GivesOil || type->OilPatch ) {
DrawText(x+47,y+8+78,GameFont,"Oil Left:");
DrawNumber(x+108,y+8+78,GameFont,unit->Value);
} else if( type->StoresWood ) {
if( type->StoresWood ) {
DrawText(x+20,y+8+78,GameFont,"Production");
DrawText(x+52,y+8+93,GameFont,"Lumber:");
// FIXME: if production plus isn't 25!