adjusted the preferences in BackgroundMusic and MainVolume
This commit is contained in:
		
						parent
						
							d3429bf4f0
						
					
				
				
					commit
					f6f87c4f5d
				
			@@ -1,6 +1,5 @@
 | 
			
		||||
package pp.battleship.client;
 | 
			
		||||
 | 
			
		||||
import com.jme3.app.Application;
 | 
			
		||||
import com.jme3.audio.AudioData.DataType;
 | 
			
		||||
import com.jme3.audio.AudioNode;
 | 
			
		||||
import com.jme3.audio.AudioSource.Status;
 | 
			
		||||
@@ -15,7 +14,7 @@
 | 
			
		||||
public class BackgroundMusic implements GameEventListener {
 | 
			
		||||
    private static final String VOLUME_PREF = "volume";
 | 
			
		||||
    private static final String MUSIC_ENABLED_PREF = "musicEnabled";
 | 
			
		||||
    private Preferences prefs = Preferences.userNodeForPackage(BackgroundMusic.class);
 | 
			
		||||
    private static final Preferences prefs = Preferences.userNodeForPackage(BackgroundMusic.class);
 | 
			
		||||
 | 
			
		||||
    static final Logger LOGGER = System.getLogger(BackgroundMusic.class.getName());
 | 
			
		||||
 | 
			
		||||
@@ -98,6 +97,11 @@ public void stop(AudioNode audioNode) {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * pauses the given audi node
 | 
			
		||||
     *
 | 
			
		||||
     * @param audioNode the audio node to be paused
 | 
			
		||||
     */
 | 
			
		||||
    public void pause(AudioNode audioNode) {
 | 
			
		||||
        if (audioNode.getStatus() == Status.Playing) {
 | 
			
		||||
            audioNode.pause();
 | 
			
		||||
 
 | 
			
		||||
@@ -1,13 +1,11 @@
 | 
			
		||||
package pp.battleship.client;
 | 
			
		||||
 | 
			
		||||
import pp.battleship.model.Battleship;
 | 
			
		||||
 | 
			
		||||
import java.lang.System.Logger;
 | 
			
		||||
import java.lang.System.Logger.Level;
 | 
			
		||||
import java.util.prefs.Preferences;
 | 
			
		||||
 | 
			
		||||
public class MainVolume {
 | 
			
		||||
    private Preferences prefs = Preferences.userNodeForPackage(MainVolume.class);
 | 
			
		||||
    private static final Preferences prefs = Preferences.userNodeForPackage(MainVolume.class);
 | 
			
		||||
    private static final String MAIN_VOLUME_PREFS = "MainVolume";
 | 
			
		||||
    static final Logger LOGGER = System.getLogger(MainVolume.class.getName());
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user