Changed Tutorials
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package de.frajul.endlessroll.views;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationSet;
|
||||
import android.view.animation.AnimationUtils;
|
||||
|
@ -50,6 +50,14 @@ public class GameOverMessage implements View.OnClickListener {
|
||||
layout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public boolean isVisible(){
|
||||
return layout.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
public void prepareToBeShown(){
|
||||
topBar.update();
|
||||
}
|
||||
|
||||
private void hide() {
|
||||
layout.clearAnimation();
|
||||
layout.setVisibility(View.GONE);
|
||||
|
@ -12,6 +12,7 @@ import de.frajul.endlessroll.R;
|
||||
import de.frajul.endlessroll.levels.Level;
|
||||
import de.frajul.endlessroll.levels.LevelPack;
|
||||
import de.frajul.endlessroll.main.GameActivity;
|
||||
import de.frajul.endlessroll.main.GameLog;
|
||||
import de.frajul.endlessroll.main.game.Game;
|
||||
import de.frajul.endlessroll.main.screens.Screen;
|
||||
|
||||
@ -52,22 +53,40 @@ public class GoalMessage implements GoalMessageLevelButtonOnClickListener, View.
|
||||
toMenu.setOnClickListener(this);
|
||||
}
|
||||
|
||||
public void fadeInWithDelay(LevelPack levelPack, final Level level) {
|
||||
public void fadeInWithDelay(final LevelPack levelPack, final Level level) {
|
||||
this.levelPack = levelPack;
|
||||
topBar.update();
|
||||
restart.init(R.string.goal_message_restart_format_d, level);
|
||||
boolean nextLevelVisible = !levelPack.isLastLevel(level);
|
||||
nextLevel.setVisible(nextLevelVisible);
|
||||
if (nextLevelVisible)
|
||||
nextLevel
|
||||
.init(R.string.goal_message_next_level_format_d, levelPack.getNextLevel(level));
|
||||
|
||||
layout.postDelayed(new Runnable() {
|
||||
GameLog.i("Level: "+level.getId());
|
||||
|
||||
gameActivity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
topBar.update();
|
||||
restart.init(R.string.goal_message_restart_format_d, level);
|
||||
boolean nextLevelVisible = !levelPack.isLastLevel(level);
|
||||
nextLevel.setVisible(nextLevelVisible);
|
||||
if (nextLevelVisible)
|
||||
nextLevel
|
||||
.init(R.string.goal_message_next_level_format_d, levelPack.getNextLevel(level));
|
||||
|
||||
layout.startAnimation(fadeIn);
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
|
||||
// layout.postDelayed(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
//
|
||||
// }
|
||||
// }, 500);
|
||||
}
|
||||
|
||||
public boolean isVisible(){
|
||||
return layout.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
public void prepareToBeShown(){
|
||||
topBar.update();
|
||||
}
|
||||
|
||||
private void hide() {
|
||||
|
@ -69,6 +69,14 @@ public class ShortMenu implements View.OnClickListener {
|
||||
topBar.update();
|
||||
}
|
||||
|
||||
public boolean isVisible(){
|
||||
return layout.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
public void prepareToBeShown(){
|
||||
topBar.update();
|
||||
}
|
||||
|
||||
private void startRandomAnimation(View view) {
|
||||
float r = random.nextFloat();
|
||||
if (r >= 0.5)
|
||||
|
@ -47,12 +47,12 @@ public class TopBar implements View.OnClickListener {
|
||||
|
||||
Typeface typeface = gameActivity.getTypeface();
|
||||
levelDisplay = (TextView) layout.findViewById(R.id.topbar_leveldisplay);
|
||||
levelDisplay.setTypeface(typeface);
|
||||
// levelDisplay.setTypeface(typeface);
|
||||
levelProgress = (ProgressBar) layout.findViewById(R.id.topbar_levelprogress);
|
||||
starCount = (TextView) layout.findViewById(R.id.topbar_starcount);
|
||||
starCount.setTypeface(typeface);
|
||||
// starCount.setTypeface(typeface);
|
||||
energyCount = (TextView) layout.findViewById(R.id.topbar_energycount);
|
||||
energyCount.setTypeface(typeface);
|
||||
// energyCount.setTypeface(typeface);
|
||||
settingsButton = (Button) layout.findViewById(R.id.topbar_settings);
|
||||
settingsButton.setOnClickListener(this);
|
||||
toolshopButton = (Button) layout.findViewById(R.id.topbar_toolshop);
|
||||
@ -93,7 +93,7 @@ public class TopBar implements View.OnClickListener {
|
||||
starCount.setText(user.getStarCount() + "");
|
||||
energyCount.setText(user.getEnergyCount() + "");
|
||||
|
||||
gameActivity.getTutorialManager().getToolShopTutorial().onTopBarUpdate(this);
|
||||
gameActivity.getTutorialManager().onTopBarUpdate(this);
|
||||
}
|
||||
|
||||
public void startToolShopButtonPulse(){
|
||||
|
@ -47,7 +47,7 @@ public class ViewManager implements View.OnClickListener {
|
||||
gameActivity.getUser().getToolSlotSettings(),
|
||||
(LinearLayout) layout.findViewById(R.id.game_toolbuttonbar));
|
||||
shortMenu = new ShortMenu(game, gameActivity,
|
||||
(LinearLayout) layout.findViewById(R.id.game_shortmenu));
|
||||
layout.findViewById(R.id.game_shortmenu));
|
||||
gameOverMessage = new GameOverMessage(game, gameActivity,
|
||||
layout.findViewById(R.id.game_game_over_message));
|
||||
goalMessage = new GoalMessage(game, gameActivity, layout.findViewById(R.id.game_goal_message));
|
||||
@ -66,6 +66,15 @@ public class ViewManager implements View.OnClickListener {
|
||||
playerSpeedFormat = game.getContext().getString(R.string.game_playerspeed_format_f);
|
||||
}
|
||||
|
||||
public void prepareToBeShown(){
|
||||
if(shortMenu.isVisible())
|
||||
shortMenu.prepareToBeShown();
|
||||
if(gameOverMessage.isVisible())
|
||||
gameOverMessage.prepareToBeShown();
|
||||
if(goalMessage.isVisible())
|
||||
goalMessage.prepareToBeShown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
game.tryToPause();
|
||||
|
Reference in New Issue
Block a user