From 6ef5c677e337912f1495c8aa5c61151c3de860bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Hor=C3=A1=C4=8Dek?= <horaceklubos@gmail.com> Date: Fri, 10 Apr 2015 13:46:38 +0200 Subject: [PATCH] #22 Minir fixes in panoramascreen --- .../screen/createuser/PanoramaScreen.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/core/src/cz/nic/tablexia/screen/createuser/PanoramaScreen.java b/core/src/cz/nic/tablexia/screen/createuser/PanoramaScreen.java index 75e024c52..f9580ecf5 100644 --- a/core/src/cz/nic/tablexia/screen/createuser/PanoramaScreen.java +++ b/core/src/cz/nic/tablexia/screen/createuser/PanoramaScreen.java @@ -39,7 +39,6 @@ public class PanoramaScreen extends AbstractAutoloadTablexiaScreen<Void> { @Override protected void screenLoaded() { switchSubscreen(prepareBalcony()); - getStage().setDebugAll(true); } private void switchSubscreen(Actor actor) { @@ -70,24 +69,26 @@ public class PanoramaScreen extends AbstractAutoloadTablexiaScreen<Void> { balcony.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { - balconyBlur.addAction(Actions.fadeIn(0.1f)); - balconyBlur.setVisible(true); - - Sound spinSound = getSound("noviny_prilet"); - spinSound.play(); - - Image spin = new Image(getTexture("newspaper/spinner")); - spin.setOrigin(spin.getWidth() / 2, spin.getHeight() / 2); - spin.setPosition(group.getWidth() / 2 - spin.getWidth() / 2, group.getHeight() / 2 - spin.getHeight() / 2); - spin.setScale(0.1f); - spin.addAction(Actions.sequence(Actions.parallel(Actions.rotateBy(3600, 1.5f), Actions.scaleTo(2f, 2f, 1.5f)), Actions.parallel(Actions.sequence(Actions.fadeOut(0.5f), Actions.hide()), Actions.run(new Runnable() { - @Override - public void run() { - group.addActor(prepareOpenAction()); - } - })))); - - group.addActor(spin); + if ((x > getStage().getWidth() * 0.2f && x < getStage().getWidth() * 0.6f) && (y > getStage().getWidth() * 0.1f && y < getStage().getWidth() * 0.3f)) { + balconyBlur.addAction(Actions.fadeIn(0.1f)); + balconyBlur.setVisible(true); + + final Sound spinSound = getSound("noviny_prilet"); + spinSound.play(); + + Image spin = new Image(getTexture("newspaper/spinner")); + spin.setOrigin(spin.getWidth() / 2, spin.getHeight() / 2); + spin.setPosition(group.getWidth() / 2 - spin.getWidth() / 2, group.getHeight() / 2 - spin.getHeight() / 2); + spin.setScale(0.1f); + spin.addAction(Actions.sequence(Actions.parallel(Actions.rotateBy(3600, 1.5f), Actions.scaleTo(2f, 2f, 1.5f)), Actions.parallel(Actions.sequence(Actions.fadeOut(0.5f), Actions.hide()), Actions.run(new Runnable() { + @Override + public void run() { + group.addActor(prepareOpenAction()); + spinSound.stop(); + } + })))); + group.addActor(spin); + } } }); return group; @@ -307,6 +308,8 @@ public class PanoramaScreen extends AbstractAutoloadTablexiaScreen<Void> { } else if (color.equals(BALOON_COLOR)) { details[1].setVisible(true); playMusic("newspaper/4"); + } else { + return; } help.addAction(Actions.sequence(Actions.alpha(0), Actions.parallel(Actions.show(), Actions.fadeIn(0.25f)))); if (music != null && !music.isPlaying()) { @@ -430,7 +433,7 @@ public class PanoramaScreen extends AbstractAutoloadTablexiaScreen<Void> { */ private void showDialog(final int num) { String text = getText("createuser_detective_" + num); - final Dialog dialog = new TablexiaDialog(0, 0, getStage().getWidth() * 0.3f, getStage().getHeight() * 0.3f, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC_CONTINUE_BUTTON, new DialogTextContent("", text)).show(getStage()); + final Dialog dialog = new TablexiaDialog(getStage().getWidth() * 0.3f, getStage().getWidth() * 0.26f, getStage().getWidth() * 0.3f, getStage().getWidth() * 0.2f, TablexiaDialog.BackGroundType.BUBBLE_CLASSIC_CONTINUE_BUTTON, new DialogTextContent("", text)).show(getStage()); playMusic("detective/" + num); dialog.addListener(new ClickListener() { @Override -- GitLab