Add option to take screenshot on local player death (#5711)

Closes #5707
This commit is contained in:
robinwithes
2018-10-01 08:24:11 +02:00
committed by Tomas Slusny
parent 53b3ba19b0
commit 94905de188
2 changed files with 23 additions and 2 deletions

View File

@@ -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;
}
}
}

View File

@@ -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)
{