//----------------------------------------------------------------------------- // Purpose: Renders stat value as string //----------------------------------------------------------------------------- void CTFStatPanel::GetStatValueAsString( int iValue, TFStatType_t statType, char *value, int valuelen ) { if ( TFSTAT_PLAYTIME == statType ) { // Format time as a time string Q_strncpy( value, FormatSeconds( iValue ), valuelen ); } else { // all other stats are just displayed as #'s Q_snprintf( value, valuelen, "%d", iValue ); } }
bool CslGameConnection::CountDown() { CslGameConnection& self=GetInstance(); if (--self.m_info->ConnectWait>0) { CslStatusBar::SetText(1, wxString::Format( _("Waiting %s for a free slot on '%s (%s)' (press ESC to abort or join an other server)"), FormatSeconds(self.m_info->ConnectWait,true,true).c_str(), self.m_info->GetBestDescription().c_str(), self.m_info->GetGame().GetName().c_str())); return true; } else Reset(); return false; }
void CslGameConnection::Reset(CslServerInfo *info) { CslGameConnection& self=GetInstance(); if (self.m_info && !self.m_detached) { wxString s; self.m_info->GetGame().GameEnd(s); self.m_info->ConnectWait=0; if (self.m_locked) self.m_info->Lock(false); s.Empty(); if (self.m_playing) { s=wxString::Format(_("Last played on: '%s (%s)'"), self.m_info->GetBestDescription().c_str(), self.m_info->GetGame().GetName().c_str()); if (self.m_info->PlayTimeLast>0) { s<<wxT(" - ")<<_("Play time:")<<wxT(" "); s<<FormatSeconds(self.m_info->PlayTimeLast).c_str(); } } CslStatusBar::SetText(1,s); } self.m_info=info; self.m_process=NULL; self.m_locked=false; self.m_playing=false; self.m_cmd.Empty(); }