@@ -16,6 +16,9 @@ public class MainMenu : Node2D
1616 Util . Civ3FileDialog LoadScenarioDialog ;
1717 GlobalSingleton Global ;
1818
19+ readonly int MENU_OFFSET_FROM_TOP = 180 ;
20+ readonly int MENU_OFFSET_FROM_LEFT = 180 ;
21+
1922 // Called when the node enters the scene tree for the first time.
2023 public override void _Ready ( )
2124 {
@@ -46,16 +49,16 @@ private void DisplayTitleScreen()
4649 InactiveButton = Util . LoadTextureFromPCX ( "Art/buttonsFINAL.pcx" , 1 , 1 , 20 , 20 ) ;
4750 HoverButton = Util . LoadTextureFromPCX ( "Art/buttonsFINAL.pcx" , 22 , 1 , 20 , 20 ) ;
4851
49- AddButton ( "New Game" , 160 , "StartGame" ) ;
50- AddButton ( "Quick Start" , 195 , "StartGame" ) ;
51- AddButton ( "Tutorial" , 230 , "StartGame" ) ;
52- AddButton ( "Load Game" , 265 , "LoadGame" ) ;
53- AddButton ( "Load Scenario" , 300 , "LoadScenario" ) ;
54- AddButton ( "Hall of Fame" , 335 , "HallOfFame" ) ;
55- AddButton ( "Preferences" , 370 , "Preferences" ) ;
56- AddButton ( "Audio Preferences" , 405 , "Preferences" ) ;
57- AddButton ( "Credits" , 440 , "showCredits" ) ;
58- AddButton ( "Exit" , 475 , "_on_Exit_pressed" ) ;
52+ AddButton ( "New Game" , 0 , "StartGame" ) ;
53+ AddButton ( "Quick Start" , 35 , "StartGame" ) ;
54+ AddButton ( "Tutorial" , 70 , "StartGame" ) ;
55+ AddButton ( "Load Game" , 105 , "LoadGame" ) ;
56+ AddButton ( "Load Scenario" , 140 , "LoadScenario" ) ;
57+ AddButton ( "Hall of Fame" , 175 , "HallOfFame" ) ;
58+ AddButton ( "Preferences" , 210 , "Preferences" ) ;
59+ AddButton ( "Audio Preferences" , 245 , "Preferences" ) ;
60+ AddButton ( "Credits" , 280 , "showCredits" ) ;
61+ AddButton ( "Exit" , 315 , "_on_Exit_pressed" ) ;
5962
6063 // Hide select home folder if valid path is present as proven by reaching this point in code
6164 SetCiv3Home . Visible = false ;
@@ -81,14 +84,14 @@ private void AddButton(string label, int verticalPosition, string actionName)
8184 TextureButton newButton = new TextureButton ( ) ;
8285 newButton . TextureNormal = InactiveButton ;
8386 newButton . TextureHover = HoverButton ;
84- newButton . SetPosition ( new Vector2 ( 40 , verticalPosition ) ) ;
87+ newButton . SetPosition ( new Vector2 ( MENU_OFFSET_FROM_LEFT , MENU_OFFSET_FROM_TOP + verticalPosition ) ) ;
8588 MainMenuBackground . AddChild ( newButton ) ;
8689 newButton . Connect ( "pressed" , this , actionName ) ;
8790
8891 Button newButtonLabel = new Button ( ) ;
8992 newButtonLabel . Text = label ;
9093
91- newButtonLabel . SetPosition ( new Vector2 ( 65 , verticalPosition + BUTTON_LABEL_OFFSET ) ) ;
94+ newButtonLabel . SetPosition ( new Vector2 ( MENU_OFFSET_FROM_LEFT + 25 , MENU_OFFSET_FROM_TOP + verticalPosition + BUTTON_LABEL_OFFSET ) ) ;
9295 MainMenuBackground . AddChild ( newButtonLabel ) ;
9396 newButtonLabel . Connect ( "pressed" , this , actionName ) ;
9497 }
0 commit comments