diff --git a/core/assets/options/Audio_Volume_up.png b/core/assets/options/Audio_Volume_up.png new file mode 100644 index 0000000000000000000000000000000000000000..8a70426ce4633adefeb6b35b5244e5d93a763d4b Binary files /dev/null and b/core/assets/options/Audio_Volume_up.png differ diff --git a/core/assets/options/Audio_Voume_down.png b/core/assets/options/Audio_Voume_down.png new file mode 100644 index 0000000000000000000000000000000000000000..13002a7f1d1ce0a353790e991a068756784ecb3f Binary files /dev/null and b/core/assets/options/Audio_Voume_down.png differ diff --git a/core/assets/options/Audio_mute.png b/core/assets/options/Audio_mute.png new file mode 100644 index 0000000000000000000000000000000000000000..b302d663274dca13823f02336dc9fbd68fb15bf8 Binary files /dev/null and b/core/assets/options/Audio_mute.png differ diff --git a/core/assets/options/Button_Vorlage.png b/core/assets/options/Button_Vorlage.png new file mode 100644 index 0000000000000000000000000000000000000000..63bb4e533d27fd7e732324ff8cb0ca5ce99d1788 Binary files /dev/null and b/core/assets/options/Button_Vorlage.png differ diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/MuteButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/MuteButton.java new file mode 100644 index 0000000000000000000000000000000000000000..14f3c2f31693adf90cb9045ea87d355d6411946c --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/MuteButton.java @@ -0,0 +1,32 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Audio; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.InputEvent; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; +import com.badlogic.gdx.audio.*; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.ImButton; + + +public class MuteButton extends ImButton { + + private Sound sound; + private Main main; + + public MuteButton(float x, float y, float width, float height, Main main){ + super(new Texture("options/Audio_mute.png"), x, y, width, height); + this.main = main; + this.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + leftClick(); + } + }); + } + + @Override + public void leftClick(){ + //gamesound pausieren + return; + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/VolumeDownButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/VolumeDownButton.java new file mode 100644 index 0000000000000000000000000000000000000000..b424c43d2672e461737b18730dcf70d70ed59321 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/VolumeDownButton.java @@ -0,0 +1,29 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Audio; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.InputEvent; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.ImButton; + +public class VolumeDownButton extends ImButton { + + private Sound sound; + private Main main; + + public VolumeDownButton(float x, float y, float width, float height, Main main) { + super(new Texture("options/Audio_Voume_down.png"), x, y, width, height); + this.main = main; + this.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + leftClick(); + } + }); + } + + @Override + public void leftClick() { + //lower sound voulme + } +} \ No newline at end of file diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/VolumeUpButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/VolumeUpButton.java new file mode 100644 index 0000000000000000000000000000000000000000..442b06681c9c8fc2403bfffc3241acdd71256a99 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/VolumeUpButton.java @@ -0,0 +1,30 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Audio; + +import com.badlogic.gdx.audio.Sound; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.InputEvent; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; +import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.ImButton; + +public class VolumeUpButton extends ImButton { + + private Sound sound; + private Main main; + + public VolumeUpButton(float x, float y, float width, float height, Main main){ + super(new Texture("options/Audio_Volume_up.png"), x, y, width, height); + this.main = main; + this.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + leftClick(); + } + }); + } + + @Override + public void leftClick(){ + //rise sound voulme + } + +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/AudioUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/AudioUI.java index 31fec312ae91e1cc2f192ed443d6b3f6ece18684..6fc30668569f90bf401d559ce6ea55b0d53e5fb8 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/AudioUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/AudioUI.java @@ -5,6 +5,9 @@ import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.Stage; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Audio.MuteButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Audio.VolumeDownButton; +import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Audio.VolumeUpButton; import com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.General.BackButton; import com.galaxytrucker.galaxytruckerreloaded.View.Screen.GamePlay; import com.galaxytrucker.galaxytruckerreloaded.View.Screen.MainMenu; @@ -19,6 +22,9 @@ public class AudioUI { private BackButton backButton; private Stage stage; private MainMenu mainMenu; + private MuteButton muteButton; + private VolumeUpButton volumeUpButton; + private VolumeDownButton volumeDownButton; /** * Constructor @@ -44,8 +50,14 @@ public class AudioUI { y = main.HEIGHT / 2 - audioBackgroundTexture.getHeight() / 2; backButton = new BackButton(x + 220, y + 100, 128, 24, optionUI, this); + muteButton = new MuteButton(x + 220, y + (3*audioBackgroundTexture.getHeight() / 5),128,24,main); + volumeDownButton = new VolumeDownButton(x + 220 - 130, y + (3*audioBackgroundTexture.getHeight() / 5) ,128,24, main); + volumeUpButton = new VolumeUpButton(x + 220 + 130, y + (3*audioBackgroundTexture.getHeight() / 5) ,128,24,main); stage.addActor(backButton); + stage.addActor(muteButton); + stage.addActor(volumeDownButton); + stage.addActor(volumeUpButton); } /** @@ -67,6 +79,9 @@ public class AudioUI { public void disposeAudioUI() { audioBackgroundTexture.dispose(); backButton.remove(); + volumeUpButton.remove(); + volumeDownButton.remove(); + muteButton.remove(); if(gamePlay != null){ gamePlay.deleteAudioUI(); }