diff --git a/core/src/main/assets/interfaces/icons.png b/core/src/main/assets/interfaces/icons.png index fd10f873e..46efa6a32 100644 Binary files a/core/src/main/assets/interfaces/icons.png and b/core/src/main/assets/interfaces/icons.png differ diff --git a/core/src/main/assets/interfaces/menu_button.png b/core/src/main/assets/interfaces/menu_button.png index be59d1c8c..523263964 100644 Binary files a/core/src/main/assets/interfaces/menu_button.png and b/core/src/main/assets/interfaces/menu_button.png differ diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 9ed817def..ea66c7e1c 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -620,7 +620,9 @@ items.journal.alchemypage.name=torn alchemy book page items.journal.alchemypage.desc=A torn page from a guidebook on alchemy.\n\nMost of the text is too small to read at a distance, but you can make out the title of the page:\n\n_"%s"_ items.journal.guidebook.name=tome of dungeon mastery -items.journal.guidebook.hint=Your guidebook has advice for you! +items.journal.guidebook.hint_mobile=Your guidebook has advice for you! Tap the blinking journal button to read it. +items.journal.guidebook.hint_desktop=Your guidebook has advice for you! Select the blinking journal button (%s) to read it. +items.journal.guidebook.hint_status=Guidebook items.journal.guidebook.desc=An adventurer's guidebook, left here by someone who decided adventuring wasn't for them! This particular book is magical, and can prompt adventurers to read a page at the right moment.\n\nDespite that functionality, the book is most popular because of the big words "Don't Panic!" written in large friendly letters on the cover. items.journal.guidepage.name=torn guidebook page diff --git a/core/src/main/assets/messages/windows/windows.properties b/core/src/main/assets/messages/windows/windows.properties index e1ea17b30..6389ceffd 100644 --- a/core/src/main/assets/messages/windows/windows.properties +++ b/core/src/main/assets/messages/windows/windows.properties @@ -112,7 +112,7 @@ windows.wndinfotalent.upgrade=Upgrade Talent windows.wndinfotrap.inactive=This trap is inactive, and can no longer be triggered. -windows.wndjournal$guidetab.title=Tome of Dungeon Mastery +windows.wndjournal$guidetab.title=Dungeon Guide windows.wndjournal$alchemytab.title=Alchemy Guide windows.wndjournal$guidetab.missing=page missing windows.wndjournal$notestab.title=Adventuring Notes diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index e2214723f..fe7750186 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.items.journal.Guidebook; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge; import com.shatteredpixel.shatteredpixeldungeon.journal.Document; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -100,7 +99,6 @@ public class Hunger extends Buff implements Hero.Doom { GLog.w( Messages.get(this, "onhungry") ); if (!Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_FOOD)){ - GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_FOOD); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index f9cccea91..8d73d4104 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1534,7 +1534,6 @@ public class Hero extends Char { } if (m instanceof Snake && Dungeon.level.distance(m.pos, pos) <= 4 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_EXAMINING)){ - GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_EXAMINING); //we set to read here to prevent this message popping up a bunch Document.ADVENTURERS_GUIDE.readPage(Document.GUIDE_EXAMINING); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java index b36876e7a..675b0186e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java @@ -63,7 +63,6 @@ public class Snake extends Mob { dodges++; if ((dodges >= 2 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_SURPRISE_ATKS)) || (dodges >= 4 && !Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_1))){ - GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_SURPRISE_ATKS); dodges = 0; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java index 44f0b4108..1c29190b5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java @@ -56,7 +56,6 @@ public abstract class EquipableItem extends Item { public boolean doPickUp(Hero hero, int pos) { if (super.doPickUp(hero, pos)){ if (!isIdentified() && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_IDING)){ - GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_IDING); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/journal/DocumentPage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/journal/DocumentPage.java index 598cec122..2826e5fbb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/journal/DocumentPage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/journal/DocumentPage.java @@ -53,11 +53,14 @@ public abstract class DocumentPage extends Item { public final boolean doPickUp(Hero hero, int pos) { GameScene.pickUpJournal(this, pos); GameScene.flashForDocument(document(), page()); - if (document() == Document.ALCHEMY_GUIDE){ + if (document() == Document.ADVENTURERS_GUIDE){ WndJournal.last_index = 1; + } else if (document() == Document.ALCHEMY_GUIDE) { + WndJournal.last_index = 2; WndJournal.AlchemyTab.currentPageIdx = document().pageIdx(page()); - } else { - WndJournal.last_index = 0; + } else if (document().isLoreDoc()){ + WndJournal.last_index = 3; + WndJournal.CatalogTab.currentItemIdx = 3; } document().findPage(page); Sample.INSTANCE.play( Assets.Sounds.ITEM ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java index 4965a7640..d10d59155 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/keys/Key.java @@ -52,7 +52,7 @@ public abstract class Key extends Item { public boolean doPickUp(Hero hero, int pos) { Catalog.setSeen(getClass()); GameScene.pickUpJournal(this, pos); - WndJournal.last_index = 2; + WndJournal.last_index = 0; Notes.add(this); Sample.INSTANCE.play( Assets.Sounds.ITEM ); hero.spendAndNext( TIME_TO_PICK_UP ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/TrinketCatalyst.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/TrinketCatalyst.java index 7a198f8c5..e8a6fd04d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/TrinketCatalyst.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/TrinketCatalyst.java @@ -70,7 +70,6 @@ public class TrinketCatalyst extends Item { public boolean doPickUp(Hero hero, int pos) { if (super.doPickUp(hero, pos)){ if (!Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_ALCHEMY)){ - GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_ALCHEMY); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index d8b04f909..20735a832 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -596,7 +596,6 @@ public class GameScene extends PixelScene { if (!SPDSettings.intro() && Rankings.INSTANCE.totalNumber > 0 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_DIEING)){ - GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_DIEING); } @@ -1102,6 +1101,16 @@ public class GameScene extends PixelScene { public static void flashForDocument( Document doc, String page ){ if (scene != null) { + if (doc == Document.ADVENTURERS_GUIDE){ + if (!page.equals(Document.GUIDE_INTRO)) { + if (SPDSettings.interfaceSize() == 0) { + GLog.p(Messages.get(Guidebook.class, "hint_mobile")); + } else { + GLog.p(Messages.get(Guidebook.class, "hint_desktop", KeyBindings.getKeyName(KeyBindings.getFirstKeyForAction(SPDAction.JOURNAL, ControllerHandler.isControllerConnected())))); + } + } + Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(Guidebook.class, "hint_status")); + } scene.menu.flashForPage( doc, page ); } } @@ -1539,7 +1548,6 @@ public class GameScene extends PixelScene { } else if ( o instanceof Mob && ((Mob) o).isActive() ){ GameScene.show(new WndInfoMob((Mob) o)); if (o instanceof Snake && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_SURPRISE_ATKS)){ - GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_SURPRISE_ATKS); } } else if ( o instanceof Heap && !((Heap) o).isEmpty() ){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java index 0615c08d4..d746ebe45 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Icons.java @@ -39,6 +39,7 @@ public enum Icons { CHANGES, PREFS, SHPX, + JOURNAL, //rankings and hero select icons, spacing for 16x16 STAIRS, @@ -86,6 +87,7 @@ public enum Icons { COPY, PASTE, CATALOG, + ALCHEMY, COIN_SML, ENERGY_SML, BACKPACK, @@ -154,6 +156,9 @@ public enum Icons { case SHPX: icon.frame( icon.texture.uvRectBySize( 119, 0, 16, 16 ) ); break; + case JOURNAL: + icon.frame( icon.texture.uvRectBySize( 136, 0, 17, 16 ) ); + break; case STAIRS: icon.frame( icon.texture.uvRectBySize( 0, 16, 13, 16 ) ); @@ -283,6 +288,9 @@ public enum Icons { case CATALOG: icon.frame( icon.texture.uvRectBySize( 240, 64, 13, 16 ) ); break; + case ALCHEMY: + icon.frame( icon.texture.uvRectBySize( 224, 64, 16, 16 ) ); + break; case COIN_SML: icon.frame( icon.texture.uvRectBySize( 192, 80, 7, 7 ) ); break; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/MenuPane.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/MenuPane.java index 2605f15fd..5558cb86a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/MenuPane.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/MenuPane.java @@ -234,7 +234,7 @@ public class MenuPane extends Component { bg = new Image( Assets.Interfaces.MENU_BTN, 2, 2, 13, 11 ); add( bg ); - journalIcon = new Image( Assets.Interfaces.MENU_BTN, 31, 0, 11, 7); + journalIcon = new Image( Assets.Interfaces.MENU_BTN, 31, 0, 11, 6); add( journalIcon ); keyIcon = new KeyDisplay(); @@ -308,9 +308,15 @@ public class MenuPane extends Component { keyIcon.am = journalIcon.am = 1; if (flashingPage != null){ if (flashingDoc == Document.ALCHEMY_GUIDE){ - WndJournal.last_index = 1; + WndJournal.last_index = 2; GameScene.show( new WndJournal() ); } else if (flashingDoc.pageNames().contains(flashingPage)){ + if (flashingDoc == Document.ADVENTURERS_GUIDE){ + WndJournal.last_index = 1; + } else if (flashingDoc.isLoreDoc()){ + WndJournal.last_index = 3; + WndJournal.CatalogTab.currentItemIdx = 3; + } GameScene.show( new WndStory( flashingDoc.pageSprite(flashingPage), flashingDoc.pageTitle(flashingPage), flashingDoc.pageBody(flashingPage) ){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java index 9c7edc3c1..75713d25f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java @@ -113,11 +113,23 @@ public class WndJournal extends WndTabbed { catalogTab.updateList(); Tab[] tabs = { + new IconTab( Icons.JOURNAL.get() ) { + protected void select( boolean value ) { + super.select( value ); + notesTab.active = notesTab.visible = value; + if (value) last_index = 0; + } + + @Override + protected String hoverText() { + return Messages.get(notesTab, "title"); + } + }, new IconTab( new ItemSprite(ItemSpriteSheet.MASTERY, null) ) { protected void select( boolean value ) { super.select( value ); guideTab.active = guideTab.visible = value; - if (value) last_index = 0; + if (value) last_index = 1; } @Override @@ -125,28 +137,16 @@ public class WndJournal extends WndTabbed { return Messages.get(guideTab, "title"); } }, - new IconTab( new ItemSprite(ItemSpriteSheet.ALCH_PAGE, null) ) { + new IconTab( Icons.ALCHEMY.get() ) { protected void select( boolean value ) { super.select( value ); alchemyTab.active = alchemyTab.visible = value; - if (value) last_index = 1; - } - - @Override - protected String hoverText() { - return Messages.get(alchemyTab, "title"); - } - }, - new IconTab( Icons.get(Icons.STAIRS) ) { - protected void select( boolean value ) { - super.select( value ); - notesTab.active = notesTab.visible = value; if (value) last_index = 2; } @Override protected String hoverText() { - return Messages.get(notesTab, "title"); + return Messages.get(alchemyTab, "title"); } }, new IconTab( Icons.CATALOG.get() ) { @@ -478,12 +478,12 @@ public class WndJournal extends WndTabbed { } - private static class CatalogTab extends Component{ + public static class CatalogTab extends Component{ private RedButton[] itemButtons; private static final int NUM_BUTTONS = 4; - - private static int currentItemIdx = 0; + + public static int currentItemIdx = 0; private static float[] scrollPositions = new float[NUM_BUTTONS]; //sprite locations