Implemented volume-bg and master volume setting.

- All sounds are now multiplied by a master volume setting.
- Changed all default volume levels.
- Scrolling in the main menu and game states changes the master volume and displays a volume bar on the right side of the screen.
- "volume-bg.png" image by @kouyang.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-20 14:52:02 -05:00
parent f9c0794693
commit 3b13cc794b
12 changed files with 150 additions and 10 deletions

View File

@@ -133,7 +133,7 @@ public class MusicController {
*/
public static void playAt(final int position, final boolean loop) {
if (trackExists()) {
SoundStore.get().setMusicVolume(Options.getMusicVolume());
setVolume(Options.getMusicVolume() * Options.getMasterVolume());
player.setPosition(position / 1000f);
if (loop)
player.loop();
@@ -303,7 +303,8 @@ public class MusicController {
* Toggles the volume dim state of the current track.
*/
public static void toggleTrackDimmed() {
setVolume((trackDimmed) ? Options.getMusicVolume() : Options.getMusicVolume() / 3f);
float volume = Options.getMusicVolume() * Options.getMasterVolume();
setVolume((trackDimmed) ? volume : volume / 3f);
trackDimmed = !trackDimmed;
}