From 5c723f5d2fbbf70ad69874a6ca085726151ec0ae Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 12 Mar 2011 18:34:16 +0100 Subject: [PATCH] added info about the actual recorded demo length in the notification box --- src/engine/demo.h | 1 + src/engine/shared/demo.h | 2 +- src/game/client/components/scoreboard.cpp | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/engine/demo.h b/src/engine/demo.h index 3ca68299d..a6841a9ef 100644 --- a/src/engine/demo.h +++ b/src/engine/demo.h @@ -45,6 +45,7 @@ public: ~IDemoRecorder() {} virtual bool IsRecording() const = 0; virtual int Stop() = 0; + virtual int Length() const = 0; }; #endif diff --git a/src/engine/shared/demo.h b/src/engine/shared/demo.h index 62e2bfd1f..ad7566c70 100644 --- a/src/engine/shared/demo.h +++ b/src/engine/shared/demo.h @@ -39,7 +39,7 @@ public: 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 diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 0d355456b..95b620c41 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -259,7 +259,7 @@ void CScoreboard::RenderRecordingNotification(float x) Graphics()->TextureSet(-1); Graphics()->QuadsBegin(); 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(); //draw the red dot @@ -269,7 +269,10 @@ void CScoreboard::RenderRecordingNotification(float x) Graphics()->QuadsEnd(); //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()