|
28 | 28 |
|
29 | 29 | public class MainMenu extends FXGLMenu { |
30 | 30 | private static final int SIZE = 250; |
31 | | - private final Animation<?> animation; |
32 | 31 | private final Rectangle buttonLevel1; |
33 | 32 | private final Rectangle buttonLevel2; |
34 | 33 | private final Rectangle buttonLevel3; |
@@ -148,12 +147,14 @@ public MainMenu(MenuType menuType, LevelManager levelManager) { |
148 | 147 | buttonLogin.setArcWidth(15); |
149 | 148 | buttonLogin.strokeProperty().bind(Bindings.when(buttonLogin.hoverProperty()).then(Color.web("425622",1.0)).otherwise(Color.web("6E834C",1.0))); |
150 | 149 | buttonLogin.fillProperty().bind(Bindings.when(buttonLogin.pressedProperty()).then(Color.web("425622",1.0)).otherwise(Color.web("6E834C",1.0))); |
151 | | - buttonLogin.setOnMouseClicked(e -> getDialogService().showInputBox("Please enter your name:", answer -> levelManager.setName(answer, c -> { |
152 | | - textLogin.setText("LOGGED IN"); |
153 | | - lockButtons(levelManager.levelProgress); |
154 | | - showHighscores(); |
155 | | - return null; |
156 | | - }))); |
| 150 | + buttonLogin.setOnMouseClicked(e -> getDialogService().showInputBox("Please enter your name:", answer -> { |
| 151 | + levelManager.setName(answer.toLowerCase(), c -> { |
| 152 | + textLogin.setText("LOGGED IN"); |
| 153 | + lockButtons(levelManager.levelProgress); |
| 154 | + showHighscores(); |
| 155 | + return null; |
| 156 | + }); |
| 157 | + })); |
157 | 158 |
|
158 | 159 | // Button Quit |
159 | 160 | var buttonQuit = new Rectangle(SIZE, 60); |
@@ -222,19 +223,19 @@ public MainMenu(MenuType menuType, LevelManager levelManager) { |
222 | 223 |
|
223 | 224 |
|
224 | 225 | // HighScore Level 1 |
225 | | - highScoreLevel1 = FXGL.getUIFactoryService().newText("", Color.RED, FontType.GAME, 24.0); |
| 226 | + highScoreLevel1 = FXGL.getUIFactoryService().newText("", Color.web("9db379",1.0), FontType.GAME, 24.0); |
226 | 227 | highScoreLevel1.setTextAlignment(TextAlignment.CENTER); |
227 | 228 |
|
228 | 229 | // HighScore Level 2 |
229 | | - highScoreLevel2 = FXGL.getUIFactoryService().newText("", Color.RED, FontType.GAME, 24.0); |
| 230 | + highScoreLevel2 = FXGL.getUIFactoryService().newText("", Color.web("9db379",1.0), FontType.GAME, 24.0); |
230 | 231 | highScoreLevel2.setTextAlignment(TextAlignment.CENTER); |
231 | 232 |
|
232 | 233 | // HighScore Level 3 |
233 | | - highScoreLevel3 = FXGL.getUIFactoryService().newText("", Color.RED, FontType.GAME, 24.0); |
| 234 | + highScoreLevel3 = FXGL.getUIFactoryService().newText("", Color.web("9db379",1.0), FontType.GAME, 24.0); |
234 | 235 | highScoreLevel3.setTextAlignment(TextAlignment.CENTER); |
235 | 236 |
|
236 | 237 | // HighScore Level 4 |
237 | | - highScoreLevel4 = FXGL.getUIFactoryService().newText("", Color.RED, FontType.GAME, 24.0); |
| 238 | + highScoreLevel4 = FXGL.getUIFactoryService().newText("", Color.web("9db379",1.0), FontType.GAME, 24.0); |
238 | 239 | highScoreLevel4.setTextAlignment(TextAlignment.CENTER); |
239 | 240 |
|
240 | 241 |
|
|
0 commit comments