make sample override a percent instread of boolean

This commit is contained in:
yugecin 2016-10-01 10:46:28 +02:00
parent 1f68136639
commit d424db9a7f
3 changed files with 13 additions and 5 deletions

View File

@ -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.

View File

@ -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();

View File

@ -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