mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix in game menu buttons overlapping on team based gametypes
The ddnet buttons kill and pause do not fit in anymore if there is also a join red/blue button. This commit fixes that by hiding the buttons if there is not enough space anymore. Related prior work https://github.com/ddnet/ddnet/pull/2720
This commit is contained in:
parent
64fec2cd37
commit
9a29c029a5
|
@ -41,6 +41,7 @@ using namespace std::chrono_literals;
|
|||
void CMenus::RenderGame(CUIRect MainView)
|
||||
{
|
||||
CUIRect Button, ButtonBar, ButtonBar2;
|
||||
bool ShowDDRaceButtons = MainView.w > 855.0f;
|
||||
MainView.HSplitTop(45.0f, &ButtonBar, &MainView);
|
||||
ButtonBar.Draw(ms_ColorTabbarActive, IGraphics::CORNER_B, 10.0f);
|
||||
|
||||
|
@ -180,7 +181,7 @@ void CMenus::RenderGame(CUIRect MainView)
|
|||
}
|
||||
}
|
||||
|
||||
if(m_pClient->m_Snap.m_pLocalInfo->m_Team != TEAM_SPECTATORS)
|
||||
if(m_pClient->m_Snap.m_pLocalInfo->m_Team != TEAM_SPECTATORS && ShowDDRaceButtons)
|
||||
{
|
||||
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
||||
ButtonBar.VSplitLeft(65.0f, &Button, &ButtonBar);
|
||||
|
@ -194,7 +195,7 @@ void CMenus::RenderGame(CUIRect MainView)
|
|||
}
|
||||
}
|
||||
|
||||
if(m_pClient->m_ReceivedDDNetPlayer && m_pClient->m_Snap.m_pLocalInfo && m_pClient->m_Snap.m_pGameInfoObj)
|
||||
if(m_pClient->m_ReceivedDDNetPlayer && m_pClient->m_Snap.m_pLocalInfo && m_pClient->m_Snap.m_pGameInfoObj && ShowDDRaceButtons)
|
||||
{
|
||||
if(m_pClient->m_Snap.m_pLocalInfo->m_Team != TEAM_SPECTATORS || Paused || Spec)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue