Skip to content

Commit

Permalink
Fixed main menu options
Browse files Browse the repository at this point in the history
  • Loading branch information
LBF38 committed Jan 4, 2023
1 parent d51eb9d commit 776db93
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 776db93

Please sign in to comment.