chat notifications: load highlights on start

This commit is contained in:
Adam
2018-06-13 13:09:35 -04:00
parent e8f6a13d13
commit 01eeb31d20

View File

@@ -74,6 +74,12 @@ public class ChatNotificationsPlugin extends Plugin
return configManager.getConfig(ChatNotificationsConfig.class);
}
@Override
public void startUp()
{
updateHighlights();
}
@Subscribe
public void onGameStateChanged(GameStateChanged event)
{
@@ -90,6 +96,12 @@ public class ChatNotificationsPlugin extends Plugin
public void onConfigChanged(ConfigChanged event)
{
if (event.getGroup().equals("chatnotification"))
{
updateHighlights();
}
}
private void updateHighlights()
{
highlightMatcher = null;
@@ -102,7 +114,6 @@ public class ChatNotificationsPlugin extends Plugin
highlightMatcher = Pattern.compile("\\b(" + joined + ")\\b", Pattern.CASE_INSENSITIVE);
}
}
}
@Subscribe
public void onSetMessage(SetMessage event)