mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Merge pull request #1741 from LordSk/fix/broadcast_scoreboard
Fixed broadcast not being shown when scoreboard/motd is active
This commit is contained in:
commit
2f1646f5b1
|
@ -55,7 +55,7 @@ void CBroadcast::RenderServerBroadcast()
|
|||
if(m_aSrvBroadcastMsg[0] == 0 || DeltaTime > DisplayDuration)
|
||||
return;
|
||||
|
||||
if(m_pClient->m_pChat->IsActive())
|
||||
if(m_pClient->m_pChat->IsActive() || m_pClient->Client()->State() != IClient::STATE_ONLINE)
|
||||
return;
|
||||
|
||||
const float Fade = 1.0f - max(0.0f, (DeltaTime - DisplayStartFade) / (DisplayDuration - DisplayStartFade));
|
||||
|
@ -251,6 +251,7 @@ void CBroadcast::DoBroadcast(const char *pText)
|
|||
void CBroadcast::OnReset()
|
||||
{
|
||||
m_BroadcastTime = 0;
|
||||
m_SrvBroadcastReceivedTime = 0;
|
||||
}
|
||||
|
||||
void CBroadcast::OnMessage(int MsgType, void* pRawMsg)
|
||||
|
@ -409,12 +410,15 @@ void CBroadcast::OnMessage(int MsgType, void* pRawMsg)
|
|||
|
||||
void CBroadcast::OnRender()
|
||||
{
|
||||
// server broadcast
|
||||
RenderServerBroadcast();
|
||||
|
||||
// client broadcast
|
||||
if(m_pClient->m_pScoreboard->Active() || m_pClient->m_pMotd->IsActive())
|
||||
return;
|
||||
|
||||
Graphics()->MapScreen(0, 0, 300*Graphics()->ScreenAspect(), 300);
|
||||
|
||||
// client broadcast
|
||||
if(Client()->LocalTime() < m_BroadcastTime)
|
||||
{
|
||||
CTextCursor Cursor;
|
||||
|
@ -422,8 +426,5 @@ void CBroadcast::OnRender()
|
|||
Cursor.m_LineWidth = 300*Graphics()->ScreenAspect()-m_BroadcastRenderOffset;
|
||||
TextRender()->TextEx(&Cursor, m_aBroadcastText, -1);
|
||||
}
|
||||
|
||||
// server broadcast
|
||||
RenderServerBroadcast();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue