MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / DrawHintProgress

Method DrawHintProgress

core/MenuVoting.cpp:632–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632void VoteMenuHandler::DrawHintProgress()
633{
634 if (!sm_vote_hintbox.GetBool())
635 {
636 return;
637 }
638
639 static char buffer[1024];
640
641 float timeRemaining = (m_fStartTime + m_nMenuTime) - gpGlobals->curtime;
642 if (timeRemaining < 0)
643 {
644 timeRemaining = 0.0;
645 }
646
647 int iTimeRemaining = RoundFloatToInt(timeRemaining);
648
649 int maxclients = g_Players.GetMaxClients();
650 for (int i=1; i<=maxclients; i++)
651 {
652 if (g_Players.GetPlayerByIndex(i)->IsInGame())
653 {
654 logicore.CoreTranslate(buffer, sizeof(buffer), "%T%s", 6, NULL, "Vote Count",
655 &i, &m_NumVotes, &m_TotalClients, &iTimeRemaining, &m_leaderList);
656 g_HL2.HintTextMsg(i, buffer);
657 }
658 }
659}
660
661void VoteMenuHandler::BuildVoteLeaders()
662{

Callers

nothing calls this directly

Calls 5

GetBoolMethod · 0.80
GetMaxClientsMethod · 0.80
IsInGameMethod · 0.80
GetPlayerByIndexMethod · 0.80
HintTextMsgMethod · 0.80

Tested by

no test coverage detected