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:
puzl 2006-05-14 15:52:53 +00:00
parent 3c6b1bdfc1
commit f701283bdb

View file

@ -400,28 +400,32 @@ bool HACK_GetPlayerUniqueID( int iPlayer, char playerID[16] )
void ScorePanel::Update()
{
// Set the title
string theTitleName;
char title[128];
char theServerName[MAX_SERVERNAME_LENGTH+1];
if (gViewPort->m_szServerName)
{
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();
if(theMapName != "")
{
if(theTitleName != "")
{
theTitleName += " ";
}
char theMapName[MAX_MAPNAME_LENGTH+1];
sprintf(theMapName, "%s", gHUD.GetMapName().c_str());
theTitleName += "(";
theTitleName += theMapName;
theTitleName += ")";
int theTimeElapsed = gHUD.GetGameTime();
char elapsedString[64];
if ( theTimeElapsed > 0 ) {
int theMinutesElapsed = theTimeElapsed/60;
int theSecondsElapsed = theTimeElapsed%60;
sprintf(elapsedString, "Game time: %d:%02d", theMinutesElapsed, theSecondsElapsed);
}
else {
sprintf(elapsedString, "");
}
m_TitleLabel.setText(theTitleName.c_str());
sprintf(title, "%s Map: %s %s", theServerName, theMapName, elapsedString);
m_TitleLabel.setText(title);
int theColorIndex = 0;