Show Dead players in gray on scoreboard
This is done for all cases, but that is probably a bad idea. While this does not matter in public games, in small tournaments this could be an advantage. Ideally, the server could disable giving players this information
This commit is contained in:
parent
bfe62a0a2c
commit
79689848dd
@ -231,6 +231,7 @@ namespace spades {
|
||||
int id;
|
||||
int score;
|
||||
std::string name;
|
||||
bool alive;
|
||||
bool operator<(const ScoreboardEntry &ent) const { return score > ent.score; }
|
||||
};
|
||||
|
||||
@ -241,6 +242,7 @@ namespace spades {
|
||||
char buf[256];
|
||||
Vector2 size;
|
||||
Vector4 white = {1, 1, 1, 1};
|
||||
Vector4 gray = {0.5, 0.5, 0.5, 1};
|
||||
int maxRows = (int)floorf(height / rowHeight);
|
||||
int numPlayers = 0;
|
||||
int cols;
|
||||
@ -256,6 +258,7 @@ namespace spades {
|
||||
ScoreboardEntry ent;
|
||||
ent.name = p->GetName();
|
||||
ent.score = world->GetPlayerPersistent(i).kills;
|
||||
ent.alive = p->IsAlive();
|
||||
ent.id = i;
|
||||
entries.push_back(ent);
|
||||
|
||||
@ -295,8 +298,12 @@ namespace spades {
|
||||
font->Draw(buf, MakeVector2(colX + 35.f - size.x, rowY), 1.f, white);
|
||||
}
|
||||
|
||||
color = ent.alive ? white : gray;
|
||||
|
||||
font->Draw(ent.name, MakeVector2(colX + 45.f, rowY), 1.f, color);
|
||||
|
||||
color = white;
|
||||
|
||||
sprintf(buf, "%d", ent.score);
|
||||
size = font->Measure(buf);
|
||||
font->Draw(buf, MakeVector2(colX + colWidth - 10.f - size.x, rowY), 1.f, color);
|
||||
|
Loading…
x
Reference in New Issue
Block a user