@@ -195,17 +195,13 @@ int MainMenuGUI::Create(Controller *pController)
195
195
m_apScreenBox[QUITSCREEN] = dynamic_cast <GUICollectionBox *>(m_pGUIController->GetControl (" QuitConfirmBox" ));
196
196
m_apScreenBox[MODMANAGERSCREEN] = dynamic_cast <GUICollectionBox *>(m_pGUIController->GetControl (" ModManagerScreen" ));
197
197
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());
208
202
203
+ // Set up screens' initial positions and visibility
204
+ m_apScreenBox[QUITSCREEN]->CenterInParent (true , true );
209
205
// Hide all screens, the appropriate screen will reappear on next update
210
206
HideAllScreens ();
211
207
@@ -708,17 +704,17 @@ void MainMenuGUI::Update()
708
704
// ////////////////////////////////////
709
705
// PLAYERS MENU SCREEN
710
706
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
+ }
722
718
723
719
// ////////////////////////////////////
724
720
// SKIRMISH SETUP MENU SCREEN
@@ -1174,31 +1170,31 @@ void MainMenuGUI::Update()
1174
1170
// PLAYER SCREEN BUTTONS
1175
1171
// Player count setting button pressed
1176
1172
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
+ }
1202
1198
1203
1199
// ///////////////////////////////////////////
1204
1200
// SKIRMISH SETUP SCREEN BUTTONS
0 commit comments