4747import org .destinationsol .game .tutorial .steps .SelectEquippedWeaponStep ;
4848import org .destinationsol .game .tutorial .steps .SlowVelocityStep ;
4949import org .destinationsol .game .tutorial .steps .ThrustForwardsStep ;
50+ import org .destinationsol .game .tutorial .steps .TravelThroughStarPortStep ;
5051import org .destinationsol .game .tutorial .steps .TurnLeftRightStep ;
5152import org .destinationsol .game .tutorial .steps .UseAbilityStep ;
5253import org .destinationsol .game .tutorial .steps .WaitUntilFullyRepairedStep ;
5354import org .destinationsol .ui .nui .NUIManager ;
5455import org .destinationsol .ui .nui .screens .MainGameScreen ;
5556import org .destinationsol .ui .nui .screens .TutorialScreen ;
56- import org .slf4j .Logger ;
57- import org .slf4j .LoggerFactory ;
5857import org .terasology .context .exception .BeanNotFoundException ;
5958import org .terasology .gestalt .di .BeanContext ;
6059
7170 * instances.
7271 * @see TutorialStep
7372 */
74- public class NewTutorialManager implements UpdateAwareSystem {
73+ public class TutorialManager implements UpdateAwareSystem {
7574 private final NUIManager nuiManager ;
7675 private final TutorialScreen tutorialScreen ;
7776 private final SolApplication solApplication ;
@@ -81,7 +80,7 @@ public class NewTutorialManager implements UpdateAwareSystem {
8180 private int stepNo ;
8281
8382 @ Inject
84- public NewTutorialManager (NUIManager nuiManager , SolApplication solApplication , Provider <SolGame > game , BeanContext beanContext ) {
83+ public TutorialManager (NUIManager nuiManager , SolApplication solApplication , Provider <SolGame > game , BeanContext beanContext ) {
8584 this .nuiManager = nuiManager ;
8685 this .tutorialScreen = (TutorialScreen ) nuiManager .createScreen ("engine:tutorialScreen" );
8786 this .solApplication = solApplication ;
@@ -101,8 +100,7 @@ public void start() {
101100 GameOptions gameOptions = solApplication .getOptions ();
102101 GameOptions .ControlType controlType = gameOptions .controlType ;
103102 boolean isMobile = solApplication .isMobile ();
104- boolean usesKeyboard = !isMobile &&
105- (controlType != GameOptions .ControlType .MOUSE );
103+ boolean usesKeyboard = !isMobile && (controlType != GameOptions .ControlType .MOUSE );
106104
107105 // A lot of input names will vary by control type. In some control types, the inputs are also hard-coded.
108106 // Rather than a lot of messy conditional statements in-line with the step definitions, we'll set things up here.
@@ -220,7 +218,7 @@ public void start() {
220218 isMobile ? "Open the map." : "Open the map (" + gameOptions .getKeyMapName () + ")." ),
221219 new ButtonPressStep (solGame .get ().getScreens ().mapScreen .getZoomInButton (), "Zoom In" ),
222220 new ButtonPressStep (solGame .get ().getScreens ().mapScreen .getZoomOutButton (), "Zoom Out" ),
223- new MapDragStep ("You can move around the map by clicking/tapping and dragging ." ),
221+ new MapDragStep ("You can drag the map to move around ." ),
224222 new CreateWaypointStep ("Create a waypoint near your ship." ),
225223 new CloseScreenStep (
226224 solGame .get ().getScreens ().mapScreen .getCloseButton (),
@@ -237,11 +235,7 @@ public void start() {
237235 new BuyMercenaryStep (1000 ,
238236 usesKeyboard ? "Select Hire (" + gameOptions .getKeyHireShipMenuName () + ")." : "Select Hire." ,
239237 "Try hiring a mercenary." ),
240- new MessageStep ("Let's see how your mercenary fights." ),
241- new DestroySpawnedShipsStep (1 , "core:pirateSmall" ,
242- "core:blaster core:smallShield" , "Destroy the targeted ship." ,
243- "Enemy ships can be tough.\n Open the pause menu and select Respawn." ),
244- new MessageStep ("Mercenaries will keep any money they collect as part of their payment." ),
238+ new MessageStep ("Mercenaries will fight for you. They keep any money they collect as part of their payment." ),
245239 new MessageStep ("Section 11 - Managing Mercenaries" ),
246240 new OpenScreenStep (
247241 solGame .get ().getScreens ().mainGameScreen .getMercsButton (),
@@ -254,7 +248,8 @@ public void start() {
254248 "Here you can manage your mercenary's equipment." ),
255249 new FlyToNearestStarPortStep ("Fly to the marked star lane." ),
256250 new MessageStep ("For a small fee, star lanes allow you to travel quickly between planets." ),
257- new MessageStep ("The tutorial is finished. You will be returned to the main menu." )
251+ new TravelThroughStarPortStep ("Fly into the centre to travel across the star lane." ),
252+ new MessageStep ("That's it! The tutorial is finished. You will be returned to the main menu." )
258253 ));
259254
260255 for (TutorialStep step : steps ) {
@@ -299,28 +294,28 @@ public void update(SolGame game, float timeStep) {
299294 }
300295
301296 TutorialStep currentStep = steps .get (stepNo );
302- tutorialScreen .setTutorialText (currentStep .getTutorialText (), currentStep .getTutorialBoxPosition ());
303- if (currentStep .getRequiredInput () != null ) {
304- tutorialScreen .setInteractHintInput (currentStep .getTutorialBoxPosition (), currentStep .getRequiredInput ());
305- tutorialScreen .setInteractEvent (currentStep .getTutorialBoxPosition (), currentStep .getInputHandler ());
306- }
297+ setUpTutorialBox (currentStep );
307298 if (currentStep .checkComplete (timeStep )) {
308299 stepNo ++;
309300 tutorialScreen .clearAllTutorialBoxes ();
310301 if (stepNo < steps .size ()) {
311302 TutorialStep newStep = steps .get (stepNo );
312303 newStep .start ();
313- tutorialScreen .setTutorialText (newStep .getTutorialText (), newStep .getTutorialBoxPosition ());
314- if (newStep .getRequiredInput () != null ) {
315- tutorialScreen .setInteractHintInput (newStep .getTutorialBoxPosition (), newStep .getRequiredInput ());
316- tutorialScreen .setInteractEvent (newStep .getTutorialBoxPosition (), newStep .getInputHandler ());
317- }
304+ setUpTutorialBox (newStep );
318305 } else {
319306 solApplication .finishGame ();
320307 }
321308 }
322309 }
323310
311+ private void setUpTutorialBox (TutorialStep tutorialStep ) {
312+ tutorialScreen .setTutorialText (tutorialStep .getTutorialText (), tutorialStep .getTutorialBoxPosition ());
313+ if (tutorialStep .getRequiredInput () != null ) {
314+ tutorialScreen .setInteractHintInput (tutorialStep .getTutorialBoxPosition (), tutorialStep .getRequiredInput ());
315+ tutorialScreen .setInteractEvent (tutorialStep .getTutorialBoxPosition (), tutorialStep .getInputHandler ());
316+ }
317+ }
318+
324319 /**
325320 * This method should be called when either the game or the tutorial ends. It cleans-up the UI changes made for the tutorial.
326321 */
0 commit comments