From 07cab50b6ef9c904a678459c65670fc287a13735 Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Fri, 22 Jul 2022 22:38:05 +0700 Subject: [PATCH] add color nicknames --- Shooter.cpp | 2 +- player/Player.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Shooter.cpp b/Shooter.cpp index fb1bee0..a16b13e 100644 --- a/Shooter.cpp +++ b/Shooter.cpp @@ -211,7 +211,7 @@ void Shooter::drawStatsTable() { for (auto &p : allPlayers) { screen->drawText(std::to_string(i) + "\t" + p->playerNickName() + "\t" + std::to_string(p->kills()) + " / " + std::to_string(p->deaths()), - Vec2D{10, 15 + 35.0 * i}, 25, sf::Color(0, 0, 0, 150)); + Vec2D{10, 15 + 35.0 * i}, 25, p->color()); i++; } diff --git a/player/Player.cpp b/player/Player.cpp index 4a008c0..d198edd 100644 --- a/player/Player.cpp +++ b/player/Player.cpp @@ -13,6 +13,7 @@ Player::Player(ObjectNameTag name, const std::string &filename, const Vec3D &sca setAcceleration(Vec3D{0, -ShooterConsts::GRAVITY, 0}); setCollision(true); setVisible(false); + setColor(sf::Color(0,0,0)); setCollisionCallBack([this](const ObjectNameTag &tag, std::shared_ptr obj) { collisionWithObject(tag, obj); }); }