screenshot plugin: screenshot receiving pet
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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<String> 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
|
||||
|
||||
Reference in New Issue
Block a user