void CMisc::OnRenderSpectatorList()
{
if (Settings::Misc::misc_Spectators)
{
if (ImGui::Begin("Spectators"), &Settings::Misc::misc_Spectators, ImVec2(300, 300), 0.9f, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_ShowBorders)
{
int DrawIndex = 1;
for (int playerId : GetObservervators(Interfaces::Engine()->GetLocalPlayer()))
{
if (playerId == Interfaces::Engine()->GetLocalPlayer())
continue;
CBaseEntity* pPlayer = (CBaseEntity*)Interfaces::EntityList()->GetClientEntity(playerId);
if (!pPlayer)
continue;
PlayerInfo Pinfo;
Interfaces::Engine()->GetPlayerInfo(playerId, &Pinfo);
if (Pinfo.m_bIsFakePlayer)
continue;
if (g_pRender)
{
string Name = Pinfo.m_szPlayerName;
if (Name != "")
{
Color PlayerObsColor;
//[junk_disable /]
switch (pPlayer->GetObserverMode())
{
case ObserverMode_t::OBS_MODE_IN_EYE:
Name.append("");
static float rainbow;
rainbow += 0.003f;
if (rainbow > 1.f) rainbow = 0.f;
PlayerObsColor = Color::FromHSB(rainbow, 1.f, 1.f);
break;
case ObserverMode_t::OBS_MODE_CHASE:
Name.append(" ");
PlayerObsColor = Color::FromHSB(rainbow, 1.f, 1.f);
break;
case ObserverMode_t::OBS_MODE_ROAMING:
Name.append("");
PlayerObsColor = Color::FromHSB(rainbow, 1.f, 1.f);
break;
case ObserverMode_t::OBS_MODE_DEATHCAM:
Name.append("");
PlayerObsColor = Color::FromHSB(rainbow, 1.f, 1.f);
break;
case ObserverMode_t::OBS_MODE_FREEZECAM:
Name.append("");
PlayerObsColor = Color::FromHSB(rainbow, 1.f, 1.f);
break;
case ObserverMode_t::OBS_MODE_FIXED:
Name.append("");
PlayerObsColor = Color::FromHSB(rainbow, 1.f, 1.f);
break;
default:
break;
}
//[junk_enable /]
char* bufix;
char buf[255]; sprintf_s(buf, u8"%s", Pinfo.m_szPlayerName, bufix);
ImGui::Text((u8"%s"), buf);
}
}
}
}
ImGui::End();
}
}