From 9ff205b4de204f99d529c84b2563c8ea3188b348 Mon Sep 17 00:00:00 2001 From: Mat Date: Thu, 18 May 2023 17:31:45 +0200 Subject: [PATCH] Changes by tonitch --- .../java/school_project/Menu/MenuAccueil.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/school_project/Menu/MenuAccueil.java b/app/src/main/java/school_project/Menu/MenuAccueil.java index e07cb9d..e9fa22a 100644 --- a/app/src/main/java/school_project/Menu/MenuAccueil.java +++ b/app/src/main/java/school_project/Menu/MenuAccueil.java @@ -28,33 +28,25 @@ public class MenuAccueil extends StackPane { System.out.println(choosediff); switch (choosediff) { case "Easy": - SlctDifficulty.setOnAction(event1 -> { - try { - Controller.switchRoot(new GameUI(MapGenerator.generate(MapGenerator.Difficulty.Easy))); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - }); + try { + Controller.switchRoot(new GameUI(MapGenerator.generate(MapGenerator.Difficulty.Easy))); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } break; case "Medium": - SlctDifficulty.setOnAction(event1 -> { try { Controller.switchRoot(new GameUI(MapGenerator.generate(MapGenerator.Difficulty.Medium))); } catch (FileNotFoundException e) { throw new RuntimeException(e); } - }); - break; case "Difficult": - SlctDifficulty.setOnAction(event1 -> { try { Controller.switchRoot(new GameUI(MapGenerator.generate(MapGenerator.Difficulty.Difficult))); } catch (FileNotFoundException e) { throw new RuntimeException(e); } - }); - break; } });