@@ -53,52 +53,41 @@ public Scene MainMenuStage(final Stage stage){
53
53
54
54
//Button1
55
55
final Button button_playgame = new Button ("▶ Spiel starten ▶" );
56
- button_playgame .setMinWidth (buttonBox .getPrefWidth ());
57
- button_playgame .setMinHeight (buttonBox .getPrefHeight ());
58
-
59
-
60
- //Set a event for the Button
61
- button_playgame .addEventHandler (ActionEvent .ACTION , new EventHandler <ActionEvent >() {
62
- @ Override
63
- public void handle (ActionEvent actionEvent ){
64
- Game g = new Game ();
65
- stage .setScene (g .GameMainStage (stage ));
66
- stage .setFullScreen (true );
67
- }
68
-
69
- });
70
-
56
+ button_playgame .setMinWidth (buttonBox .getPrefWidth ());
57
+ button_playgame .setMinHeight (buttonBox .getPrefHeight ());
58
+ button_playgame .addEventHandler (ActionEvent .ACTION , actionEvent -> {
59
+ Game g = new Game ();
60
+ stage .setScene (g .GameMainStage (stage ));
61
+ stage .setFullScreen (true );
62
+ });
71
63
//Button2
72
64
final Button button_settings = new Button ("⚙ Einstellungen ⚙" );
73
- button_settings .setMinWidth (buttonBox .getPrefWidth ());
74
- button_settings .setMinHeight (buttonBox .getPrefHeight ());
75
-
76
- //Set a event for the Button
77
- button_settings .addEventHandler (ActionEvent .ACTION , new EventHandler <ActionEvent >() {
78
- @ Override
79
- public void handle (ActionEvent actionEvent ){
80
- SettingsMenu sm = new SettingsMenu ();
81
- stage .setScene (sm .SettingsScene (stage ));
82
- stage .centerOnScreen ();
83
- }
84
-
85
- });
86
- //Button3
65
+ button_settings .setMinWidth (buttonBox .getPrefWidth ());
66
+ button_settings .setMinHeight (buttonBox .getPrefHeight ());
67
+ button_settings .addEventHandler (ActionEvent .ACTION , actionEvent -> {
68
+ SettingsMenu sm = new SettingsMenu ();
69
+ stage .setScene (sm .SettingsScene (stage ));
70
+ stage .centerOnScreen ();
71
+ });
72
+ // Tutorial
73
+ Button button_dummy = new Button ("⁉ Spielanleitung ⁉" );
74
+ button_dummy .setMinWidth (buttonBox .getPrefWidth ());
75
+ button_dummy .setMinHeight (buttonBox .getPrefHeight ());
76
+ button_dummy .addEventHandler (ActionEvent .ACTION , actionEvent -> {
77
+ Stage stageTutorial = new Stage ();
78
+ TutorialMenu sm = new TutorialMenu ();
79
+ stageTutorial .setScene (sm .TutorialScene (stageTutorial ));
80
+ stageTutorial .centerOnScreen ();
81
+ stageTutorial .show ();
82
+ });
83
+ // Beenden
87
84
Button button_exit = new Button ("☠ Beenden ☠" );
88
- button_exit .setMinWidth (buttonBox .getPrefWidth ());
89
- button_exit .setMinHeight (buttonBox .getPrefHeight ());
90
-
91
- //Set a event for the Button
92
- button_exit .addEventHandler (ActionEvent .ACTION , new EventHandler <ActionEvent >() {
93
- @ Override
94
- public void handle (ActionEvent actionEvent ){
95
- stage .close ();
96
- }
97
-
98
- });
85
+ button_exit .setMinWidth (buttonBox .getPrefWidth ());
86
+ button_exit .setMinHeight (buttonBox .getPrefHeight ());
87
+ button_exit .addEventHandler (ActionEvent .ACTION , actionEvent -> stage .close ());
99
88
100
89
//Adding the Buttons to the VBox and the VBox to the BorderPane
101
- buttonBox .getChildren ().addAll (button_playgame , button_settings , button_exit );
90
+ buttonBox .getChildren ().addAll (button_playgame , button_settings , button_dummy , button_exit );
102
91
mainPane .setCenter (buttonBox );
103
92
104
93
0 commit comments