Merge pull request #1629 from nheir/feature/1610

Disable scoreboard when on menu and hide motd when on menu
This commit is contained in:
oy 2018-11-19 17:02:14 +01:00 committed by GitHub
commit edeb34153a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include <generated/client_data.h> #include <generated/client_data.h>
#include <game/client/gameclient.h> #include <game/client/gameclient.h>
#include "menus.h"
#include "motd.h" #include "motd.h"
void CMotd::Clear() void CMotd::Clear()
@ -18,6 +19,9 @@ void CMotd::Clear()
bool CMotd::IsActive() bool CMotd::IsActive()
{ {
// dont render modt if the menu is active
if(m_pClient->m_pMenus->IsActive())
return false;
return time_get() < m_ServerMotdTime; return time_get() < m_ServerMotdTime;
} }

View file

@ -16,6 +16,7 @@
#include <game/client/components/motd.h> #include <game/client/components/motd.h>
#include <game/client/components/skins.h> #include <game/client/components/skins.h>
#include "menus.h"
#include "scoreboard.h" #include "scoreboard.h"
@ -408,6 +409,10 @@ void CScoreboard::OnRender()
bool CScoreboard::Active() 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 we activly wanna look on the scoreboard
if(m_Active) if(m_Active)
return true; return true;