Merge pull request #884 from xaviergmail/superior-foes
Add slayer superior foe notification
This commit is contained in:
@@ -55,6 +55,16 @@ public interface SlayerConfig extends Config
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "superiornotification",
|
||||
name = "Superior foe notification",
|
||||
description = "Toggles notifications on superior foe encounters"
|
||||
)
|
||||
default boolean showSuperiorNotification()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Stored data
|
||||
@ConfigItem(
|
||||
keyName = "taskName",
|
||||
|
||||
@@ -46,6 +46,7 @@ import net.runelite.api.events.ExperienceChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -66,6 +67,7 @@ public class SlayerPlugin extends Plugin
|
||||
private static final String CHAT_GEM_COMPLETE_MESSAGE = "You need something new to hunt.";
|
||||
private static final Pattern CHAT_COMPLETE_MESSAGE = Pattern.compile("[\\d]+(?:,[\\d]+)?");
|
||||
private static final String CHAT_CANCEL_MESSAGE = "Your task has been cancelled.";
|
||||
private static final String CHAT_SUPERIOR_MESSAGE = "A superior foe has appeared...";
|
||||
|
||||
//NPC messages
|
||||
private static final Pattern NPC_ASSIGN_MESSAGE = Pattern.compile(".*Your new task is to kill (\\d*) (.*)\\.");
|
||||
@@ -89,6 +91,9 @@ public class SlayerPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
private String taskName;
|
||||
private int amount;
|
||||
private TaskCounter counter;
|
||||
@@ -230,6 +235,12 @@ public class SlayerPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.showSuperiorNotification() && chatMsg.equals(CHAT_SUPERIOR_MESSAGE))
|
||||
{
|
||||
notifier.notify(CHAT_SUPERIOR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
Matcher mProgress = CHAT_GEM_PROGRESS_MESSAGE.matcher(chatMsg);
|
||||
if (!mProgress.find())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user