diff options
Diffstat (limited to 'core/src/kz/ilotterytea/maxon/ui')
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java | 8 | ||||
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java index 677f0ca..643a963 100644 --- a/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java +++ b/core/src/kz/ilotterytea/maxon/ui/SavegameWidget.java @@ -26,6 +26,7 @@ public class SavegameWidget extends Table implements Disposable { private final Stage stage; private final Sound clickSound; + private final float soundVolume; private final String styleName = OsUtils.isMobile ? "defaultMobile" : "default"; private final float iconSize = OsUtils.isMobile ? 64f : 32f; @@ -36,6 +37,7 @@ public class SavegameWidget extends Table implements Disposable { 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.soundVolume = game.prefs.getInteger("sfx", 10) / 10f; this.skin = skin; this.savegame = savegame; @@ -71,7 +73,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(); + clickSound.play(soundVolume); } }); } @@ -134,7 +136,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(); + clickSound.play(soundVolume); } }); @@ -149,7 +151,7 @@ public class SavegameWidget extends Table implements Disposable { dataTable.clear(); savegame.delete(); createEmpty(); - clickSound.play(); + clickSound.play(soundVolume); } }); diff --git a/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt b/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt index 72ab8c5..c8c0eef 100644 --- a/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt +++ b/core/src/kz/ilotterytea/maxon/ui/game/QuickActionsTable.kt @@ -17,12 +17,13 @@ class QuickActionsTable(skin: Skin) : Table() { init { val game = MaxonGame.getInstance() val clickSound = game.assetManager.get("sfx/ui/click.ogg", Sound::class.java) + val soundVolume = game.prefs.getInteger("sfx", 10) / 10f val slotsButton = ShakingImageButton(skin, "slots") slotsButton.addListener(object : ClickListener() { override fun clicked(event: InputEvent, x: Float, y: Float) { super.clicked(event, x, y) - clickSound.play() + clickSound.play(soundVolume) game.screen = SlotsMinigameScreen() } }) @@ -32,7 +33,7 @@ class QuickActionsTable(skin: Skin) : Table() { quitButton.addListener(object : ClickListener() { override fun clicked(event: InputEvent, x: Float, y: Float) { super.clicked(event, x, y) - clickSound.play() + clickSound.play(soundVolume) game.screen = MenuScreen() } }) |
