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

Commit 3fe9948

Browse files
committed
Make the "back to main menu" button position relative to its container
1 parent dac9cdb commit 3fe9948

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Menus/MainMenuGUI.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,6 @@ void MainMenuGUI::Update()
674674
m_MainMenuButtons[BACKTOMAIN]->SetVisible(false);
675675
m_MainMenuButtons[PLAYTUTORIAL]->SetVisible(false);
676676
m_MainMenuButtons[METACONTINUE]->SetVisible(false);
677-
// Move main menu button back to center
678-
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(260, 320);
679677
m_ScreenChange = false;
680678
}
681679

@@ -735,7 +733,7 @@ void MainMenuGUI::Update()
735733
// m_pGUIController->GetControl("ButtonStartSkirmish")->SetVisible(true);
736734
UpdateTeamBoxes();
737735
// Move main menu button over so the start button fits
738-
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(200, 280);
736+
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(200, 280);
739737
m_MainMenuButtons[BACKTOMAIN]->SetVisible(true);
740738
m_ScreenChange = false;
741739
}
@@ -770,7 +768,8 @@ void MainMenuGUI::Update()
770768
{
771769
m_apScreenBox[OPTIONSSCREEN]->SetVisible(true);
772770
m_MainMenuButtons[BACKTOMAIN]->SetVisible(true);
773-
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(260, 360);
771+
m_apScreenBox[OPTIONSSCREEN]->GUIPanel::AddChild(m_MainMenuButtons[BACKTOMAIN]);
772+
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(180, 220);
774773
m_pBackToOptionsButton->SetVisible(false);
775774
UpdateDeviceLabels();
776775
m_ScreenChange = false;
@@ -813,7 +812,8 @@ void MainMenuGUI::Update()
813812
if (m_ScreenChange) {
814813
m_apScreenBox[EDITORSCREEN]->SetVisible(true);
815814
m_MainMenuButtons[BACKTOMAIN]->SetVisible(true);
816-
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(260, 285);
815+
m_apScreenBox[EDITORSCREEN]->GUIPanel::AddChild(m_MainMenuButtons[BACKTOMAIN]);
816+
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(4, 145);
817817
m_ScreenChange = false;
818818
}
819819
}
@@ -825,7 +825,8 @@ void MainMenuGUI::Update()
825825
if (m_ScreenChange) {
826826
m_apScreenBox[CREDITSSCREEN]->SetVisible(true);
827827
m_MainMenuButtons[BACKTOMAIN]->SetVisible(true);
828-
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(260, 430);
828+
m_apScreenBox[CREDITSSCREEN]->GUIPanel::AddChild(m_MainMenuButtons[BACKTOMAIN]);
829+
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(240, 298);
829830
// Set the scroll panel to be out of sight at the bottom of the credits screen box
830831
m_pScrollPanel->SetPositionRel(0, m_apScreenBox[CREDITSSCREEN]->GetHeight());
831832
m_ScrollTimer.Reset();
@@ -1139,7 +1140,6 @@ void MainMenuGUI::Update()
11391140
// Hide all screens, the appropriate screen will reappear on next update
11401141
HideAllScreens();
11411142
m_MainMenuButtons[BACKTOMAIN]->SetVisible(false);
1142-
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(260, 280);
11431143

11441144
// If leaving the options screen, save the settings!
11451145
if (m_MenuScreen == OPTIONSSCREEN)
@@ -1241,8 +1241,6 @@ void MainMenuGUI::Update()
12411241
// CPU team present, so ask for the difficulty level of it before starting
12421242
else
12431243
{
1244-
// Move main menu button back to center
1245-
m_MainMenuButtons[BACKTOMAIN]->SetPositionRel(260, 280);
12461244
m_MenuScreen = DIFFICULTYSCREEN;
12471245
m_ScreenChange = true;
12481246
g_GUISound.ButtonPressSound()->Play();

0 commit comments

Comments
 (0)