mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-25 05:49:44 +01:00
added missing comments to public void setVolume and
public void update. Also removed unused import statements.
This commit is contained in:
parent
f541f3edc0
commit
3bdc9c20dc
@ -8,8 +8,7 @@ import com.jme3.asset.AssetLoadException;
|
|||||||
import com.jme3.asset.AssetNotFoundException;
|
import com.jme3.asset.AssetNotFoundException;
|
||||||
import com.jme3.audio.AudioData;
|
import com.jme3.audio.AudioData;
|
||||||
import com.jme3.audio.AudioNode;
|
import com.jme3.audio.AudioNode;
|
||||||
import pp.battleship.notification.GameEventListener;
|
|
||||||
import pp.battleship.notification.SoundEvent;
|
|
||||||
|
|
||||||
import java.lang.System.Logger;
|
import java.lang.System.Logger;
|
||||||
import java.lang.System.Logger.Level;
|
import java.lang.System.Logger.Level;
|
||||||
@ -116,6 +115,12 @@ public class GameMusic extends AbstractAppState {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the vol param to the level set in PREFERENCES
|
||||||
|
*
|
||||||
|
* @param vol Volume level of the music as indicated by the Volume control Slider
|
||||||
|
*
|
||||||
|
*/
|
||||||
public void setVolume(float vol){
|
public void setVolume(float vol){
|
||||||
menuMusicModern.setVolume(vol);
|
menuMusicModern.setVolume(vol);
|
||||||
PREFERENCES.putFloat(VOLUME_PREF, vol);
|
PREFERENCES.putFloat(VOLUME_PREF, vol);
|
||||||
|
@ -3,6 +3,7 @@ package pp.battleship.client.gui;
|
|||||||
import com.simsilica.lemur.Slider;
|
import com.simsilica.lemur.Slider;
|
||||||
import pp.battleship.client.GameMusic;
|
import pp.battleship.client.GameMusic;
|
||||||
|
|
||||||
|
|
||||||
public class VolumeControl extends Slider {
|
public class VolumeControl extends Slider {
|
||||||
|
|
||||||
private final GameMusic menuMusicModern;
|
private final GameMusic menuMusicModern;
|
||||||
@ -16,6 +17,10 @@ public class VolumeControl extends Slider {
|
|||||||
getModel().setPercent(vol);
|
getModel().setPercent(vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the volume of the music to the appropriate level set by the User through the Volume control Slider
|
||||||
|
*
|
||||||
|
*/
|
||||||
public void update() {
|
public void update() {
|
||||||
if (vol != getModel().getPercent()) {
|
if (vol != getModel().getPercent()) {
|
||||||
vol = getModel().getPercent();
|
vol = getModel().getPercent();
|
||||||
|
Loading…
Reference in New Issue
Block a user