mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Merge pull request #1629 from nheir/feature/1610
Disable scoreboard when on menu and hide motd when on menu
This commit is contained in:
commit
edeb34153a
|
@ -9,6 +9,7 @@
|
|||
#include <generated/client_data.h>
|
||||
#include <game/client/gameclient.h>
|
||||
|
||||
#include "menus.h"
|
||||
#include "motd.h"
|
||||
|
||||
void CMotd::Clear()
|
||||
|
@ -18,6 +19,9 @@ void CMotd::Clear()
|
|||
|
||||
bool CMotd::IsActive()
|
||||
{
|
||||
// dont render modt if the menu is active
|
||||
if(m_pClient->m_pMenus->IsActive())
|
||||
return false;
|
||||
return time_get() < m_ServerMotdTime;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <game/client/components/motd.h>
|
||||
#include <game/client/components/skins.h>
|
||||
|
||||
#include "menus.h"
|
||||
#include "scoreboard.h"
|
||||
|
||||
|
||||
|
@ -408,6 +409,10 @@ void CScoreboard::OnRender()
|
|||
|
||||
bool CScoreboard::Active()
|
||||
{
|
||||
// disable scoreboard if the menu is active
|
||||
if(m_pClient->m_pMenus->IsActive())
|
||||
return false;
|
||||
|
||||
// if we activly wanna look on the scoreboard
|
||||
if(m_Active)
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue