added info about the actual recorded demo length in the notification box

This commit is contained in:
oy 2011-03-12 18:34:16 +01:00
parent b834426548
commit 5c723f5d2f
3 changed files with 7 additions and 3 deletions

View file

@ -45,6 +45,7 @@ public:
~IDemoRecorder() {} ~IDemoRecorder() {}
virtual bool IsRecording() const = 0; virtual bool IsRecording() const = 0;
virtual int Stop() = 0; virtual int Stop() = 0;
virtual int Length() const = 0;
}; };
#endif #endif

View file

@ -39,7 +39,7 @@ public:
bool IsRecording() const { return m_File != 0; } bool IsRecording() const { return m_File != 0; }
int TickCount() const { return m_LastTickMarker - m_FirstTick; } int Length() const { return m_LastTickMarker - m_FirstTick; }
}; };
class CDemoPlayer : public IDemoPlayer class CDemoPlayer : public IDemoPlayer

View file

@ -259,7 +259,7 @@ void CScoreboard::RenderRecordingNotification(float x)
Graphics()->TextureSet(-1); Graphics()->TextureSet(-1);
Graphics()->QuadsBegin(); Graphics()->QuadsBegin();
Graphics()->SetColor(0.0f, 0.0f, 0.0f, 0.4f); Graphics()->SetColor(0.0f, 0.0f, 0.0f, 0.4f);
RenderTools()->DrawRoundRectExt(x, 0.0f, 120.0f, 50.0f, 15.0f, CUI::CORNER_B); RenderTools()->DrawRoundRectExt(x, 0.0f, 180.0f, 50.0f, 15.0f, CUI::CORNER_B);
Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
//draw the red dot //draw the red dot
@ -269,7 +269,10 @@ void CScoreboard::RenderRecordingNotification(float x)
Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
//draw the text //draw the text
TextRender()->Text(0, x+50.0f, 8.0f, 24.0f, Localize("REC"), -1); char aBuf[64];
int Seconds = m_pClient->DemoRecorder()->Length()/SERVER_TICK_SPEED;
str_format(aBuf, sizeof(aBuf), Localize("REC %3d:%02d"), Seconds/60, Seconds%60);
TextRender()->Text(0, x+50.0f, 10.0f, 20.0f, aBuf, -1);
} }
void CScoreboard::OnRender() void CScoreboard::OnRender()