diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index ea509ffe..f9009224 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -435,7 +435,15 @@ public class Options { container.setMusicVolume(getMasterVolume() * getMusicVolume()); } }, - IGNORE_SAMPLE_VOLUME ("Ignore sample volume", "IgnoreBMSample", "Ignore hitsound volume set by beatmap", true), + SAMPLE_VOLUME_OVERRIDE ("Sample volume override", "BMSampleOverride", "Override beatmap hitsound volume", 100, 0, 100) { + @Override + public String getValueString() { + if (val == 0) { + return "Disabled"; + } + return super.getValueString(); + } + }, EFFECT_VOLUME ("Effect Volume", "VolumeEffect", "Volume of menu and game sounds.", 70, 0, 100), HITSOUND_VOLUME ("Hit Sound Volume", "VolumeHitSound", "Volume of hit sounds.", 30, 0, 100), MUSIC_OFFSET ("Music Offset", "Offset", "Adjust this value if hit objects are out of sync.", -75, -500, 500) { @@ -1272,7 +1280,7 @@ public class Options { * Returns the default hit sound volume. * @return the hit sound volume [0, 1] */ - public static boolean ignoreBeatmapSampleVolume() { return GameOption.IGNORE_SAMPLE_VOLUME.bool; } + public static float getSampleVolumeOverride() { return GameOption.SAMPLE_VOLUME_OVERRIDE.val / 100f; } /** * Returns the music offset time. diff --git a/src/itdelatrisu/opsu/audio/SoundController.java b/src/itdelatrisu/opsu/audio/SoundController.java index 7d354d81..73d00c3d 100644 --- a/src/itdelatrisu/opsu/audio/SoundController.java +++ b/src/itdelatrisu/opsu/audio/SoundController.java @@ -291,8 +291,8 @@ public class SoundController { if (hitSound < 0) return; - if (Options.ignoreBeatmapSampleVolume()) { - sampleVolumeMultiplier = 1f; + if (Options.getSampleVolumeOverride() > 0) { + sampleVolumeMultiplier = Options.getSampleVolumeOverride(); } float volume = Options.getHitSoundVolume() * sampleVolumeMultiplier * Options.getMasterVolume(); diff --git a/src/itdelatrisu/opsu/states/OptionsMenu.java b/src/itdelatrisu/opsu/states/OptionsMenu.java index 9effdd0d..81528478 100644 --- a/src/itdelatrisu/opsu/states/OptionsMenu.java +++ b/src/itdelatrisu/opsu/states/OptionsMenu.java @@ -70,7 +70,7 @@ public class OptionsMenu extends BasicGameState { GameOption.MUSIC_VOLUME, GameOption.EFFECT_VOLUME, GameOption.HITSOUND_VOLUME, - GameOption.IGNORE_SAMPLE_VOLUME, + GameOption.SAMPLE_VOLUME_OVERRIDE, GameOption.MUSIC_OFFSET, GameOption.DISABLE_SOUNDS, GameOption.ENABLE_THEME_SONG