mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
added info about the actual recorded demo length in the notification box
This commit is contained in:
parent
b834426548
commit
5c723f5d2f
|
@ -45,6 +45,7 @@ public:
|
|||
~IDemoRecorder() {}
|
||||
virtual bool IsRecording() const = 0;
|
||||
virtual int Stop() = 0;
|
||||
virtual int Length() const = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue