diff options
| author | ilotterytea <iltsu@alright.party> | 2024-06-10 02:05:15 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-06-10 02:05:15 +0500 |
| commit | 1b99e89ecc92f3bf53cf483d38ad8d0156c5db5e (patch) | |
| tree | a7f4e9445dd796bc3b7719b1945bf88fb545a4ea /core/src/kz/ilotterytea/maxon/ui | |
| parent | a76f96e6d6e5ffdfa610328cb30714caf9a453d1 (diff) | |
feat: play sound on ui click
Diffstat (limited to 'core/src/kz/ilotterytea/maxon/ui')
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java index 3a5667f..2b3936e 100644 --- a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java +++ b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java @@ -1,6 +1,7 @@ package kz.ilotterytea.maxon.ui; import com.badlogic.gdx.Screen; +import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.InputEvent; @@ -25,11 +26,14 @@ public class SavegameWidget extends Table implements Disposable { private final MaxonGame game; private final Stage stage; + private final Sound clickSound; + public SavegameWidget(final MaxonGame game, Skin skin, final Stage stage, Savegame savegame) { super(); this.game = game; this.stage = stage; this.atlas = game.assetManager.get("sprites/gui/player_icons.atlas", TextureAtlas.class); + this.clickSound = game.assetManager.get("sfx/ui/click.ogg", Sound.class); this.skin = skin; this.savegame = savegame; @@ -65,6 +69,7 @@ public class SavegameWidget extends Table implements Disposable { public void clicked(InputEvent event, float x, float y) { super.clicked(event, x, y); moveToNextScreen(); + clickSound.play(); } }); } @@ -127,6 +132,7 @@ public class SavegameWidget extends Table implements Disposable { public void clicked(InputEvent event, float x, float y) { super.clicked(event, x, y); moveToNextScreen(); + clickSound.play(); } }); @@ -141,6 +147,7 @@ public class SavegameWidget extends Table implements Disposable { dataTable.clear(); savegame.delete(); createEmpty(); + clickSound.play(); } }); |
