screenshot: Add clan member death screenshotting (#14052)

This commit is contained in:
Patrick Watts
2021-09-21 11:41:54 +04:00
committed by Owain van Brakel
parent 0d0e75b825
commit 3a64e1063e
2 changed files with 24 additions and 9 deletions

View File

@@ -181,11 +181,23 @@ public interface ScreenshotConfig extends Config
return false; return false;
} }
@ConfigItem(
keyName = "clanDeath",
name = "Screenshot Clan Deaths",
description = "Configures whether or not screenshots are automatically taken when clan members die.",
position = 12,
section = whatSection
)
default boolean screenshotClanDeath()
{
return false;
}
@ConfigItem( @ConfigItem(
keyName = "duels", keyName = "duels",
name = "Screenshot Duels", name = "Screenshot Duels",
description = "Configures whether or not screenshots are automatically taken of the duel end screen.", description = "Configures whether or not screenshots are automatically taken of the duel end screen.",
position = 12, position = 13,
section = whatSection section = whatSection
) )
default boolean screenshotDuels() default boolean screenshotDuels()
@@ -197,7 +209,7 @@ public interface ScreenshotConfig extends Config
keyName = "valuableDrop", keyName = "valuableDrop",
name = "Screenshot Valuable drops", name = "Screenshot Valuable drops",
description = "Configures whether or not screenshots are automatically taken when you receive a valuable drop.", description = "Configures whether or not screenshots are automatically taken when you receive a valuable drop.",
position = 13, position = 14,
section = whatSection section = whatSection
) )
default boolean screenshotValuableDrop() default boolean screenshotValuableDrop()
@@ -209,7 +221,7 @@ public interface ScreenshotConfig extends Config
keyName = "valuableDropThreshold", keyName = "valuableDropThreshold",
name = "Valuable Threshold", name = "Valuable Threshold",
description = "The minimum value to save screenshots of valuable drops.", description = "The minimum value to save screenshots of valuable drops.",
position = 14, position = 15,
section = whatSection section = whatSection
) )
default int valuableDropThreshold() default int valuableDropThreshold()
@@ -221,7 +233,7 @@ public interface ScreenshotConfig extends Config
keyName = "untradeableDrop", keyName = "untradeableDrop",
name = "Screenshot Untradeable drops", name = "Screenshot Untradeable drops",
description = "Configures whether or not screenshots are automatically taken when you receive an untradeable drop.", description = "Configures whether or not screenshots are automatically taken when you receive an untradeable drop.",
position = 15, position = 16,
section = whatSection section = whatSection
) )
default boolean screenshotUntradeableDrop() default boolean screenshotUntradeableDrop()
@@ -233,7 +245,7 @@ public interface ScreenshotConfig extends Config
keyName = "ccKick", keyName = "ccKick",
name = "Screenshot Kicks from FC", name = "Screenshot Kicks from FC",
description = "Take a screenshot when you kick a user from a friends chat.", description = "Take a screenshot when you kick a user from a friends chat.",
position = 16, position = 17,
section = whatSection section = whatSection
) )
default boolean screenshotKick() default boolean screenshotKick()
@@ -245,7 +257,7 @@ public interface ScreenshotConfig extends Config
keyName = "baHighGamble", keyName = "baHighGamble",
name = "Screenshot BA high gambles", name = "Screenshot BA high gambles",
description = "Take a screenshot of your reward from a high gamble at Barbarian Assault.", description = "Take a screenshot of your reward from a high gamble at Barbarian Assault.",
position = 17, position = 18,
section = whatSection section = whatSection
) )
default boolean screenshotHighGamble() default boolean screenshotHighGamble()
@@ -257,7 +269,7 @@ public interface ScreenshotConfig extends Config
keyName = "collectionLogEntries", keyName = "collectionLogEntries",
name = "Screenshot collection log entries", name = "Screenshot collection log entries",
description = "Take a screenshot when completing an entry in the collection log", description = "Take a screenshot when completing an entry in the collection log",
position = 18, position = 19,
section = whatSection section = whatSection
) )
default boolean screenshotCollectionLogEntries() default boolean screenshotCollectionLogEntries()
@@ -269,7 +281,7 @@ public interface ScreenshotConfig extends Config
keyName = "hotkey", keyName = "hotkey",
name = "Screenshot hotkey", name = "Screenshot hotkey",
description = "When you press this key a screenshot will be taken", description = "When you press this key a screenshot will be taken",
position = 19 position = 20
) )
default Keybind hotkey() default Keybind hotkey()
{ {

View File

@@ -308,7 +308,10 @@ public class ScreenshotPlugin extends Plugin
{ {
takeScreenshot("Death", SD_DEATHS); takeScreenshot("Death", SD_DEATHS);
} }
else if (player != client.getLocalPlayer() && (player.isFriendsChatMember() || player.isFriend()) && config.screenshotFriendDeath() && player.getCanvasTilePoly() != null) else if (player != client.getLocalPlayer()
&& player.getCanvasTilePoly() != null
&& (((player.isFriendsChatMember() || player.isFriend()) && config.screenshotFriendDeath())
|| (player.isClanMember() && config.screenshotClanDeath())))
{ {
takeScreenshot("Death " + player.getName(), SD_DEATHS); takeScreenshot("Death " + player.getName(), SD_DEATHS);
} }