diff --git a/engine/src/main/java/org/destinationsol/game/tutorial/TutorialManager.java b/engine/src/main/java/org/destinationsol/game/tutorial/TutorialManager.java index 765290ee0..488f5f362 100644 --- a/engine/src/main/java/org/destinationsol/game/tutorial/TutorialManager.java +++ b/engine/src/main/java/org/destinationsol/game/tutorial/TutorialManager.java @@ -221,7 +221,9 @@ public void start() { new ButtonPressStep(solGame.get().getScreens().mapScreen.getZoomInButton(), "Zoom In"), new ButtonPressStep(solGame.get().getScreens().mapScreen.getZoomOutButton(), "Zoom Out"), new MapDragStep("You can drag the map to move around."), - new CreateWaypointStep("Create a waypoint near your ship."), + new CreateWaypointStep("Create a waypoint near your ship.", + "That's too far away.\n\n" + + "Remove it and place one closer to your ship."), new CloseScreenStep( solGame.get().getScreens().mapScreen.getCloseButton(), solGame.get().getScreens().mapScreen, diff --git a/engine/src/main/java/org/destinationsol/game/tutorial/steps/CreateWaypointStep.java b/engine/src/main/java/org/destinationsol/game/tutorial/steps/CreateWaypointStep.java index 4f23b107a..7d57ffbaf 100644 --- a/engine/src/main/java/org/destinationsol/game/tutorial/steps/CreateWaypointStep.java +++ b/engine/src/main/java/org/destinationsol/game/tutorial/steps/CreateWaypointStep.java @@ -36,6 +36,7 @@ public class CreateWaypointStep extends TutorialStep { @Inject protected GameScreens gameScreens; private final String message; + private final String waypointTooFarMessage; private UIWarnButton addWaypointButton; private boolean buttonPressed = false; private int lastWaypointCount; @@ -45,8 +46,9 @@ protected CreateWaypointStep() { throw new RuntimeException("Attempted to instantiate TutorialStep via DI. This is not supported."); } - public CreateWaypointStep(String message) { + public CreateWaypointStep(String message, String waypointTooFarMessage) { this.message = message; + this.waypointTooFarMessage = waypointTooFarMessage; } public void start() { @@ -66,12 +68,16 @@ public boolean checkComplete(float timeStep) { } Hero hero = game.getHero(); + if (hero.getWaypoints().size() == 0) { + setTutorialText(message); + } + if (hero.getWaypoints().size() > lastWaypointCount) { Waypoint waypoint = hero.getWaypoints().get(hero.getWaypoints().size()-1); if (waypoint.getPosition().dst(hero.getPosition()) < 100.0f) { return true; } else { - hero.removeWaypoint(waypoint); + setTutorialText(waypointTooFarMessage); } } lastWaypointCount = game.getHero().getWaypoints().size();