use of net.runelite.client.plugins.cluescrolls.clues.ClueScroll in project runelite by runelite.
the class ClueScrollOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
ClueScroll clue = plugin.getClue();
if (clue == null) {
return null;
}
panelComponent.getLines().clear();
clue.makeOverlayHint(panelComponent, plugin);
return panelComponent.render(graphics);
}
use of net.runelite.client.plugins.cluescrolls.clues.ClueScroll in project runelite by runelite.
the class ClueScrollEmoteOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
ClueScroll clue = plugin.getClue();
if (clue == null || !(clue instanceof EmoteClue)) {
return null;
}
EmoteClue emoteClue = (EmoteClue) clue;
if (!emoteClue.getFirstEmote().hasSprite()) {
return null;
}
Widget emoteContainer = client.getWidget(WidgetInfo.EMOTE_CONTAINER);
if (emoteContainer == null || emoteContainer.isHidden()) {
return null;
}
Widget emoteWindow = client.getWidget(WidgetInfo.EMOTE_WINDOW);
if (emoteWindow == null) {
return null;
}
for (Widget emoteWidget : emoteContainer.getDynamicChildren()) {
if (emoteWidget.getSpriteId() == emoteClue.getFirstEmote().getSpriteId()) {
highlightWidget(graphics, emoteWindow, emoteWidget, emoteClue.getSecondEmote() != null ? "1st" : "");
} else if (emoteClue.getSecondEmote() != null && emoteWidget.getSpriteId() == emoteClue.getSecondEmote().getSpriteId()) {
highlightWidget(graphics, emoteWindow, emoteWidget, "2nd");
}
}
return null;
}
use of net.runelite.client.plugins.cluescrolls.clues.ClueScroll in project runelite by runelite.
the class ClueScrollPlugin method checkForClues.
@Schedule(period = 600, unit = ChronoUnit.MILLIS)
public void checkForClues() {
if (client.getGameState() == GameState.LOGIN_SCREEN) {
clue = null;
return;
}
npcsToMark = null;
objectsToMark = null;
equippedItems = null;
if (clue instanceof NpcClueScroll) {
String npc = ((NpcClueScroll) clue).getNpc();
if (npc != null) {
Query query = new NPCQuery().nameContains(npc);
npcsToMark = queryRunner.runQuery(query);
}
}
if (clue instanceof ObjectClueScroll) {
int objectId = ((ObjectClueScroll) clue).getObjectId();
if (objectId != -1) {
GameObjectQuery query = new GameObjectQuery().idEquals(objectId);
objectsToMark = queryRunner.runQuery(query);
}
}
if (clue instanceof EmoteClue) {
equippedItems = new HashSet<>();
Item[] result = queryRunner.runQuery(new InventoryItemQuery(InventoryID.EQUIPMENT));
if (result != null) {
for (Item item : result) {
equippedItems.add(item.getId());
}
}
}
ClueScroll clue = findClueScroll();
if (clue == null && this.clue != null) {
// wait for WAIT_DURATION before discarding the knowledge of the player having a clue.
if (Instant.now().compareTo(clueTimeout.plus(WAIT_DURATION)) < 0) {
return;
}
}
// so the clue window doesn't have to be open.
if (clue != null) {
this.clue = clue;
this.clueTimeout = Instant.now();
}
}
Aggregations