"Fixed double sound bug"

This commit is contained in:
lieght
2025-10-03 18:34:48 +02:00
parent 796c3a2bc6
commit 56a1afe1cd
2 changed files with 5 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ public final class OptionsMenu extends Menu {
.addPostEvent(AudioEvents.GetCurrentVolume.class)
.onResponse(AudioEvents.GetCurrentVolumeReponse.class, event -> {
volumeSlider.setValue(event.currentVolume() * 100);
}).asyncPostEvent();
}, true).asyncPostEvent();
volumeSlider.setShowTickLabels(true);
volumeSlider.setShowTickMarks(true);
volumeSlider.setMajorTickUnit(25);
@@ -160,11 +160,8 @@ public final class OptionsMenu extends Menu {
if (now - lastPlayed[0] >= cooldown) {
lastPlayed[0] = now;
int value = newVal.intValue();
valueLabel.setText(String.valueOf(value));
new EventFlow().addPostEvent(new AudioEvents.PlayEffect("soft-button-click.wav", false)).asyncPostEvent();
// new EventFlow().addPostEvent(new AudioEvents.clickButton())
// .asyncPostEvent(); // TODO: creates double sound bug, WHYYY????
}
valueLabel.setText(String.valueOf(newVal.intValue()));
new EventFlow().addPostEvent(new AudioEvents.ChangeVolume(newVal.doubleValue()/100.0))