screenshot plugin: make subdir strings constants

This commit is contained in:
Adam
2021-06-13 17:30:48 -04:00
parent 5db59f083e
commit 79b18d43aa

View File

@@ -118,6 +118,18 @@ public class ScreenshotPlugin extends Plugin
WidgetID.FIXED_VIEWPORT_GROUP_ID,
WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID,
WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID);
private static final String SD_KINGDOM_REWARDS = "Kingdom Rewards";
private static final String SD_BOSS_KILLS = "Boss Kills";
private static final String SD_CLUE_SCROLL_REWARDS = "Clue Scroll Rewards";
private static final String SD_FRIENDS_CHAT_KICKS = "Friends Chat Kicks";
private static final String SD_PETS = "Pets";
private static final String SD_CHEST_LOOT = "Chest Loot";
private static final String SD_VALUABLE_DROPS = "Valuable Drops";
private static final String SD_UNTRADEABLE_DROPS = "Untradeable Drops";
private static final String SD_DUELS = "Duels";
private static final String SD_COLLECTION_LOG = "Collection Log";
private static final String SD_PVP_KILLS = "PvP Kills";
private static final String SD_DEATHS = "Deaths";
private String clueType;
private Integer clueNumber;
@@ -286,11 +298,11 @@ public class ScreenshotPlugin extends Plugin
Player player = (Player) actor;
if (player == client.getLocalPlayer() && config.screenshotPlayerDeath())
{
takeScreenshot("Death", "Deaths");
takeScreenshot("Death", SD_DEATHS);
}
else if (player != client.getLocalPlayer() && (player.isFriendsChatMember() || player.isFriend()) && config.screenshotFriendDeath() && player.getCanvasTilePoly() != null)
{
takeScreenshot("Death " + player.getName(), "Deaths");
takeScreenshot("Death " + player.getName(), SD_DEATHS);
}
}
}
@@ -303,7 +315,7 @@ public class ScreenshotPlugin extends Plugin
final Player player = playerLootReceived.getPlayer();
final String name = player.getName();
String fileName = "Kill " + name;
takeScreenshot(fileName, "PvP Kills");
takeScreenshot(fileName, SD_PVP_KILLS);
}
}
@@ -395,14 +407,14 @@ public class ScreenshotPlugin extends Plugin
return;
}
takeScreenshot("Kick " + kickPlayerName, "Friends Chat Kicks");
takeScreenshot("Kick " + kickPlayerName, SD_FRIENDS_CHAT_KICKS);
kickPlayerName = null;
}
if (config.screenshotPet() && PET_MESSAGES.stream().anyMatch(chatMessage::contains))
{
String fileName = "Pet";
takeScreenshot(fileName, "Pets");
takeScreenshot(fileName, SD_PETS);
}
if (config.screenshotBossKills())
@@ -413,7 +425,7 @@ public class ScreenshotPlugin extends Plugin
String bossName = m.group(1);
String bossKillcount = m.group(2);
String fileName = bossName + "(" + bossKillcount + ")";
takeScreenshot(fileName, "Boss Kills");
takeScreenshot(fileName, SD_BOSS_KILLS);
}
}
@@ -423,7 +435,7 @@ public class ScreenshotPlugin extends Plugin
String eventName = CHEST_LOOT_EVENTS.get(regionID);
if (eventName != null)
{
takeScreenshot(eventName, "Chest Loot");
takeScreenshot(eventName, SD_CHEST_LOOT);
}
}
@@ -437,7 +449,7 @@ public class ScreenshotPlugin extends Plugin
{
String valuableDropName = m.group(1);
String fileName = "Valuable drop " + valuableDropName;
takeScreenshot(fileName, "Valuable Drops");
takeScreenshot(fileName, SD_VALUABLE_DROPS);
}
}
}
@@ -449,7 +461,7 @@ public class ScreenshotPlugin extends Plugin
{
String untradeableDropName = m.group(1);
String fileName = "Untradeable drop " + untradeableDropName;
takeScreenshot(fileName, "Untradeable Drops");
takeScreenshot(fileName, SD_UNTRADEABLE_DROPS);
}
}
@@ -461,7 +473,7 @@ public class ScreenshotPlugin extends Plugin
String result = m.group(1);
String count = m.group(2);
String fileName = "Duel " + result + " (" + count + ")";
takeScreenshot(fileName, "Duels");
takeScreenshot(fileName, SD_DUELS);
}
}
@@ -469,7 +481,7 @@ public class ScreenshotPlugin extends Plugin
{
String entry = Text.removeTags(chatMessage).substring(COLLECTION_LOG_TEXT.length());
String fileName = "Collection log (" + entry + ")";
takeScreenshot(fileName, "Collection Log");
takeScreenshot(fileName, SD_COLLECTION_LOG);
}
}
@@ -517,7 +529,7 @@ public class ScreenshotPlugin extends Plugin
case KINGDOM_GROUP_ID:
{
fileName = "Kingdom " + LocalDate.now();
screenshotSubDir = "Kingdom Rewards";
screenshotSubDir = SD_KINGDOM_REWARDS;
break;
}
case CHAMBERS_OF_XERIC_REWARD_GROUP_ID:
@@ -525,7 +537,7 @@ public class ScreenshotPlugin extends Plugin
if (killType == KillType.COX)
{
fileName = "Chambers of Xeric(" + killCountNumber + ")";
screenshotSubDir = "Boss Kills";
screenshotSubDir = SD_BOSS_KILLS;
killType = null;
killCountNumber = 0;
break;
@@ -533,7 +545,7 @@ public class ScreenshotPlugin extends Plugin
else if (killType == KillType.COX_CM)
{
fileName = "Chambers of Xeric Challenge Mode(" + killCountNumber + ")";
screenshotSubDir = "Boss Kills";
screenshotSubDir = SD_BOSS_KILLS;
killType = null;
killCountNumber = 0;
break;
@@ -548,7 +560,7 @@ public class ScreenshotPlugin extends Plugin
}
fileName = "Theatre of Blood(" + killCountNumber + ")";
screenshotSubDir = "Boss Kills";
screenshotSubDir = SD_BOSS_KILLS;
killType = null;
killCountNumber = 0;
break;
@@ -561,7 +573,7 @@ public class ScreenshotPlugin extends Plugin
}
fileName = "Barrows(" + killCountNumber + ")";
screenshotSubDir = "Boss Kills";
screenshotSubDir = SD_BOSS_KILLS;
killType = null;
killCountNumber = 0;
break;
@@ -582,7 +594,7 @@ public class ScreenshotPlugin extends Plugin
}
fileName = Character.toUpperCase(clueType.charAt(0)) + clueType.substring(1) + "(" + clueNumber + ")";
screenshotSubDir = "Clue Scroll Rewards";
screenshotSubDir = SD_CLUE_SCROLL_REWARDS;
clueType = null;
clueNumber = null;
break;