screenshot plugin: add friend/clan member death screenshotting

This commit is contained in:
HSJ-OSRS
2019-11-11 19:41:44 +00:00
committed by Adam
parent 3fd8fb79aa
commit b565f29049
2 changed files with 22 additions and 6 deletions

View File

@@ -153,11 +153,22 @@ public interface ScreenshotConfig extends Config
return false;
}
@ConfigItem(
keyName = "friendDeath",
name = "Screenshot Friend Deaths",
description = "Configures whether or not screenshots are automatically taken when friends or clan members die.",
position = 11
)
default boolean screenshotFriendDeath()
{
return false;
}
@ConfigItem(
keyName = "duels",
name = "Screenshot Duels",
description = "Configures whether or not screenshots are automatically taken of the duel end screen.",
position = 11
position = 12
)
default boolean screenshotDuels()
{
@@ -168,7 +179,7 @@ public interface ScreenshotConfig extends Config
keyName = "valuableDrop",
name = "Screenshot Valuable drops",
description = "Configures whether or not screenshots are automatically taken when you receive a valuable drop.",
position = 12
position = 13
)
default boolean screenshotValuableDrop()
{
@@ -179,7 +190,7 @@ public interface ScreenshotConfig extends Config
keyName = "untradeableDrop",
name = "Screenshot Untradeable drops",
description = "Configures whether or not screenshots are automatically taken when you receive an untradeable drop.",
position = 13
position = 14
)
default boolean screenshotUntradeableDrop()
{
@@ -190,10 +201,10 @@ public interface ScreenshotConfig extends Config
keyName = "hotkey",
name = "Screenshot hotkey",
description = "When you press this key a screenshot will be taken",
position = 14
position = 15
)
default Keybind hotkey()
{
return Keybind.NOT_SET;
}
}
}

View File

@@ -281,10 +281,15 @@ public class ScreenshotPlugin extends Plugin
@Subscribe
public void onPlayerDeath(PlayerDeath playerDeath)
{
if (playerDeath.getPlayer() == client.getLocalPlayer() && config.screenshotPlayerDeath())
Player player = playerDeath.getPlayer();
if (player == client.getLocalPlayer() && config.screenshotPlayerDeath())
{
takeScreenshot("Death " + format(new Date()));
}
else if ((player.isClanMember() || player.isFriend()) && config.screenshotFriendDeath() && player.getCanvasTilePoly() != null)
{
takeScreenshot("Death " + player.getName() + " " + format(new Date()));
}
}
@Subscribe