From 7cb002ca8607537c54d888448cfb63a3dd2985a5 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 19 Dec 2015 12:55:28 +0100 Subject: [PATCH] Adding Tutorial notification --- .../arcade/gametutorial/GameTutorial.java | 25 +++++++++++++++++++ .../arcade/gametutorial/TutorialPhase.java | 5 ++++ .../arcade/gametutorial/TutorialText.java | 5 ++++ 3 files changed, 35 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java index 802f41a83..52f7cf050 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/GameTutorial.java @@ -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)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialPhase.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialPhase.java index aa975b856..8b45496ee 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialPhase.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialPhase.java @@ -222,6 +222,11 @@ public abstract class TutorialPhase return _text; } + public void setText(TutorialText[] text) + { + _text = text; + } + public Location getLocation() { return _location; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialText.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialText.java index dba1d39a6..2711b10fa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialText.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gametutorial/TutorialText.java @@ -59,4 +59,9 @@ public class TutorialText _text = text; } + public void setID(int id) + { + _id = id; + } + }