v2.3.0: added key bindings to tutorial text on desktop

This commit is contained in:
Evan Debenham
2023-10-30 13:08:31 -04:00
parent 632e1f6d5d
commit a7ded9be41
3 changed files with 23 additions and 15 deletions

View File

@@ -49,11 +49,12 @@ scenes.gamescene.purchase=Purchase
scenes.gamescene.trample=Trample
scenes.gamescene.examine=Examine
scenes.gamescene.tutorial_move_mobile=Tap a location to move and interact.
scenes.gamescene.tutorial_move_desktop=Use the mouse or arrow keys to move and interact.
scenes.gamescene.tutorial_move_desktop=Use the mouse, WASD, or arrow keys to move and interact.
scenes.gamescene.tutorial_move_controller=Select a location or use the left stick to move or interact.
scenes.gamescene.tutorial_guidebook=Select the blinking journal button to read the book you just picked up.
scenes.gamescene.tutorial_guidebook_mobile=Tap the blinking journal button to read the book you just picked up.
scenes.gamescene.tutorial_guidebook_desktop=Select the blinking journal button (%s) to read the book you just picked up.
scenes.gamescene.tutorial_ui_mobile=Hero info is on the top left. Inventory, quickslots, and game actions are below. Good luck!
scenes.gamescene.tutorial_ui_desktop=Hero info is below. Inventory, quickslots, and game actions are to the right. Good luck!
scenes.gamescene.tutorial_ui_desktop=Hero info (%1$s) is below. Inventory (%2$s), quickslots, and game actions are to the right. Good luck!
scenes.heroselectscene.title=Choose Your Hero
scenes.heroselectscene.start=Start

View File

@@ -22,6 +22,8 @@
package com.shatteredpixel.shatteredpixeldungeon.items.journal;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
@@ -30,6 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.input.ControllerHandler;
import com.watabou.input.KeyBindings;
import com.watabou.noosa.audio.Sample;
public class Guidebook extends Item {
@@ -51,7 +55,11 @@ public class Guidebook extends Item {
//we do this here so the pickup message appears before the tutorial text
GameLog.wipe();
GLog.i( Messages.capitalize(Messages.get(Hero.class, "you_now_have", name())) );
GLog.p(Messages.get(GameScene.class, "tutorial_guidebook"));
if (SPDSettings.interfaceSize() == 0){
GLog.p(Messages.get(GameScene.class, "tutorial_guidebook_mobile"));
} else {
GLog.p(Messages.get(GameScene.class, "tutorial_guidebook_desktop", KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(SPDAction.JOURNAL, ControllerHandler.isControllerConnected()))));
}
GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_INTRO);
Sample.INSTANCE.play( Assets.Sounds.ITEM );
hero.spendAndNext( TIME_TO_PICK_UP );

View File

@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Chrome;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
@@ -117,6 +118,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndResurrect;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory;
import com.watabou.glwrap.Blending;
import com.watabou.input.ControllerHandler;
import com.watabou.input.KeyBindings;
import com.watabou.input.PointerEvent;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Game;
@@ -566,17 +568,12 @@ public class GameScene extends PixelScene {
//Tutorial
if (SPDSettings.intro()){
if (Document.ADVENTURERS_GUIDE.isPageFound(Document.GUIDE_INTRO)){
GLog.p(Messages.get(GameScene.class, "tutorial_guidebook"));
flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_INTRO);
if (ControllerHandler.isControllerConnected()) {
GLog.p(Messages.get(GameScene.class, "tutorial_move_controller"));
} else if (SPDSettings.interfaceSize() == 0) {
GLog.p(Messages.get(GameScene.class, "tutorial_move_mobile"));
} else {
if (ControllerHandler.isControllerConnected()) {
GLog.p(Messages.get(GameScene.class, "tutorial_move_controller"));
} else if (SPDSettings.interfaceSize() == 0) {
GLog.p(Messages.get(GameScene.class, "tutorial_move_mobile"));
} else {
GLog.p(Messages.get(GameScene.class, "tutorial_move_desktop"));
}
GLog.p(Messages.get(GameScene.class, "tutorial_move_desktop"));
}
toolbar.visible = toolbar.active = false;
status.visible = status.active = false;
@@ -1117,7 +1114,9 @@ public class GameScene extends PixelScene {
if (SPDSettings.interfaceSize() == 0){
GLog.p(Messages.get(GameScene.class, "tutorial_ui_mobile"));
} else {
GLog.p(Messages.get(GameScene.class, "tutorial_ui_desktop"));
GLog.p(Messages.get(GameScene.class, "tutorial_ui_desktop",
KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(SPDAction.HERO_INFO, ControllerHandler.isControllerConnected())),
KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(SPDAction.INVENTORY, ControllerHandler.isControllerConnected()))));
}
//clear hidden doors, it's floor 1 so there are only the entrance ones