From 0d43ef063573dfb04596c07cbc27fef1dc983251 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 4 Aug 2020 19:26:42 -0400 Subject: [PATCH] v0.8.2: ui adjustments: - questgivers now get journal entries as they are seen - layout tweaks to news and supporter scene buttons --- .../actors/mobs/npcs/Blacksmith.java | 5 +++-- .../shatteredpixeldungeon/actors/mobs/npcs/Ghost.java | 7 +++++-- .../shatteredpixeldungeon/actors/mobs/npcs/Imp.java | 3 +-- .../shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java | 4 +++- .../shatteredpixeldungeon/scenes/NewsScene.java | 8 ++++++-- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java index ef8006c99..d3f0370ad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java @@ -64,6 +64,9 @@ public class Blacksmith extends NPC { @Override protected boolean act() { throwItem(); + if (Dungeon.level.heroFOV[pos] && !Quest.reforged){ + Notes.add( Notes.Landmark.TROLL ); + } return super.act(); } @@ -102,8 +105,6 @@ public class Blacksmith extends NPC { } }); - Notes.add( Notes.Landmark.TROLL ); - } else if (!Quest.completed) { if (Quest.alternative) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index 66ab0d08e..fa73f1b27 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -66,8 +66,12 @@ public class Ghost extends NPC { @Override protected boolean act() { - if (Quest.processed()) + if (Quest.processed()) { target = Dungeon.hero.pos; + } + if (Dungeon.level.heroFOV[pos] && !Quest.completed()){ + Notes.add( Notes.Landmark.GHOST ); + } return super.act(); } @@ -174,7 +178,6 @@ public class Ghost extends NPC { if (questBoss.pos != -1) { GameScene.add(questBoss); Quest.given = true; - Notes.add( Notes.Landmark.GHOST ); Game.runOnRenderThread(new Callback() { @Override public void call() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java index ab337a11a..4fa2aaff8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java @@ -60,6 +60,7 @@ public class Imp extends NPC { if (!seenBefore) { yell( Messages.get(this, "hey", Dungeon.hero.name() ) ); } + Notes.add( Notes.Landmark.IMP ); seenBefore = true; } else { seenBefore = false; @@ -117,8 +118,6 @@ public class Imp extends NPC { tell( Quest.alternative ? Messages.get(this, "monks_1") : Messages.get(this, "golems_1") ); Quest.given = true; Quest.completed = false; - - Notes.add( Notes.Landmark.IMP ); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index 7d5ae0212..d60b9a7ee 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -61,6 +61,9 @@ public class Wandmaker extends NPC { @Override protected boolean act() { throwItem(); + if (Dungeon.level.heroFOV[pos] && Quest.wand1 != null){ + Notes.add( Notes.Landmark.WANDMAKER ); + } return super.act(); } @@ -184,7 +187,6 @@ public class Wandmaker extends NPC { } }); - Notes.add( Notes.Landmark.WANDMAKER ); Quest.given = true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java index 3df89a2bf..6dc025109 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/NewsScene.java @@ -276,13 +276,17 @@ public class NewsScene extends PixelScene { protected void layout() { text.maxWidth( (int)(width - icon.width() - bg.marginHor() - 2)); + super.layout(); + + icon.x = x + bg.marginLeft() + (16-icon.width())/2f; + PixelScene.align(icon); + text.setPos(x + bg.marginLeft() + 18, text.top()); + if (date != null) { date.x = x + width - bg.marginRight() - date.width() + 2; date.y = y + height - bg.marginBottom() - date.height() + 3.5f; align(date); } - - super.layout(); } @Override