v0.6.1: language button now blinks if the selected language is incomplete
This commit is contained in:
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndLangs;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndLangs;
|
||||||
|
import com.watabou.noosa.Game;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.ui.Button;
|
import com.watabou.noosa.ui.Button;
|
||||||
@@ -48,10 +49,29 @@ public class LanguageButton extends Button {
|
|||||||
updateIcon();
|
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(){
|
private void updateIcon(){
|
||||||
|
image.resetColor();
|
||||||
|
flashing = false;
|
||||||
switch(Messages.lang().status()){
|
switch(Messages.lang().status()){
|
||||||
case INCOMPLETE:
|
case INCOMPLETE:
|
||||||
image.tint(1, 0, 0, .5f);
|
image.tint(1, 0, 0, .5f);
|
||||||
|
flashing = true;
|
||||||
break;
|
break;
|
||||||
case UNREVIEWED:
|
case UNREVIEWED:
|
||||||
image.tint(1, .5f, 0, .5f);
|
image.tint(1, .5f, 0, .5f);
|
||||||
|
|||||||
Reference in New Issue
Block a user