screenshot plugin: Add raids reward
This commit is contained in:
@@ -73,6 +73,7 @@ public class WidgetID
|
|||||||
public static final int BLAST_FURNACE_GROUP_ID = 474;
|
public static final int BLAST_FURNACE_GROUP_ID = 474;
|
||||||
public static final int WORLD_MAP = 595;
|
public static final int WORLD_MAP = 595;
|
||||||
public static final int PYRAMID_PLUNDER_GROUP_ID = 428;
|
public static final int PYRAMID_PLUNDER_GROUP_ID = 428;
|
||||||
|
public static final int RAIDS_REWARD_GROUP_ID = 539;
|
||||||
|
|
||||||
static class WorldMap
|
static class WorldMap
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ import static net.runelite.api.widgets.WidgetID.CLUE_SCROLL_REWARD_GROUP_ID;
|
|||||||
import static net.runelite.api.widgets.WidgetID.DIALOG_SPRITE_GROUP_ID;
|
import static net.runelite.api.widgets.WidgetID.DIALOG_SPRITE_GROUP_ID;
|
||||||
import static net.runelite.api.widgets.WidgetID.LEVEL_UP_GROUP_ID;
|
import static net.runelite.api.widgets.WidgetID.LEVEL_UP_GROUP_ID;
|
||||||
import static net.runelite.api.widgets.WidgetID.QUEST_COMPLETED_GROUP_ID;
|
import static net.runelite.api.widgets.WidgetID.QUEST_COMPLETED_GROUP_ID;
|
||||||
|
import static net.runelite.api.widgets.WidgetID.RAIDS_REWARD_GROUP_ID;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import static net.runelite.api.widgets.WidgetInfo.TO_GROUP;
|
import static net.runelite.api.widgets.WidgetInfo.TO_GROUP;
|
||||||
import net.runelite.client.Notifier;
|
import net.runelite.client.Notifier;
|
||||||
@@ -106,6 +107,8 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
|
|
||||||
private Integer barrowsNumber;
|
private Integer barrowsNumber;
|
||||||
|
|
||||||
|
private Integer raidsNumber;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ScreenshotConfig config;
|
private ScreenshotConfig config;
|
||||||
|
|
||||||
@@ -212,6 +215,16 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chatMessage.startsWith("Your completed Chambers of Xeric count is:"))
|
||||||
|
{
|
||||||
|
Matcher m = NUMBER_PATTERN.matcher(chatMessage.replaceAll("<[^>]*>", ""));
|
||||||
|
if (m.find())
|
||||||
|
{
|
||||||
|
raidsNumber = Integer.valueOf(m.group());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -235,6 +248,7 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
case QUEST_COMPLETED_GROUP_ID:
|
case QUEST_COMPLETED_GROUP_ID:
|
||||||
case CLUE_SCROLL_REWARD_GROUP_ID:
|
case CLUE_SCROLL_REWARD_GROUP_ID:
|
||||||
case BARROWS_REWARD_GROUP_ID:
|
case BARROWS_REWARD_GROUP_ID:
|
||||||
|
case RAIDS_REWARD_GROUP_ID:
|
||||||
if (!config.screenshotRewards())
|
if (!config.screenshotRewards())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -294,6 +308,17 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
barrowsNumber = null;
|
barrowsNumber = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case RAIDS_REWARD_GROUP_ID:
|
||||||
|
{
|
||||||
|
if (raidsNumber == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fileName = "Raids(" + raidsNumber + ")";
|
||||||
|
raidsNumber = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -477,20 +502,26 @@ public class ScreenshotPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public int getClueNumber()
|
int getClueNumber()
|
||||||
{
|
{
|
||||||
return clueNumber;
|
return clueNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public String getClueType()
|
String getClueType()
|
||||||
{
|
{
|
||||||
return clueType;
|
return clueType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public int getBarrowsNumber()
|
int getBarrowsNumber()
|
||||||
{
|
{
|
||||||
return barrowsNumber;
|
return barrowsNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
int getRaidsNumber()
|
||||||
|
{
|
||||||
|
return raidsNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public class ScreenshotPluginTest
|
|||||||
{
|
{
|
||||||
private static final String CLUE_SCROLL = "<col=3300ff>You have completed 28 medium Treasure Trails</col>";
|
private static final String CLUE_SCROLL = "<col=3300ff>You have completed 28 medium Treasure Trails</col>";
|
||||||
private static final String BARROWS_CHEST = "Your Barrows chest count is <col=ff0000>310</col>";
|
private static final String BARROWS_CHEST = "Your Barrows chest count is <col=ff0000>310</col>";
|
||||||
|
private static final String RAIDS_CHEST = "Your completed Chambers of Xeric count is: <col=ff0000>489.</col>";
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
@Bind
|
@Bind
|
||||||
@@ -121,6 +122,15 @@ public class ScreenshotPluginTest
|
|||||||
assertEquals(310, screenshotPlugin.getBarrowsNumber());
|
assertEquals(310, screenshotPlugin.getBarrowsNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testraidschest()
|
||||||
|
{
|
||||||
|
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Seth", RAIDS_CHEST, null);
|
||||||
|
screenshotPlugin.onChatMessage(chatMessageEvent);
|
||||||
|
|
||||||
|
assertEquals(489, screenshotPlugin.getRaidsNumber());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHitpoints()
|
public void testHitpoints()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user