From 776db9351b0b4b212507750b90ea09c650ef7884 Mon Sep 17 00:00:00 2001 From: LBF38 Date: Wed, 4 Jan 2023 02:45:12 +0100 Subject: [PATCH] Fixed main menu options --- .../src/main/java/org/enstabretagne/Game/NewMainMenu.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/duelinvaders/src/main/java/org/enstabretagne/Game/NewMainMenu.java b/duelinvaders/src/main/java/org/enstabretagne/Game/NewMainMenu.java index 88a17bd..b9e5f3c 100644 --- a/duelinvaders/src/main/java/org/enstabretagne/Game/NewMainMenu.java +++ b/duelinvaders/src/main/java/org/enstabretagne/Game/NewMainMenu.java @@ -128,10 +128,10 @@ private VBox createOptions() { var soundVolume = getSettings().getGlobalSoundVolume(); var musicSlider = new Slider(0, 100, musicVolume * 100); var soundSlider = new Slider(0, 100, soundVolume * 100); - var musicText = getUIFactoryService().newText("Music Volume :" + musicVolume * 100, Color.GRAY, 22); + var musicText = getUIFactoryService().newText("Music Volume", Color.GRAY, 22); musicText.strokeProperty().set(Color.WHITE); musicText.setStrokeWidth(0.5); - var soundText = getUIFactoryService().newText("Sound Volume :" + soundVolume * 100, Color.GRAY, 22); + var soundText = getUIFactoryService().newText("Sound Volume", Color.GRAY, 22); soundText.strokeProperty().set(Color.WHITE); soundText.setStrokeWidth(0.5); var musicBox = new HBox(10, musicText, musicSlider); @@ -143,10 +143,10 @@ private VBox createOptions() { soundBox.setAlignment(Pos.CENTER); box.setAlignment(Pos.CENTER); - musicSlider.onDragDoneProperty().set(e -> { + musicSlider.onMouseReleasedProperty().set(e -> { getSettings().setGlobalMusicVolume(musicSlider.getValue() / 100); }); - soundSlider.onDragDoneProperty().set(e -> { + soundSlider.onMouseReleasedProperty().set(e -> { getSettings().setGlobalSoundVolume(soundSlider.getValue() / 100); }); return box;