/* flags */
if (config.flags)
{
std::vector< std::pair< std::string, Color > > flags;
// hp & ammo info.
if (config.playerflags[5])
{
int hp = std::min(100, entity->Health());
int r = std::min((510 * (100 - hp)) / 100, 255);
int g = std::min((510 * hp) / 100, 255);
flags.push_back({ tfm::format(XOR("HEALTH: %i"), entity->Health()), Color(r, g, 0, low_alpha) });
if (entity->Armor() > 0)
flags.push_back({ tfm::format(XOR("ARMOR: %i"), entity->Armor()), { 60, 180, 225, low_alpha } });
}
// bomb.
if (entity->HasC4())
flags.push_back({ XOR("B"), { 255, 0, 0, low_alpha } });
// money.
if (config.playerflags[0])
flags.push_back({ tfm::format(XOR("$%i"), entity->Money()), { 150, 200, 60, low_alpha } });
// armor.
if (entity->Armor() > 0 && config.playerflags[1])
flags.push_back({ entity->HasHelmet() ? XOR("HK") : XOR("K"), { 255, 255, 255, low_alpha } });
// reload.
if (entity->Reloading() && config.playerflags[4])
flags.push_back({ XOR("R"), { 60, 180, 225, low_alpha } });
// scoped.
if (entity->IsScoped() && config.playerflags[2])
flags.push_back({ XOR("ZOOM"), { 60, 180, 225, low_alpha } });
// flashed.
if (entity->FlashDuration() > 0.f && config.playerflags[3])
flags.push_back({ XOR("BLIND"), { 255, 255, 15, low_alpha } });
// rescuing hostage.
if (entity->Rescuing())
flags.push_back({ XOR("H"), { 255, 255, 15, low_alpha } });
// grabbing hostage.
if (entity->Grabbing())
flags.push_back({ XOR("G"), { 255, 255, 15, low_alpha } });
// iterate flags.
for (size_t i{ }; i < flags.size(); ++i)
{
const auto& f = flags[i];
int offset = i * (render::pixel.m_size.iHeight - 1);
render::pixel.string(box.x + box.w + 3, box.y + offset, f.second, f.first);
}
}