Add clue hint arrows for clues

Add hint arrows for clue locations, NPCs and GameObjects.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-04-07 18:44:30 +02:00
committed by Adam
parent c3e7f80407
commit 8615a0ad5d
9 changed files with 50 additions and 0 deletions

View File

@@ -127,6 +127,7 @@ public class ClueScrollPlugin extends Plugin
return;
}
client.clearHintArrow();
clue = null;
}
@@ -138,6 +139,7 @@ public class ClueScrollPlugin extends Plugin
{
if (client.getGameState() == GameState.LOGIN_SCREEN)
{
client.clearHintArrow();
clue = null;
return;
}
@@ -200,6 +202,7 @@ public class ClueScrollPlugin extends Plugin
// so the clue window doesn't have to be open.
if (clue != null)
{
client.clearHintArrow();
this.clue = clue;
this.clueTimeout = Instant.now();
}

View File

@@ -33,6 +33,7 @@ import javax.imageio.ImageIO;
import javax.inject.Inject;
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
public class ClueScrollWorldOverlay extends Overlay
@@ -70,6 +71,7 @@ public class ClueScrollWorldOverlay extends Overlay
public ClueScrollWorldOverlay(ClueScrollPlugin plugin)
{
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE);
this.plugin = plugin;
}

View File

@@ -192,6 +192,11 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
{
for (NPC npc : plugin.getNpcsToMark())
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(npc);
}
OverlayUtil.renderActorOverlayImage(graphics, npc, CLUE_SCROLL_IMAGE, Color.ORANGE, IMAGE_Z_OFFSET);
}
}

View File

@@ -103,6 +103,11 @@ public class CipherClue extends ClueScroll implements TextClueScroll, NpcClueScr
{
for (NPC npc : plugin.getNpcsToMark())
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(npc);
}
OverlayUtil.renderActorOverlayImage(graphics, npc, CLUE_SCROLL_IMAGE, Color.ORANGE, IMAGE_Z_OFFSET);
}
}

View File

@@ -57,6 +57,11 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll
@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin)
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(getLocation());
}
LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
if (localLocation == null)

View File

@@ -369,6 +369,11 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
// Mark dig location
if (getLocation() != null && getNpc() == null && objectId == -1)
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(getLocation());
}
LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
if (localLocation != null)
@@ -382,6 +387,11 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
{
for (NPC npc : plugin.getNpcsToMark())
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(npc);
}
OverlayUtil.renderActorOverlayImage(graphics, npc, CLUE_SCROLL_IMAGE, Color.ORANGE, IMAGE_Z_OFFSET);
}
}
@@ -395,6 +405,11 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
{
for (GameObject gameObject : plugin.getObjectsToMark())
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(gameObject.getWorldLocation());
}
OverlayUtil.renderHoverableArea(graphics, gameObject.getClickbox(), mousePosition,
CLICKBOX_FILL_COLOR, CLICKBOX_BORDER_COLOR, CLICKBOX_HOVER_BORDER_COLOR);

View File

@@ -218,6 +218,11 @@ public class EmoteClue extends ClueScroll implements TextClueScroll
@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin)
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(getLocation());
}
LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
if (localLocation == null)

View File

@@ -78,6 +78,11 @@ public class FairyRingClue extends ClueScroll implements TextClueScroll
@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin)
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(getLocation());
}
LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
if (localLocation == null)

View File

@@ -125,6 +125,11 @@ public class MapClue extends ClueScroll implements ObjectClueScroll
@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin)
{
if (!plugin.getClient().hasHintArrow())
{
plugin.getClient().setHintArrow(getLocation());
}
LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
if (localLocation == null)