v2.5.0: story text hiding can now also be cancelled via keybind
This commit is contained in:
+29
-5
@@ -294,10 +294,28 @@ public class InterlevelScene extends PixelScene {
|
|||||||
KeyEvent.addKeyListener(new Signal.Listener<KeyEvent>() {
|
KeyEvent.addKeyListener(new Signal.Listener<KeyEvent>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onSignal(KeyEvent keyEvent) {
|
public boolean onSignal(KeyEvent keyEvent) {
|
||||||
if (btnContinue.active){
|
if (!keyEvent.pressed && btnContinue.active){
|
||||||
phase = Phase.FADE_OUT;
|
if (btnHideStory.active && !btnHideStory.icon().visible){
|
||||||
timeLeft = fadeTime;
|
btnHideStory.setRect(btnContinue.right()+2, btnContinue.top(), 20, 21);
|
||||||
btnContinue.enable(false);
|
align(btnHideStory);
|
||||||
|
btnHideStory.icon().visible = true;
|
||||||
|
btnHideStory.parent.add(new Tweener(parent, 0.5f) {
|
||||||
|
@Override
|
||||||
|
protected void updateValues(float progress) {
|
||||||
|
float uiAlpha = progress;
|
||||||
|
btnContinue.alpha(uiAlpha);
|
||||||
|
storyBG.alpha(uiAlpha*0.75f);
|
||||||
|
storyMessage.alpha(uiAlpha);
|
||||||
|
btnHideStory.icon().alpha(uiAlpha);
|
||||||
|
loadingText.alpha(uiAlpha);
|
||||||
|
im.am = uiAlpha;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
phase = Phase.FADE_OUT;
|
||||||
|
timeLeft = fadeTime;
|
||||||
|
btnContinue.enable(false);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -496,8 +514,14 @@ public class InterlevelScene extends PixelScene {
|
|||||||
btnHideStory.icon().alpha(btnContinue.alpha());
|
btnHideStory.icon().alpha(btnContinue.alpha());
|
||||||
|
|
||||||
if (btnContinue.alpha() == 1){
|
if (btnContinue.alpha() == 1){
|
||||||
btnHideStory.enable(true);
|
|
||||||
textFadingIn = false;
|
textFadingIn = false;
|
||||||
|
|
||||||
|
if (btnContinue.active) {
|
||||||
|
btnHideStory.enable(true);
|
||||||
|
} else {
|
||||||
|
//move to fade out automatically
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user