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 526ae9e76b..066fae5080 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 @@ -143,14 +143,25 @@ public interface ScreenshotConfig extends Config return false; } + @ConfigItem( + keyName = "playerDeath", + name = "Screenshot Deaths", + description = "Configures whether or not screenshots are automatically taken when you die.", + position = 10 + ) + default boolean screenshotPlayerDeath() + { + return false; + } + @ConfigItem( keyName = "hotkey", name = "Screenshot hotkey", description = "When you press this key a screenshot will be taken", - position = 10 + position = 11 ) default Keybind hotkey() { return Keybind.NOT_SET; } -} +} \ No newline at end of file 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 970442e3b8..17a990cff6 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 @@ -64,6 +64,7 @@ import net.runelite.api.WorldType; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; +import net.runelite.api.events.LocalPlayerDeath; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.Widget; import static net.runelite.api.widgets.WidgetID.BARROWS_REWARD_GROUP_ID; @@ -282,6 +283,15 @@ public class ScreenshotPlugin extends Plugin } } + @Subscribe + public void onLocalPlayerDeath(LocalPlayerDeath death) + { + if (config.screenshotPlayerDeath()) + { + takeScreenshot("Death " + format(new Date())); + } + } + @Subscribe public void onChatMessage(ChatMessage event) {