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

Commit 557c7ec

Browse files
committed
Preparation for whole-screen-root
1 parent 5a40670 commit 557c7ec

File tree

1 file changed

+46
-42
lines changed

1 file changed

+46
-42
lines changed

Menus/MainMenuGUI.cpp

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,17 @@ 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-
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());
202-
203-
// Set up screens' initial positions and visibility
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+
//}
204207
m_apScreenBox[QUITSCREEN]->CenterInParent(true, true);
208+
205209
// Hide all screens, the appropriate screen will reappear on next update
206210
HideAllScreens();
207211

@@ -706,17 +710,17 @@ void MainMenuGUI::Update()
706710
//////////////////////////////////////
707711
// PLAYERS MENU SCREEN
708712

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

721725
//////////////////////////////////////
722726
// SKIRMISH SETUP MENU SCREEN
@@ -1171,31 +1175,31 @@ void MainMenuGUI::Update()
11711175
// PLAYER SCREEN BUTTONS
11721176
// Player count setting button pressed
11731177

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

12001204
/////////////////////////////////////////////
12011205
// SKIRMISH SETUP SCREEN BUTTONS

0 commit comments

Comments
 (0)