From 340c716c4950d9a7abf1c3a1433e1c5d9604f7c9 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 15 Aug 2017 02:37:38 -0400 Subject: [PATCH] v0.6.1: language button now blinks if the selected language is incomplete --- .../ui/LanguageButton.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LanguageButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LanguageButton.java index 78583dc70..847a264a7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LanguageButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/LanguageButton.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.windows.WndLangs; +import com.watabou.noosa.Game; import com.watabou.noosa.Image; import com.watabou.noosa.audio.Sample; import com.watabou.noosa.ui.Button; @@ -47,11 +48,30 @@ public class LanguageButton extends Button { add( image ); updateIcon(); } - + + private boolean flashing; + private float time = 0; + + @Override + public void update() { + super.update(); + + if (flashing){ + image.am = (float)Math.abs(Math.cos( (time += Game.elapsed) )); + if (time >= Math.PI) { + time = 0; + } + } + + } + private void updateIcon(){ + image.resetColor(); + flashing = false; switch(Messages.lang().status()){ case INCOMPLETE: image.tint(1, 0, 0, .5f); + flashing = true; break; case UNREVIEWED: image.tint(1, .5f, 0, .5f);