v0.6.1: language button now blinks if the selected language is incomplete
This commit is contained in:
parent
8997c71737
commit
340c716c49
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user