Adding Tutorial notification

This commit is contained in:
Sarah 2015-12-19 12:55:28 +01:00
parent 6c5e3d7509
commit 7cb002ca86
3 changed files with 35 additions and 0 deletions

View File

@ -36,6 +36,7 @@ public abstract class GameTutorial
public boolean PlayTutorialSounds = false;
public boolean ShowPrepareTimer = false;
public boolean CustomEnding = false;
public boolean TutorialNotification = false;
public long TimeBetweenPhase = 0;
public long StartAfterTutorial = 5000;
@ -58,6 +59,30 @@ public abstract class GameTutorial
for(TutorialPhase phase : _phases)
phase.setTutorial(this);
if(TutorialNotification)
{
TutorialPhase phase = getPhase(1);
for(TutorialText text : phase.getText())
{
int index = text.ID();
text.setID(index + 1);
}
TutorialText[] newText = new TutorialText[phase.getText().length + 1];
for(int i = 0; i < newText.length; i++)
{
if(i == 0)
{
newText[i] = new TutorialText("Please notice that this is a Tutorial", 1);
continue;
}
else
{
newText[i] = phase.getText()[i];
}
}
phase.setText(newText);
}
Manager.GetChat().Silence(60000, false);
_started = System.currentTimeMillis();
Manager.getPluginManager().callEvent(new GameTutorialStartEvent(this));

View File

@ -222,6 +222,11 @@ public abstract class TutorialPhase
return _text;
}
public void setText(TutorialText[] text)
{
_text = text;
}
public Location getLocation()
{
return _location;

View File

@ -59,4 +59,9 @@ public class TutorialText
_text = text;
}
public void setID(int id)
{
_id = id;
}
}