Show feedback when toggling settings (closes #20)

This commit is contained in:
Lonami Exo 2017-09-09 13:11:38 +02:00
parent 1b1eb678db
commit e58c0e1a67
2 changed files with 7 additions and 1 deletions

View file

@ -126,7 +126,9 @@ public class MoneyBuyBand extends Table {
// Temporary text will always reset to the shown money
// because it would make no sense to go back to the buy "confirm?"
private void setTempText(String text) {
//
// Can also be used to show a temporary notification text.
public void setTempText(String text) {
setText(text);
showingTemp = true;
nextTempRevertUpdate = TimeUtils.millis() + TEMP_TEXT_DELAY;

View file

@ -109,6 +109,8 @@ class CustomizeScreen implements Screen {
final boolean enabled = Klooni.toggleSound();
soundButton.image = CustomizeScreen.this.game.skin.getDrawable(
enabled ? "sound_on_texture" : "sound_off_texture");
buyBand.setTempText("sound " + (enabled ? "on" : "off"));
}
});
optionsGroup.addActor(soundButton);
@ -139,6 +141,8 @@ class CustomizeScreen implements Screen {
final boolean shouldSnap = Klooni.toggleSnapToGrid();
snapButton.image = CustomizeScreen.this.game.skin.getDrawable(
shouldSnap ? "snap_on_texture" : "snap_off_texture");
buyBand.setTempText("snap to grid " + (shouldSnap ? "on" : "off"));
}
});
optionsGroup.addActor(snapButton);