From bd2cd07917b76bee26454d5a6352e4828eabd044 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 19 May 2021 08:23:23 -0600 Subject: [PATCH] screenshot: don't attempt to draw a date when there is no report button previously this would just silently ignore the screenshot if you were on the orb of oculus or fullscreen world map interfaces until you were back onto one of the normal tlis where the overlay is rendered. --- .../client/plugins/screenshot/ScreenshotPlugin.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java index 0dada91ae6..dbda81a49c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.screenshot; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import com.google.inject.Provides; import java.awt.Graphics; import java.awt.Image; @@ -34,6 +35,7 @@ import java.awt.image.BufferedImage; import java.lang.reflect.InvocationTargetException; import java.time.LocalDate; import java.util.Map; +import java.util.Set; import java.util.concurrent.ScheduledExecutorService; import java.util.function.Consumer; import java.util.regex.Matcher; @@ -56,6 +58,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetID; import static net.runelite.api.widgets.WidgetID.BARROWS_REWARD_GROUP_ID; import static net.runelite.api.widgets.WidgetID.CHAMBERS_OF_XERIC_REWARD_GROUP_ID; import static net.runelite.api.widgets.WidgetID.CLUE_SCROLL_REWARD_GROUP_ID; @@ -110,6 +113,10 @@ public class ScreenshotPlugin extends Plugin "You feel something weird sneaking into your backpack", "You have a funny feeling like you would have been followed"); private static final Pattern BA_HIGH_GAMBLE_REWARD_PATTERN = Pattern.compile("(?.+)!
High level gamble count: (?.+)"); + private static final Set REPORT_BUTTON_TLIS = ImmutableSet.of( + WidgetID.FIXED_VIEWPORT_GROUP_ID, + WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, + WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID); private String clueType; private Integer clueNumber; @@ -689,7 +696,7 @@ public class ScreenshotPlugin extends Plugin executor.submit(() -> takeScreenshot(fileName, subDir, img)); }; - if (config.displayDate()) + if (config.displayDate() && REPORT_BUTTON_TLIS.contains(client.getTopLevelInterfaceId())) { screenshotOverlay.queueForTimestamp(imageCallback); }