fixing 2 seconds delay.

This commit is contained in:
Sarah 2015-11-26 16:26:49 +01:00
parent a653f053a5
commit 21f859f579
2 changed files with 16 additions and 7 deletions

View File

@ -53,13 +53,14 @@ public abstract class GameTutorial
{ {
@Override @Override
public void run() public void run()
{ {
nextPhase(); nextPhase(true);
} }
}, 40); }, 40);
_currentPhase.teleport();
} }
protected void nextPhase() protected void nextPhase(boolean phaseOne)
{ {
_currentPhase = getNextPhase(); _currentPhase = getNextPhase();
if(_currentPhase == null) if(_currentPhase == null)
@ -73,7 +74,7 @@ public abstract class GameTutorial
{ {
Manager.GetChat().Silence(7000, false); Manager.GetChat().Silence(7000, false);
onPhaseChange(_currentPhase); onPhaseChange(_currentPhase);
_currentPhase.start(); _currentPhase.start(phaseOne);
} }
} }

View File

@ -25,16 +25,24 @@ public abstract class TutorialPhase
_text = text; _text = text;
} }
final public void start() final public void start(boolean phaseOne)
{ {
_hasEnded = false; _hasEnded = false;
onStart(); onStart();
if(!phaseOne)
{
teleport();
}
displayText();
}
final public void teleport()
{
if(_location != null && _target != null) if(_location != null && _target != null)
{ {
prepareLocations(); prepareLocations();
updatePlayers(); updatePlayers();
} }
displayText();
} }
private void prepareLocations() private void prepareLocations()
@ -99,7 +107,7 @@ public abstract class TutorialPhase
{ {
_hasEnded = true; _hasEnded = true;
onEnd(); onEnd();
_tutorial.nextPhase(); _tutorial.nextPhase(false);
} }
}); });
break; break;