Skip to content

Commit a193bf9

Browse files
committed
Remove mainMenu animation and username to lower
1 parent 7fc5d7a commit a193bf9

File tree

1 file changed

+8
-43
lines changed

1 file changed

+8
-43
lines changed

src/main/java/nl/hsleiden/joshuabloch/menu/MainMenu.java

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
public class MainMenu extends FXGLMenu {
2727
private static final int SIZE = 250;
28-
private final Animation<?> animation;
2928
private final Rectangle buttonLevel1;
3029
private final Rectangle buttonLevel2;
3130
private final Rectangle buttonLevel3;
@@ -143,12 +142,14 @@ public MainMenu(MenuType menuType, LevelManager levelManager) {
143142
buttonLogin.setArcWidth(15);
144143
buttonLogin.strokeProperty().bind(Bindings.when(buttonLogin.hoverProperty()).then(Color.web("425622",1.0)).otherwise(Color.web("6E834C",1.0)));
145144
buttonLogin.fillProperty().bind(Bindings.when(buttonLogin.pressedProperty()).then(Color.web("425622",1.0)).otherwise(Color.web("6E834C",1.0)));
146-
buttonLogin.setOnMouseClicked(e -> getDialogService().showInputBox("Please enter your name:", answer -> levelManager.setName(answer, c -> {
147-
textLogin.setText("LOGGED IN");
148-
lockButtons(levelManager.levelProgress);
149-
showHighscores();
150-
return null;
151-
})));
145+
buttonLogin.setOnMouseClicked(e -> getDialogService().showInputBox("Please enter your name:", answer -> {
146+
levelManager.setName(answer.toLowerCase(), c -> {
147+
textLogin.setText("LOGGED IN");
148+
lockButtons(levelManager.levelProgress);
149+
showHighscores();
150+
return null;
151+
});
152+
}));
152153

153154
// Button Quit
154155
var buttonQuit = new Rectangle(SIZE, 60);
@@ -297,42 +298,6 @@ public MainMenu(MenuType menuType, LevelManager levelManager) {
297298
lockButtons(levelManager.levelProgress);
298299

299300
getContentRoot().getChildren().addAll(imageView, vBoxMain);
300-
getContentRoot().setScaleX(0);
301-
getContentRoot().setScaleY(0);
302301

303-
304-
305-
306-
307-
308-
309-
animation = FXGL.animationBuilder()
310-
311-
.duration(Duration.seconds(0.66))
312-
313-
.interpolator(Interpolators.EXPONENTIAL.EASE_OUT())
314-
315-
.scale(getContentRoot())
316-
317-
.from(new Point2D(0, 0))
318-
319-
.to(new Point2D(1, 1))
320-
321-
.build();
322-
323-
}
324-
325-
@Override
326-
public void onCreate() {
327-
animation.setOnFinished(EmptyRunnable.INSTANCE);
328-
animation.stop();
329-
animation.start();
330-
331-
}
332-
333-
334-
@Override
335-
protected void onUpdate(double tpf) {
336-
animation.onUpdate(tpf);
337302
}
338303
}

0 commit comments

Comments
 (0)