mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix menu bug with button pressing (more of a hack)
This commit is contained in:
parent
14b5766b30
commit
16106d8ee6
|
@ -59,13 +59,15 @@ void CMenus::RenderGame(CUIRect MainView)
|
||||||
Client()->Disconnect();
|
Client()->Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int s_SpectateButton = 0;
|
||||||
|
static int s_SpectateButton2 = 0;
|
||||||
|
|
||||||
if(m_pClient->m_Snap.m_pLocalInfo && m_pClient->m_Snap.m_pGameInfoObj)
|
if(m_pClient->m_Snap.m_pLocalInfo && m_pClient->m_Snap.m_pGameInfoObj)
|
||||||
{
|
{
|
||||||
if(m_pClient->m_Snap.m_pLocalInfo->m_Team != TEAM_SPECTATORS)
|
if(m_pClient->m_Snap.m_pLocalInfo->m_Team != TEAM_SPECTATORS)
|
||||||
{
|
{
|
||||||
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
||||||
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
||||||
static int s_SpectateButton = 0;
|
|
||||||
if(DoButton_Menu(&s_SpectateButton, Localize("Spectate"), 0, &Button))
|
if(DoButton_Menu(&s_SpectateButton, Localize("Spectate"), 0, &Button))
|
||||||
{
|
{
|
||||||
if(g_Config.m_ClDummy == 0 || m_pClient->Client()->DummyConnected())
|
if(g_Config.m_ClDummy == 0 || m_pClient->Client()->DummyConnected())
|
||||||
|
@ -82,7 +84,6 @@ void CMenus::RenderGame(CUIRect MainView)
|
||||||
{
|
{
|
||||||
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
||||||
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
||||||
static int s_SpectateButton = 0;
|
|
||||||
if(DoButton_Menu(&s_SpectateButton, Localize("Join red"), 0, &Button))
|
if(DoButton_Menu(&s_SpectateButton, Localize("Join red"), 0, &Button))
|
||||||
{
|
{
|
||||||
m_pClient->SendSwitchTeam(TEAM_RED);
|
m_pClient->SendSwitchTeam(TEAM_RED);
|
||||||
|
@ -94,8 +95,7 @@ void CMenus::RenderGame(CUIRect MainView)
|
||||||
{
|
{
|
||||||
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
||||||
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
||||||
static int s_SpectateButton = 0;
|
if(DoButton_Menu(&s_SpectateButton2, Localize("Join blue"), 0, &Button))
|
||||||
if(DoButton_Menu(&s_SpectateButton, Localize("Join blue"), 0, &Button))
|
|
||||||
{
|
{
|
||||||
m_pClient->SendSwitchTeam(TEAM_BLUE);
|
m_pClient->SendSwitchTeam(TEAM_BLUE);
|
||||||
SetActive(false);
|
SetActive(false);
|
||||||
|
@ -108,7 +108,6 @@ void CMenus::RenderGame(CUIRect MainView)
|
||||||
{
|
{
|
||||||
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
ButtonBar.VSplitLeft(5.0f, 0, &ButtonBar);
|
||||||
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
ButtonBar.VSplitLeft(120.0f, &Button, &ButtonBar);
|
||||||
static int s_SpectateButton = 0;
|
|
||||||
if(DoButton_Menu(&s_SpectateButton, Localize("Join game"), 0, &Button))
|
if(DoButton_Menu(&s_SpectateButton, Localize("Join game"), 0, &Button))
|
||||||
{
|
{
|
||||||
m_pClient->SendSwitchTeam(0);
|
m_pClient->SendSwitchTeam(0);
|
||||||
|
|
Loading…
Reference in a new issue