Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 00acb62

Browse files
committed
Revert comments
1 parent f7adc0a commit 00acb62

File tree

1 file changed

+42
-46
lines changed

1 file changed

+42
-46
lines changed

Menus/MainMenuGUI.cpp

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,13 @@ int MainMenuGUI::Create(Controller *pController)
195195
m_apScreenBox[QUITSCREEN] = dynamic_cast<GUICollectionBox *>(m_pGUIController->GetControl("QuitConfirmBox"));
196196
m_apScreenBox[MODMANAGERSCREEN] = dynamic_cast<GUICollectionBox *>(m_pGUIController->GetControl("ModManagerScreen"));
197197

198-
//m_apScreenBox[ROOT]->Resize(g_FrameMan.GetResX(), g_FrameMan.GetResY());
199-
m_apScreenBox[ROOT]->SetPositionAbs((g_FrameMan.GetResX() - m_apScreenBox[ROOT]->GetWidth()) / 2, 0);// (g_FrameMan.GetResY() - pRootBox->GetHeight()) / 2);
200-
201-
//for (int iscreen = MAINSCREEN; iscreen < SCREENCOUNT; ++iscreen)
202-
//{
203-
// if (m_apScreenBox[iscreen]) {
204-
// m_apScreenBox[iscreen]->CenterInParent(true, true);
205-
// }
206-
//}
207-
m_apScreenBox[QUITSCREEN]->CenterInParent(true, true);
198+
GUICollectionBox *pRootBox = m_apScreenBox[ROOT];
199+
pRootBox->SetPositionAbs((g_FrameMan.GetResX() - pRootBox->GetWidth()) / 2, 0);// (g_FrameMan.GetResY() - pRootBox->GetHeight()) / 2);
200+
// NO, this screws up the menu positioning!
201+
// pRootBox->Resize(pRootBox->GetWidth(), g_FrameMan.GetResY());
208202

203+
// Set up screens' initial positions and visibility
204+
m_apScreenBox[QUITSCREEN]->CenterInParent(true, true);
209205
// Hide all screens, the appropriate screen will reappear on next update
210206
HideAllScreens();
211207

@@ -708,17 +704,17 @@ void MainMenuGUI::Update()
708704
//////////////////////////////////////
709705
// PLAYERS MENU SCREEN
710706

711-
// else if (m_MenuScreen == PLAYERSSCREEN)
712-
// {
713-
// if (m_ScreenChange)
714-
// {
715-
// m_apScreenBox[PLAYERSSCREEN]->SetVisible(true);
716-
// m_MainMenuButtons[BACKTOMAIN]->SetVisible(true);
717-
// m_ScreenChange = false;
718-
// }
719-
//
720-
//// m_MainMenuButtons[BACKTOMAIN]->SetFocus();
721-
// }
707+
else if (m_MenuScreen == PLAYERSSCREEN)
708+
{
709+
if (m_ScreenChange)
710+
{
711+
m_apScreenBox[PLAYERSSCREEN]->SetVisible(true);
712+
m_MainMenuButtons[BACKTOMAIN]->SetVisible(true);
713+
m_ScreenChange = false;
714+
}
715+
716+
// m_MainMenuButtons[BACKTOMAIN]->SetFocus();
717+
}
722718

723719
//////////////////////////////////////
724720
// SKIRMISH SETUP MENU SCREEN
@@ -1174,31 +1170,31 @@ void MainMenuGUI::Update()
11741170
// PLAYER SCREEN BUTTONS
11751171
// Player count setting button pressed
11761172

1177-
//if (m_MenuScreen == PLAYERSSCREEN &&
1178-
// (anEvent.GetControl()->GetName() == "ButtonOnePlayer" ||
1179-
// anEvent.GetControl()->GetName() == "ButtonTwoPlayers" ||
1180-
// anEvent.GetControl()->GetName() == "ButtonThreePlayers" ||
1181-
// anEvent.GetControl()->GetName() == "ButtonFourPlayers"))
1182-
// {
1183-
// // Hide all screens, the appropriate screen will reappear on next update
1184-
// HideAllScreens();
1185-
// m_MenuScreen = SKIRMISHSCREEN;
1186-
// m_ScreenChange = true;
1187-
1188-
// // Set desired player count
1189-
// if (anEvent.GetControl()->GetName() == "ButtonOnePlayer")
1190-
// m_StartPlayers = 1;
1191-
// else if (anEvent.GetControl()->GetName() == "ButtonTwoPlayers")
1192-
// m_StartPlayers = 2;
1193-
// else if (anEvent.GetControl()->GetName() == "ButtonThreePlayers")
1194-
// m_StartPlayers = 3;
1195-
// else if (anEvent.GetControl()->GetName() == "ButtonFourPlayers")
1196-
// m_StartPlayers = 4;
1197-
// else
1198-
// m_StartPlayers = 0;
1199-
1200-
// g_GUISound.ButtonPressSound()->Play();
1201-
// }
1173+
if (m_MenuScreen == PLAYERSSCREEN &&
1174+
(anEvent.GetControl()->GetName() == "ButtonOnePlayer" ||
1175+
anEvent.GetControl()->GetName() == "ButtonTwoPlayers" ||
1176+
anEvent.GetControl()->GetName() == "ButtonThreePlayers" ||
1177+
anEvent.GetControl()->GetName() == "ButtonFourPlayers"))
1178+
{
1179+
// Hide all screens, the appropriate screen will reappear on next update
1180+
HideAllScreens();
1181+
m_MenuScreen = SKIRMISHSCREEN;
1182+
m_ScreenChange = true;
1183+
1184+
// Set desired player count
1185+
if (anEvent.GetControl()->GetName() == "ButtonOnePlayer")
1186+
m_StartPlayers = 1;
1187+
else if (anEvent.GetControl()->GetName() == "ButtonTwoPlayers")
1188+
m_StartPlayers = 2;
1189+
else if (anEvent.GetControl()->GetName() == "ButtonThreePlayers")
1190+
m_StartPlayers = 3;
1191+
else if (anEvent.GetControl()->GetName() == "ButtonFourPlayers")
1192+
m_StartPlayers = 4;
1193+
else
1194+
m_StartPlayers = 0;
1195+
1196+
g_GUISound.ButtonPressSound()->Play();
1197+
}
12021198

12031199
/////////////////////////////////////////////
12041200
// SKIRMISH SETUP SCREEN BUTTONS

0 commit comments

Comments
 (0)