friend notes: support notes on ignore list players
This commit is contained in:
@@ -45,6 +45,7 @@ public enum WidgetInfo
|
||||
|
||||
INVENTORY(WidgetID.INVENTORY_GROUP_ID, 0),
|
||||
FRIENDS_LIST(WidgetID.FRIENDS_LIST_GROUP_ID, 0),
|
||||
IGNORE_LIST(WidgetID.IGNORE_LIST_GROUP_ID, 0),
|
||||
CLAN_CHAT(WidgetID.CLAN_CHAT_GROUP_ID, 0),
|
||||
RAIDING_PARTY(WidgetID.RAIDING_PARTY_GROUP_ID, 0),
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Friend;
|
||||
import net.runelite.api.Ignore;
|
||||
import net.runelite.api.MenuAction;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.Nameable;
|
||||
@@ -164,7 +165,8 @@ public class FriendNotesPlugin extends Plugin
|
||||
final int groupId = WidgetInfo.TO_GROUP(event.getActionParam1());
|
||||
|
||||
// Look for "Message" on friends list
|
||||
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() && event.getOption().equals("Message"))
|
||||
if ((groupId == WidgetInfo.FRIENDS_LIST.getGroupId() && event.getOption().equals("Message")) ||
|
||||
(groupId == WidgetInfo.IGNORE_LIST.getGroupId() && event.getOption().equals("Delete")))
|
||||
{
|
||||
// Friends have color tags
|
||||
setHoveredFriend(Text.toJagexName(Text.removeTags(event.getTarget())));
|
||||
@@ -190,7 +192,9 @@ public class FriendNotesPlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||
{
|
||||
if (WidgetInfo.TO_GROUP(event.getWidgetId()) == WidgetInfo.FRIENDS_LIST.getGroupId())
|
||||
final int groupId = WidgetInfo.TO_GROUP(event.getWidgetId());
|
||||
|
||||
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.IGNORE_LIST.getGroupId())
|
||||
{
|
||||
if (Strings.isNullOrEmpty(event.getMenuTarget()))
|
||||
{
|
||||
@@ -230,12 +234,11 @@ public class FriendNotesPlugin extends Plugin
|
||||
{
|
||||
final Nameable nameable = event.getNameable();
|
||||
|
||||
if (nameable instanceof Friend)
|
||||
if (nameable instanceof Friend || nameable instanceof Ignore)
|
||||
{
|
||||
// Migrate a friend's note to their new display name
|
||||
final Friend friend = (Friend) nameable;
|
||||
String name = friend.getName();
|
||||
String prevName = friend.getPrevName();
|
||||
String name = nameable.getName();
|
||||
String prevName = nameable.getPrevName();
|
||||
|
||||
if (prevName != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user