Merge pull request #1313 from deathbeam/clue-hints
Add clue hint arrows for clues
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user