mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
changed in game menu (divided game stuff from settings)
This commit is contained in:
parent
8df2d0140c
commit
c6d6328353
0
scripts/make_src.py
Normal file → Executable file
0
scripts/make_src.py
Normal file → Executable file
|
@ -812,6 +812,8 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
else
|
||||
{
|
||||
// online menus
|
||||
if(m_GamePage != PAGE_SETTINGS) // Game stuff
|
||||
{
|
||||
Box.VSplitLeft(90.0f, &Button, &Box);
|
||||
static int s_GameButton=0;
|
||||
if(DoButton_MenuTab(&s_GameButton, Localize("Game"), m_ActivePage==PAGE_GAME, &Button, CUI::CORNER_TL))
|
||||
|
@ -834,14 +836,52 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
|
||||
Box.VSplitRight(90.0f, &Box, &Button);
|
||||
static int s_QuitButton=0;
|
||||
if(DoButton_MenuTab(&s_QuitButton, Localize("Quit"), 0, &Button, CUI::CORNER_TR))
|
||||
if(DoButton_Menu(&s_QuitButton, Localize("Quit"), 0, &Button, 12.0f, 0.0f, CUI::CORNER_TR))
|
||||
m_Popup = POPUP_QUIT;
|
||||
|
||||
Box.VSplitRight(130.0f, &Box, &Button);
|
||||
static int s_SettingsButton=0;
|
||||
if(DoButton_MenuTab(&s_SettingsButton, Localize("Settings"), m_ActivePage==PAGE_SETTINGS, &Button, CUI::CORNER_TL))
|
||||
if(DoButton_Menu(&s_SettingsButton, Localize("Settings"), 0, &Button, 12.0f, 0.0f, CUI::CORNER_TL))
|
||||
NewPage = PAGE_SETTINGS;
|
||||
}
|
||||
else // settings menu
|
||||
{
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_InGameGeneralButton=0;
|
||||
if(DoButton_MenuTab(&s_InGameGeneralButton, Localize("General"), g_Config.m_UiSettingsPage==SETTINGS_GENERAL, &Button, CUI::CORNER_TL))
|
||||
g_Config.m_UiSettingsPage = SETTINGS_GENERAL;
|
||||
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_InGamePlayerButton=0;
|
||||
if(DoButton_MenuTab(&s_InGamePlayerButton, Localize("Players"), g_Config.m_UiSettingsPage==SETTINGS_PLAYER, &Button, 0))
|
||||
g_Config.m_UiSettingsPage = SETTINGS_PLAYER;
|
||||
|
||||
Box.VSplitLeft(60.0f, &Button, &Box);
|
||||
static int s_InGameTeeButton=0;
|
||||
if(DoButton_MenuTab(&s_InGameTeeButton, Localize("Tee"), g_Config.m_UiSettingsPage==SETTINGS_TEE, &Button, 0))
|
||||
g_Config.m_UiSettingsPage = SETTINGS_TEE;
|
||||
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_InGameControlsButton=0;
|
||||
if(DoButton_MenuTab(&s_InGameControlsButton, Localize("Controls"), g_Config.m_UiSettingsPage==SETTINGS_CONTROLS, &Button, 0))
|
||||
g_Config.m_UiSettingsPage = SETTINGS_CONTROLS;
|
||||
|
||||
Box.VSplitLeft(100.0f, &Button, &Box);
|
||||
static int s_InGameGraphicsButton=0;
|
||||
if(DoButton_MenuTab(&s_InGameGraphicsButton, Localize("Graphics"), g_Config.m_UiSettingsPage==SETTINGS_GRAPHICS, &Button, 0))
|
||||
g_Config.m_UiSettingsPage = SETTINGS_GRAPHICS;
|
||||
|
||||
Box.VSplitLeft(90.0f, &Button, &Box);
|
||||
static int s_InGameSoundButton=0;
|
||||
if(DoButton_MenuTab(&s_InGameSoundButton, Localize("Sound"), g_Config.m_UiSettingsPage==SETTINGS_SOUND, &Button, CUI::CORNER_TR))
|
||||
g_Config.m_UiSettingsPage = SETTINGS_SOUND;
|
||||
|
||||
Box.VSplitRight(90.0f, &Box, &Button);
|
||||
static int s_InGameMenuButton=0;
|
||||
if(DoButton_Menu(&s_InGameMenuButton, Localize("Back"), 0, &Button, 12.0f, 0.0f, CUI::CORNER_T))
|
||||
NewPage = PAGE_GAME;
|
||||
}
|
||||
}
|
||||
|
||||
if(NewPage != -1)
|
||||
{
|
||||
|
|
|
@ -134,7 +134,7 @@ class CMenus : public CComponent
|
|||
|
||||
enum
|
||||
{
|
||||
PAGE_NEWS=1,
|
||||
PAGE_NEWS=0,
|
||||
PAGE_GAME,
|
||||
PAGE_PLAYERS,
|
||||
PAGE_SERVER_INFO,
|
||||
|
|
|
@ -1538,40 +1538,7 @@ void CMenus::RenderSettings(CUIRect MainView)
|
|||
|
||||
CUIRect RestartWarning;
|
||||
MainView.HSplitBottom(15.0f, &MainView, &RestartWarning);
|
||||
|
||||
if(Client()->State() != IClient::STATE_OFFLINE) // in game only
|
||||
{
|
||||
CUIRect Temp, TabBar;
|
||||
|
||||
// render background
|
||||
MainView.VSplitRight(120.0f, &MainView, &TabBar);
|
||||
RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_B|CUI::CORNER_TL, 10.0f);
|
||||
TabBar.HSplitTop(50.0f, &Temp, &TabBar);
|
||||
RenderTools()->DrawUIRect(&Temp, ms_ColorTabbarActive, CUI::CORNER_R, 10.0f);
|
||||
|
||||
// tabs
|
||||
CUIRect Button;
|
||||
|
||||
const char *aTabs[] = {
|
||||
Localize("General"),
|
||||
Localize("Player"),
|
||||
("Tee"),
|
||||
Localize("Controls"),
|
||||
Localize("Graphics"),
|
||||
Localize("Sound")};
|
||||
|
||||
int NumTabs = (int)(sizeof(aTabs)/sizeof(*aTabs));
|
||||
|
||||
for(int i = 0; i < NumTabs; i++)
|
||||
{
|
||||
TabBar.HSplitTop(10, &Button, &TabBar);
|
||||
TabBar.HSplitTop(26, &Button, &TabBar);
|
||||
if(DoButton_MenuTab(aTabs[i], aTabs[i], g_Config.m_UiSettingsPage == i, &Button, CUI::CORNER_R))
|
||||
g_Config.m_UiSettingsPage = i;
|
||||
}
|
||||
}
|
||||
else
|
||||
RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_ALL, 10.0f); // background
|
||||
RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_ALL, 10.0f);
|
||||
|
||||
MainView.HSplitTop(10.0f, 0, &MainView);
|
||||
|
||||
|
|
Loading…
Reference in a new issue