2727import org .destinationsol .game .tutorial .steps .ButtonPressStep ;
2828import org .destinationsol .game .tutorial .steps .BuyItemStep ;
2929import org .destinationsol .game .tutorial .steps .BuyMercenaryStep ;
30+ import org .destinationsol .game .tutorial .steps .ChangeTutorialSectionStep ;
3031import org .destinationsol .game .tutorial .steps .CheckGunReloadStep ;
3132import org .destinationsol .game .tutorial .steps .CheckItemEquippedStep ;
3233import org .destinationsol .game .tutorial .steps .CloseScreenStep ;
@@ -78,6 +79,7 @@ public class TutorialManager implements UpdateAwareSystem {
7879 private final BeanContext beanContext ;
7980 private List <TutorialStep > steps ;
8081 private int stepNo ;
82+ private String currentTutorialHeading ;
8183
8284 @ Inject
8385 public TutorialManager (NUIManager nuiManager , SolApplication solApplication , Provider <SolGame > game , BeanContext beanContext ) {
@@ -151,23 +153,23 @@ public void start() {
151153 itemTypesExplanations .put (Shield .class , "Shields absorb energy-based projectiles until depleted." );
152154
153155 steps = new ArrayList <>(Arrays .asList (
154- new MessageStep ( "Section 1 - Movement" ),
156+ new ChangeTutorialSectionStep ( " Movement" ),
155157 new TurnLeftRightStep (isMobile ? "Turn left and right." : "Turn left and right (" + turnControlHint + ")." ),
156158 new ThrustForwardsStep (isMobile ? "Thrust forwards." : "Thrust forwards (" + thrustForwardControlHint + ")." ),
157159 new SlowVelocityStep (0.1f , "Turn around and thrust again to slow down.\n \n Try slowing to a stop." ),
158160 new FlyToRandomWaypointAroundHeroStep (1.0f , 2.5f , "Fly to the waypoint." ),
159- new MessageStep ( "Section 2 - Weapons" ),
161+ new ChangeTutorialSectionStep ( " Weapons" ),
160162 new FireGunStep (isMobile ? "Fire your gun." : "Fire your gun (" + shootControlHint + ")." ),
161163 new CheckGunReloadStep (false , true , "Firing weapons drains your ammunition. Keep on firing." ),
162164 new CheckGunReloadStep (false , false ,
163165 "Your weapon reloads when depleted.\n " +
164166 "You can't fire when reloading." ),
165167 new UseAbilityStep (isMobile ? "Use your ability." : "Use your ability (" + abilityControlHint + ")." ),
166168 new MessageStep ("Abilities consume ability charges." ),
167- new MessageStep ( "Section 3 - Money" ),
169+ new ChangeTutorialSectionStep ( " Money" ),
168170 new DestroySpawnedAsteroidAroundHeroStep (1.0f , 2.5f , "Fire at the asteroid." ),
169- new MessageStep ("Asteroids drop loot - money in this case ." ),
170- new MessageStep ( "Section 4 - Items" ),
171+ new MessageStep ("Asteroids drop money. You can fly into it to collect it ." ),
172+ new ChangeTutorialSectionStep ( " Items" ),
171173 new OpenScreenStep (
172174 solGame .get ().getScreens ().mainGameScreen .getInventoryButton (),
173175 solGame .get ().getScreens ().inventoryScreen ,
@@ -191,27 +193,27 @@ public void start() {
191193 solGame .get ().getScreens ().inventoryScreen .getCloseButton (),
192194 solGame .get ().getScreens ().inventoryScreen ,
193195 isMobile ? "Close your inventory (tap outside of the inventory)." : "Close your inventory." ),
194- new MessageStep ( "Section 5 - Weapon Mounts" ),
196+ new ChangeTutorialSectionStep ( " Weapon Mounts" ),
195197 new MessageStep ("All ships may come with up to two weapon mounts." ),
196198 new MessageStep ("Weapon mounts are either fixed or rotating." ),
197199 new MessageStep ("You can only equip weapons on matching mounts." ),
198- new MessageStep ( "Section 6 - Shops" ),
200+ new ChangeTutorialSectionStep ( " Shops" ),
199201 new FlyToNearestStationStep ("Fly to the station." ),
200202 new OpenScreenStep (
201203 solGame .get ().getScreens ().mainGameScreen .getTalkButton (),
202204 solGame .get ().getScreens ().talkScreen ,
203205 isMobile ? "Talk to the station." : "Talk to the station (" + gameOptions .getKeyTalkName () + ")." ),
204206 new BuyItemStep (usesKeyboard ? "Select Buy (" + gameOptions .getKeyBuyMenuName () + ")." : "Select Buy." ,
205207 isMobile ? "Buy an item." : "Buy an item (" + gameOptions .getKeyBuyItemName () + ")." ),
206- new MessageStep ( "Section 7 - Combat" ),
208+ new ChangeTutorialSectionStep ( " Combat" ),
207209 new MessageStep ("Shoot at ships to destroy them.\n " ),
208210 new DestroySpawnedShipsStep (1 , "core:minerSmall" ,
209211 "core:fixedBlaster" , "Destroy the targeted ship." ,
210212 "Enemy ships can be tough.\n Open the pause menu and select Respawn." ),
211213 new MessageStep ("Destroyed ships drop valuable loot." ),
212- new MessageStep ( "Section 8 - Repair Kits" ),
214+ new ChangeTutorialSectionStep ( " Repair Kits" ),
213215 new WaitUntilFullyRepairedStep ("Stay still and wait until the repair kits have repaired your hull fully." ),
214- new MessageStep ( "Section 9 - Map" ),
216+ new ChangeTutorialSectionStep ( " Map" ),
215217 new OpenScreenStep (
216218 solGame .get ().getScreens ().mainGameScreen .getMapButton (),
217219 solGame .get ().getScreens ().mapScreen ,
@@ -225,8 +227,9 @@ public void start() {
225227 solGame .get ().getScreens ().mapScreen ,
226228 "Close the map." ),
227229 new FlyToHeroFirstWaypointStep ("Fly to your waypoint." ),
228- new MessageStep ("Section 10 - Hiring Mercenaries" ),
229- new FlyToPlanetSellingMercenariesStep ("Fly to a planetary station providing mercenaries." ),
230+ new ChangeTutorialSectionStep ("Planets" ),
231+ new FlyToPlanetSellingMercenariesStep ("Head towards a planet." , "Look for the planetary station." ),
232+ new ChangeTutorialSectionStep ("Mercenaries" ),
230233 new MessageStep ("When flying around planets, you'll be affected by gravity." ),
231234 new OpenScreenStep (
232235 solGame .get ().getScreens ().mainGameScreen .getTalkButton (),
@@ -236,7 +239,6 @@ public void start() {
236239 usesKeyboard ? "Select Hire (" + gameOptions .getKeyHireShipMenuName () + ")." : "Select Hire." ,
237240 "Try hiring a mercenary." ),
238241 new MessageStep ("Mercenaries will fight for you. They keep any money they collect as part of their payment." ),
239- new MessageStep ("Section 11 - Managing Mercenaries" ),
240242 new OpenScreenStep (
241243 solGame .get ().getScreens ().mainGameScreen .getMercsButton (),
242244 solGame .get ().getScreens ().inventoryScreen ,
@@ -246,9 +248,11 @@ public void start() {
246248 "Here you can give items to your mercenary." ,
247249 "Here you can take items back from your mercenary." ,
248250 "Here you can manage your mercenary's equipment." ),
251+ new ChangeTutorialSectionStep ("Star Lanes" ),
249252 new FlyToNearestStarPortStep ("Fly to the marked star lane." ),
250253 new MessageStep ("For a small fee, star lanes allow you to travel quickly between planets." ),
251254 new TravelThroughStarPortStep ("Fly into the centre to travel across the star lane." ),
255+ new ChangeTutorialSectionStep ("Finish" ),
252256 new MessageStep ("That's it! The tutorial is finished. You will be returned to the main menu." )
253257 ));
254258
@@ -309,7 +313,12 @@ public void update(SolGame game, float timeStep) {
309313 }
310314
311315 private void setUpTutorialBox (TutorialStep tutorialStep ) {
316+ if (tutorialStep .getTutorialHeading () != null ) {
317+ currentTutorialHeading = tutorialStep .getTutorialHeading ();
318+ }
319+
312320 tutorialScreen .setTutorialText (tutorialStep .getTutorialText (), tutorialStep .getTutorialBoxPosition ());
321+ tutorialScreen .setTutorialHeading (currentTutorialHeading , tutorialStep .getTutorialBoxPosition ());
313322 if (tutorialStep .getRequiredInput () != null ) {
314323 tutorialScreen .setInteractHintInput (tutorialStep .getTutorialBoxPosition (), tutorialStep .getRequiredInput ());
315324 tutorialScreen .setInteractEvent (tutorialStep .getTutorialBoxPosition (), tutorialStep .getInputHandler ());
0 commit comments