From c6d632835305a5a61a21afb6cf8686263e9aefc6 Mon Sep 17 00:00:00 2001 From: SushiTee Date: Sat, 24 Mar 2012 21:17:52 +0100 Subject: [PATCH] changed in game menu (divided game stuff from settings) --- scripts/make_src.py | 0 src/game/client/components/menus.cpp | 88 ++++++++++++++----- src/game/client/components/menus.h | 2 +- src/game/client/components/menus_settings.cpp | 35 +------- 4 files changed, 66 insertions(+), 59 deletions(-) mode change 100644 => 100755 scripts/make_src.py diff --git a/scripts/make_src.py b/scripts/make_src.py old mode 100644 new mode 100755 diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 639616587..a761a3278 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -812,35 +812,75 @@ int CMenus::RenderMenubar(CUIRect r) else { // online menus - 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)) - NewPage = PAGE_GAME; + 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)) + NewPage = PAGE_GAME; - Box.VSplitLeft(90.0f, &Button, &Box); - static int s_PlayersButton=0; - if(DoButton_MenuTab(&s_PlayersButton, Localize("Players"), m_ActivePage==PAGE_PLAYERS, &Button, 0)) - NewPage = PAGE_PLAYERS; + Box.VSplitLeft(90.0f, &Button, &Box); + static int s_PlayersButton=0; + if(DoButton_MenuTab(&s_PlayersButton, Localize("Players"), m_ActivePage==PAGE_PLAYERS, &Button, 0)) + NewPage = PAGE_PLAYERS; - Box.VSplitLeft(130.0f, &Button, &Box); - static int s_ServerInfoButton=0; - if(DoButton_MenuTab(&s_ServerInfoButton, Localize("Server info"), m_ActivePage==PAGE_SERVER_INFO, &Button, 0)) - NewPage = PAGE_SERVER_INFO; + Box.VSplitLeft(130.0f, &Button, &Box); + static int s_ServerInfoButton=0; + if(DoButton_MenuTab(&s_ServerInfoButton, Localize("Server info"), m_ActivePage==PAGE_SERVER_INFO, &Button, 0)) + NewPage = PAGE_SERVER_INFO; - Box.VSplitLeft(130.0f, &Button, &Box); - static int s_CallVoteButton=0; - if(DoButton_MenuTab(&s_CallVoteButton, Localize("Call vote"), m_ActivePage==PAGE_CALLVOTE, &Button, CUI::CORNER_TR)) - NewPage = PAGE_CALLVOTE; + Box.VSplitLeft(130.0f, &Button, &Box); + static int s_CallVoteButton=0; + if(DoButton_MenuTab(&s_CallVoteButton, Localize("Call vote"), m_ActivePage==PAGE_CALLVOTE, &Button, CUI::CORNER_TR)) + NewPage = PAGE_CALLVOTE; - Box.VSplitRight(90.0f, &Box, &Button); - static int s_QuitButton=0; - if(DoButton_MenuTab(&s_QuitButton, Localize("Quit"), 0, &Button, CUI::CORNER_TR)) - m_Popup = POPUP_QUIT; + Box.VSplitRight(90.0f, &Box, &Button); + static int s_QuitButton=0; + 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)) - NewPage = PAGE_SETTINGS; + Box.VSplitRight(130.0f, &Box, &Button); + static int s_SettingsButton=0; + 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) diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 8b7db892c..12dfd082a 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -134,7 +134,7 @@ class CMenus : public CComponent enum { - PAGE_NEWS=1, + PAGE_NEWS=0, PAGE_GAME, PAGE_PLAYERS, PAGE_SERVER_INFO, diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 20ca5f470..0d17c2ccb 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -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);