changed in game menu (divided game stuff from settings)

This commit is contained in:
SushiTee 2012-03-24 21:17:52 +01:00 committed by oy
parent 8df2d0140c
commit c6d6328353
4 changed files with 66 additions and 59 deletions

0
scripts/make_src.py Normal file → Executable file
View file

View file

@ -812,35 +812,75 @@ int CMenus::RenderMenubar(CUIRect r)
else else
{ {
// online menus // online menus
Box.VSplitLeft(90.0f, &Button, &Box); if(m_GamePage != PAGE_SETTINGS) // Game stuff
static int s_GameButton=0; {
if(DoButton_MenuTab(&s_GameButton, Localize("Game"), m_ActivePage==PAGE_GAME, &Button, CUI::CORNER_TL)) Box.VSplitLeft(90.0f, &Button, &Box);
NewPage = PAGE_GAME; 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); Box.VSplitLeft(90.0f, &Button, &Box);
static int s_PlayersButton=0; static int s_PlayersButton=0;
if(DoButton_MenuTab(&s_PlayersButton, Localize("Players"), m_ActivePage==PAGE_PLAYERS, &Button, 0)) if(DoButton_MenuTab(&s_PlayersButton, Localize("Players"), m_ActivePage==PAGE_PLAYERS, &Button, 0))
NewPage = PAGE_PLAYERS; NewPage = PAGE_PLAYERS;
Box.VSplitLeft(130.0f, &Button, &Box); Box.VSplitLeft(130.0f, &Button, &Box);
static int s_ServerInfoButton=0; static int s_ServerInfoButton=0;
if(DoButton_MenuTab(&s_ServerInfoButton, Localize("Server info"), m_ActivePage==PAGE_SERVER_INFO, &Button, 0)) if(DoButton_MenuTab(&s_ServerInfoButton, Localize("Server info"), m_ActivePage==PAGE_SERVER_INFO, &Button, 0))
NewPage = PAGE_SERVER_INFO; NewPage = PAGE_SERVER_INFO;
Box.VSplitLeft(130.0f, &Button, &Box); Box.VSplitLeft(130.0f, &Button, &Box);
static int s_CallVoteButton=0; static int s_CallVoteButton=0;
if(DoButton_MenuTab(&s_CallVoteButton, Localize("Call vote"), m_ActivePage==PAGE_CALLVOTE, &Button, CUI::CORNER_TR)) if(DoButton_MenuTab(&s_CallVoteButton, Localize("Call vote"), m_ActivePage==PAGE_CALLVOTE, &Button, CUI::CORNER_TR))
NewPage = PAGE_CALLVOTE; NewPage = PAGE_CALLVOTE;
Box.VSplitRight(90.0f, &Box, &Button); Box.VSplitRight(90.0f, &Box, &Button);
static int s_QuitButton=0; 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; m_Popup = POPUP_QUIT;
Box.VSplitRight(130.0f, &Box, &Button); Box.VSplitRight(130.0f, &Box, &Button);
static int s_SettingsButton=0; 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; 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) if(NewPage != -1)

View file

@ -134,7 +134,7 @@ class CMenus : public CComponent
enum enum
{ {
PAGE_NEWS=1, PAGE_NEWS=0,
PAGE_GAME, PAGE_GAME,
PAGE_PLAYERS, PAGE_PLAYERS,
PAGE_SERVER_INFO, PAGE_SERVER_INFO,

View file

@ -1538,40 +1538,7 @@ void CMenus::RenderSettings(CUIRect MainView)
CUIRect RestartWarning; CUIRect RestartWarning;
MainView.HSplitBottom(15.0f, &MainView, &RestartWarning); MainView.HSplitBottom(15.0f, &MainView, &RestartWarning);
RenderTools()->DrawUIRect(&MainView, ms_ColorTabbarActive, CUI::CORNER_ALL, 10.0f);
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
MainView.HSplitTop(10.0f, 0, &MainView); MainView.HSplitTop(10.0f, 0, &MainView);