From b1038142cb3046c71e72bb35c1fea4024d7bbff8 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 14 Jul 2018 15:50:22 -0400 Subject: [PATCH] screenshot plugin: fix hunter level up screenshots Co-authored-by: Magic fTail --- .../runelite/client/plugins/screenshot/ScreenshotPlugin.java | 2 +- .../client/plugins/screenshot/ScreenshotPluginTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java index 44109bcdcc..184805de8c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java @@ -107,7 +107,7 @@ public class ScreenshotPlugin extends Plugin private static final DateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss"); private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)"); - private static final Pattern LEVEL_UP_PATTERN = Pattern.compile("Your ([a-zA-Z]+) (?:level is|are)? now (\\d+)\\."); + private static final Pattern LEVEL_UP_PATTERN = Pattern.compile(".*Your ([a-zA-Z]+) (?:level is|are)? now (\\d+)\\."); private static final ImmutableList PET_MESSAGES = ImmutableList.of("You have a funny feeling like you're being followed", "You feel something weird sneaking into your backpack", diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/screenshot/ScreenshotPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/screenshot/ScreenshotPluginTest.java index 9bd57f8efc..5029bd5052 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/screenshot/ScreenshotPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/screenshot/ScreenshotPluginTest.java @@ -208,7 +208,7 @@ public class ScreenshotPluginTest Widget levelChild = mock(Widget.class); when(client.getWidget(Matchers.eq(DIALOG_SPRITE_TEXT))).thenReturn(levelChild); - when(levelChild.getText()).thenReturn("Your Hunter level is now 2."); + when(levelChild.getText()).thenReturn("Congratulations, you've just advanced a Hunter level.

Your Hunter level is now 2."); assertEquals("Hunter(2)", screenshotPlugin.parseLevelUpWidget(DIALOG_SPRITE_TEXT));