diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java index 77a0d98a04..f0d01d51c0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java @@ -101,11 +101,22 @@ public interface ScreenshotConfig extends Config return true; } + @ConfigItem( + keyName = "pets", + name = "Screenshot Pet", + description = "Configures whether screenshots are taken of receiving pets", + position = 6 + ) + default boolean screenshotPet() + { + return true; + } + @ConfigItem( keyName = "uploadScreenshot", name = "Upload To Imgur", description = "Configures whether or not screenshots are uploaded to Imgur and copied into your clipboard", - position = 6 + position = 7 ) default boolean uploadScreenshot() { @@ -116,7 +127,7 @@ public interface ScreenshotConfig extends Config keyName = "enableShortcut", name = "Screenshot with [Insert]", description = "Configures whether or not screenshots can be taken with the Insert key", - position = 7 + position = 8 ) default boolean isScreenshotEnabled() { 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 6034d6bc7b..4f4d7f8107 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 @@ -25,6 +25,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.eventbus.Subscribe; import com.google.inject.Provides; @@ -106,6 +107,10 @@ public class ScreenshotPlugin extends Plugin private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)"); private static final Pattern LEVEL_UP_PATTERN = Pattern.compile("Your ([a-zA-Z]+) (?:level is|are)? now (\\d+)\\."); + private static final ImmutableList petMessages = ImmutableList.of("You have a funny feeling like you're being followed", + "You feel something weird sneaking into your backpack", + "You have a funny feeling like you would have been followed"); + private String clueType; private Integer clueNumber; @@ -247,6 +252,12 @@ public class ScreenshotPlugin extends Plugin return; } } + + if (config.screenshotPet() && petMessages.stream().anyMatch(chatMessage::contains)) + { + String fileName = "Pet " + TIME_FORMAT.format(new Date()); + takeScreenshot(fileName); + } } @Subscribe