Skip to content

Commit

Permalink
changed in game menu (divided game stuff from settings)
Browse files Browse the repository at this point in the history
  • Loading branch information
SushiTee authored and oy committed Jul 17, 2012
1 parent 8df2d01 commit c6d6328
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 63 deletions.
Empty file modified scripts/make_src.py
100644 → 100755
Empty file.
96 changes: 68 additions & 28 deletions src/game/client/components/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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_CallVoteButton=0;
if(DoButton_MenuTab(&s_CallVoteButton, Localize("Call vote"), m_ActivePage==PAGE_CALLVOTE, &Button, CUI::CORNER_TR))
NewPage = PAGE_CALLVOTE;
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.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(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.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_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_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_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)
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CMenus : public CComponent

enum
{
PAGE_NEWS=1,
PAGE_NEWS=0,
PAGE_GAME,
PAGE_PLAYERS,
PAGE_SERVER_INFO,
Expand Down
35 changes: 1 addition & 34 deletions src/game/client/components/menus_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c6d6328

Please sign in to comment.