hotcoldclue: Display npc location before using device

Closes runelite/runelite#9219
This commit is contained in:
Jordan Atwood
2019-07-11 21:43:13 -07:00
parent ad2cce60bf
commit 1ba77fbc20

View File

@@ -62,14 +62,17 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
private static final int HOT_COLD_PANEL_WIDTH = 200; private static final int HOT_COLD_PANEL_WIDTH = 200;
private static final HotColdClue BEGINNER_CLUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Reldo may have a clue.", private static final HotColdClue BEGINNER_CLUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Reldo may have a clue.",
"Reldo", "Reldo",
"Speak to Reldo to receive a strange device."); "Speak to Reldo to receive a strange device.",
new WorldPoint(3211, 3494, 0));
private static final HotColdClue MASTER_CLUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Jorral may have a clue.", private static final HotColdClue MASTER_CLUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Jorral may have a clue.",
"Jorral", "Jorral",
"Speak to Jorral to receive a strange device."); "Speak to Jorral to receive a strange device.",
new WorldPoint(2436, 3347, 0));
private final String text; private final String text;
private final String npc; private final String npc;
private final String solution; private final String solution;
private final WorldPoint npcLocation;
@Nullable @Nullable
private HotColdSolver hotColdSolver; private HotColdSolver hotColdSolver;
private WorldPoint location; private WorldPoint location;
@@ -90,11 +93,12 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
return null; return null;
} }
private HotColdClue(String text, String npc, String solution) private HotColdClue(String text, String npc, String solution, WorldPoint npcLocation)
{ {
this.text = text; this.text = text;
this.npc = npc; this.npc = npc;
this.solution = solution; this.solution = solution;
this.npcLocation = npcLocation;
setRequiresSpade(true); setRequiresSpade(true);
initializeSolver(); initializeSolver();
} }
@@ -107,7 +111,14 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat
return new WorldPoint[0]; return new WorldPoint[0];
} }
return hotColdSolver.getPossibleLocations().stream().map(HotColdLocation::getWorldPoint).toArray(WorldPoint[]::new); if (hotColdSolver.getLastWorldPoint() == null)
{
return new WorldPoint[] {npcLocation};
}
else
{
return hotColdSolver.getPossibleLocations().stream().map(HotColdLocation::getWorldPoint).toArray(WorldPoint[]::new);
}
} }
@Override @Override