screenshot: Add option to screenshot collection log entries (#13625)
This commit is contained in:
@@ -253,11 +253,23 @@ public interface ScreenshotConfig extends Config
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "collectionLogEntries",
|
||||
name = "Screenshot collection log entries",
|
||||
description = "Take a screenshot when completing an entry in the collection log",
|
||||
position = 18,
|
||||
section = whatSection
|
||||
)
|
||||
default boolean screenshotCollectionLogEntries()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "hotkey",
|
||||
name = "Screenshot hotkey",
|
||||
description = "When you press this key a screenshot will be taken",
|
||||
position = 18
|
||||
position = 19
|
||||
)
|
||||
default Keybind hotkey()
|
||||
{
|
||||
|
||||
@@ -95,6 +95,7 @@ import net.runelite.client.util.Text;
|
||||
@Slf4j
|
||||
public class ScreenshotPlugin extends Plugin
|
||||
{
|
||||
private static final String COLLECTION_LOG_TEXT = "New item added to your collection log: ";
|
||||
private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!";
|
||||
private static final Map<Integer, String> CHEST_LOOT_EVENTS = ImmutableMap.of(12127, "The Gauntlet");
|
||||
private static final int GAUNTLET_REGION = 7512;
|
||||
@@ -456,6 +457,13 @@ public class ScreenshotPlugin extends Plugin
|
||||
takeScreenshot(fileName, "Duels");
|
||||
}
|
||||
}
|
||||
|
||||
if (config.screenshotCollectionLogEntries() && chatMessage.startsWith(COLLECTION_LOG_TEXT))
|
||||
{
|
||||
String entry = Text.removeTags(chatMessage).substring(COLLECTION_LOG_TEXT.length());
|
||||
String fileName = "Collection log (" + entry + ")";
|
||||
takeScreenshot(fileName, "Collection Log");
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
Reference in New Issue
Block a user