Merge pull request #1313 from deathbeam/clue-hints

Add clue hint arrows for clues
This commit is contained in:
Adam
2018-04-13 10:09:15 -04:00
committed by GitHub
11 changed files with 60 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)

View File

@@ -46,6 +46,7 @@ import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
import net.runelite.api.MenuEntry;
import net.runelite.api.NPC;
import net.runelite.api.Node;
import static net.runelite.api.Perspective.LOCAL_TILE_SIZE;
import net.runelite.api.Player;
import net.runelite.api.Point;
import net.runelite.api.Prayer;
@@ -786,6 +787,9 @@ public abstract class RSClientMixin implements RSClient
client.setHintArrowTargetType(HintArrowType.WORLD_POSITION.getValue());
client.setHintArrowX(point.getX());
client.setHintArrowY(point.getY());
// position the arrow in center of the tile
client.setHintArrowOffsetX(LOCAL_TILE_SIZE / 2);
client.setHintArrowOffsetY(LOCAL_TILE_SIZE / 2);
}
@Copy("menuAction")

View File

@@ -595,6 +595,12 @@ public interface RSClient extends RSGameEngine, Client
@Import("hintArrowY")
int getHintArrowY();
@Import("hintArrowOffsetX")
void setHintArrowOffsetX(int value);
@Import("hintArrowOffsetY")
void setHintArrowOffsetY(int value);
@Import("hintArrowNpcTargetIdx")
void setHintArrowNpcTargetIdx(int value);