From 6261ec0d5e6820a84069b8a4cd468bfc7d1a23c0 Mon Sep 17 00:00:00 2001 From: samuel <samnej@uni-bremen.de> Date: Sun, 28 Jun 2020 17:10:55 +0200 Subject: [PATCH] BackButtons --- .../OptionButtons/Audio/BackButton.java | 36 +++++++++++++++++++ .../OptionButtons/Control/BackButton.java | 36 +++++++++++++++++++ .../OptionButtons/Credits/BackButton.java | 36 +++++++++++++++++++ .../OptionButtons/Video/BackButton.java | 36 +++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/BackButton.java create mode 100644 core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Control/BackButton.java create mode 100644 core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Credits/BackButton.java create mode 100644 core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Video/BackButton.java diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/BackButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/BackButton.java new file mode 100644 index 00000000..e5edb932 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Audio/BackButton.java @@ -0,0 +1,36 @@ +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.View.Buttons.ImButton; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.AudioUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.GeneralUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.OptionUI; + +public class BackButton extends ImButton { + + private Sound clickSound; + + private OptionUI optionUI; + + private AudioUI audioUI; + + public BackButton(float x, float y, float width, float height, OptionUI optionUI, AudioUI audioUI) { + super(new Texture("options/escape_back_on.png"), x, y, width, height); + this.optionUI = optionUI; + this.audioUI = audioUI; + this.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + leftClick(); + } + }); + } + + @Override + public void leftClick() { + // Einkommentieren wenn disposeAudioUI implementiert// audioUI.disposeAudioUI(); + optionUI.showOptionsUI(); + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Control/BackButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Control/BackButton.java new file mode 100644 index 00000000..56b0db55 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Control/BackButton.java @@ -0,0 +1,36 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Control; + +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.View.Buttons.ImButton; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.ControlUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.GeneralUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.OptionUI; + +public class BackButton extends ImButton { + + private Sound clickSound; + + private OptionUI optionUI; + + private ControlUI controlUI; + + public BackButton(float x, float y, float width, float height, OptionUI optionUI, ControlUI controlUI) { + super(new Texture("options/escape_back_on.png"), x, y, width, height); + this.optionUI = optionUI; + this.controlUI = controlUI; + this.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + leftClick(); + } + }); + } + + @Override + public void leftClick() { + // Einkommentieren wenn disposeControlUI implementiert// controlUI.disposeControlUI(); + optionUI.showOptionsUI(); + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Credits/BackButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Credits/BackButton.java new file mode 100644 index 00000000..49b4eaac --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Credits/BackButton.java @@ -0,0 +1,36 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Credits; + +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.View.Buttons.ImButton; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.CreditsUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.GeneralUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.OptionUI; + +public class BackButton extends ImButton { + + private Sound clickSound; + + private OptionUI optionUI; + + private CreditsUI creditsUI; + + public BackButton(float x, float y, float width, float height, OptionUI optionUI, CreditsUI creditsUI) { + super(new Texture("options/escape_back_on.png"), x, y, width, height); + this.optionUI = optionUI; + this.creditsUI = creditsUI; + this.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + leftClick(); + } + }); + } + + @Override + public void leftClick() { + // Einkommentieren wenn disposeCreditsUI implementiert// creditsUI.disposeCreditsUI(); + optionUI.showOptionsUI(); + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Video/BackButton.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Video/BackButton.java new file mode 100644 index 00000000..996546df --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Buttons/InGameButtons/OptionButtons/Video/BackButton.java @@ -0,0 +1,36 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Buttons.InGameButtons.OptionButtons.Video; + +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.View.Buttons.ImButton; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.GeneralUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.OptionUI; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Options.VideoUI; + +public class BackButton extends ImButton { + + private Sound clickSound; + + private OptionUI optionUI; + + private VideoUI videoUI; + + public BackButton(float x, float y, float width, float height, OptionUI optionUI, VideoUI videoUI) { + super(new Texture("options/escape_back_on.png"), x, y, width, height); + this.optionUI = optionUI; + this.videoUI = videoUI; + this.addListener(new ClickListener() { + public void clicked(InputEvent event, float x, float y) { + leftClick(); + } + }); + } + + @Override + public void leftClick() { + // Einkommentieren wenn disposeVideoUI implementiert// videoUI.disposeVideoUI(); + optionUI.showOptionsUI(); + } +} -- GitLab