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

Commit 708c783

Browse files
committed
Root screen covers the whole screen and all screens are centered
1 parent 00acb62 commit 708c783

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Menus/MainMenuGUI.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,15 @@ 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());
198+
m_apScreenBox[ROOT]->Resize(g_FrameMan.GetResX(), g_FrameMan.GetResY());
199+
200+
for (int iscreen = MAINSCREEN; iscreen < SCREENCOUNT; ++iscreen)
201+
{
202+
if (m_apScreenBox[iscreen]) {
203+
m_apScreenBox[iscreen]->CenterInParent(true, true);
204+
}
205+
}
202206

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

0 commit comments

Comments
 (0)