mirror of
https://github.com/unknownworlds/NS.git
synced 2025-02-28 06:11:22 +00:00
Mantis: 0000798
o Added map name and round timer to scoreboard git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@484 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
parent
3c6b1bdfc1
commit
f701283bdb
1 changed files with 17 additions and 13 deletions
|
@ -400,28 +400,32 @@ bool HACK_GetPlayerUniqueID( int iPlayer, char playerID[16] )
|
||||||
void ScorePanel::Update()
|
void ScorePanel::Update()
|
||||||
{
|
{
|
||||||
// Set the title
|
// Set the title
|
||||||
string theTitleName;
|
char title[128];
|
||||||
|
|
||||||
|
char theServerName[MAX_SERVERNAME_LENGTH+1];
|
||||||
if (gViewPort->m_szServerName)
|
if (gViewPort->m_szServerName)
|
||||||
{
|
{
|
||||||
int iServerNameLength = max((int)strlen(gViewPort->m_szServerName),MAX_SERVERNAME_LENGTH);
|
int iServerNameLength = max((int)strlen(gViewPort->m_szServerName),MAX_SERVERNAME_LENGTH);
|
||||||
theTitleName += string(gViewPort->m_szServerName,iServerNameLength);
|
sprintf(theServerName, "%32s", gViewPort->m_szServerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
string theMapName = gHUD.GetMapName();
|
char theMapName[MAX_MAPNAME_LENGTH+1];
|
||||||
if(theMapName != "")
|
sprintf(theMapName, "%s", gHUD.GetMapName().c_str());
|
||||||
{
|
|
||||||
if(theTitleName != "")
|
int theTimeElapsed = gHUD.GetGameTime();
|
||||||
{
|
char elapsedString[64];
|
||||||
theTitleName += " ";
|
if ( theTimeElapsed > 0 ) {
|
||||||
|
int theMinutesElapsed = theTimeElapsed/60;
|
||||||
|
int theSecondsElapsed = theTimeElapsed%60;
|
||||||
|
sprintf(elapsedString, "Game time: %d:%02d", theMinutesElapsed, theSecondsElapsed);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sprintf(elapsedString, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
theTitleName += "(";
|
sprintf(title, "%s Map: %s %s", theServerName, theMapName, elapsedString);
|
||||||
theTitleName += theMapName;
|
|
||||||
theTitleName += ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
m_TitleLabel.setText(theTitleName.c_str());
|
m_TitleLabel.setText(title);
|
||||||
|
|
||||||
int theColorIndex = 0;
|
int theColorIndex = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue