diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesConfig.java index 8538094dac7..6f9cd4746a2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesConfig.java @@ -34,10 +34,10 @@ public interface FriendNotesConfig extends Config { @ConfigItem( - keyName = "showIcons", - name = "Show Icons", - description = "Show icons on friend or ignore list", - position = 1 + keyName = "showIcons", + name = "Show Icons", + description = "Show icons on friend or ignore list", + position = 1 ) default boolean showIcons() { @@ -45,10 +45,10 @@ default boolean showIcons() } @ConfigItem( - keyName = "keepNoteOnDelete", - name = "Keep Note On Delete", - description = "Keep the note when a player is deleted", - position = 2 + keyName = "keepNoteOnDelete", + name = "Keep Note On Delete", + description = "Keep the note when a player is deleted", + position = 2 ) default boolean keepNoteOnDelete() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java index 4987c8e779a..018d48f82b3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java @@ -64,8 +64,8 @@ @Slf4j @PluginDescriptor( - name = "Friend Notes", - description = "Store notes about your friends" + name = "Friend Notes", + description = "Store notes about your friends" ) public class FriendNotesPlugin extends Plugin { @@ -75,7 +75,7 @@ public class FriendNotesPlugin extends Plugin private static final String ADD_NOTE = "Add Note"; private static final String EDIT_NOTE = "Edit Note"; private static final String NOTE_PROMPT_FORMAT = "%s's Notes
" + - ColorUtil.prependColorTag("(Limit %s Characters)", new Color(0, 0, 170)); + ColorUtil.prependColorTag("(Limit %s Characters)", new Color(0, 0, 170)); private static final int ICON_WIDTH = 14; private static final int ICON_HEIGHT = 12; @@ -237,30 +237,30 @@ public void onMenuEntryAdded(MenuEntryAdded event) // Build "Add Note" or "Edit Note" menu entry client.createMenuEntry(-1) - .setOption(hoveredFriend == null || hoveredFriend.getNote() == null ? ADD_NOTE : EDIT_NOTE) - .setType(MenuAction.RUNELITE) - .setTarget(event.getTarget()) //Preserve color codes here - .onClick(e -> - { - //Friends have color tags - final String sanitizedTarget = Text.toJagexName(Text.removeTags(e.getTarget())); - final String note = getFriendNote(sanitizedTarget); - - // Open the new chatbox input dialog - chatboxPanelManager.openTextInput(String.format(NOTE_PROMPT_FORMAT, sanitizedTarget, CHARACTER_LIMIT)) - .value(Strings.nullToEmpty(note)) - .onDone((content) -> - { - if (content == null) - { - return; - } - - content = Text.removeTags(content).trim(); - log.debug("Set note for '{}': '{}'", sanitizedTarget, content); - setFriendNote(sanitizedTarget, content); - }).build(); - }); + .setOption(hoveredFriend == null || hoveredFriend.getNote() == null ? ADD_NOTE : EDIT_NOTE) + .setType(MenuAction.RUNELITE) + .setTarget(event.getTarget()) //Preserve color codes here + .onClick(e -> + { + //Friends have color tags + final String sanitizedTarget = Text.toJagexName(Text.removeTags(e.getTarget())); + final String note = getFriendNote(sanitizedTarget); + + // Open the new chatbox input dialog + chatboxPanelManager.openTextInput(String.format(NOTE_PROMPT_FORMAT, sanitizedTarget, CHARACTER_LIMIT)) + .value(Strings.nullToEmpty(note)) + .onDone((content) -> + { + if (content == null) + { + return; + } + + content = Text.removeTags(content).trim(); + log.debug("Set note for '{}': '{}'", sanitizedTarget, content); + setFriendNote(sanitizedTarget, content); + }).build(); + }); } else if (hoveredFriend != null) { @@ -282,8 +282,8 @@ public void onNameableNameChanged(NameableNameChanged event) if (prevName != null) { migrateFriendNote( - Text.toJagexName(name), - Text.toJagexName(prevName) + Text.toJagexName(name), + Text.toJagexName(prevName) ); } } @@ -343,16 +343,16 @@ private void rebuildFriendsList() { log.debug("Rebuilding friends list"); client.runScript( - ScriptID.FRIENDS_UPDATE, - ComponentID.FRIEND_LIST_FULL_CONTAINER, - ComponentID.FRIEND_LIST_SORT_BY_NAME_BUTTON, - ComponentID.FRIEND_LIST_SORT_BY_LAST_WORLD_CHANGE_BUTTON, - ComponentID.FRIEND_LIST_SORT_BY_WORLD_BUTTON, - ComponentID.FRIEND_LIST_LEGACY_SORT_BUTTON, - ComponentID.FRIEND_LIST_NAMES_CONTAINER, - ComponentID.FRIEND_LIST_SCROLL_BAR, - ComponentID.FRIEND_LIST_LOADING_TEXT, - ComponentID.FRIEND_LIST_PREVIOUS_NAME_HOLDER + ScriptID.FRIENDS_UPDATE, + ComponentID.FRIEND_LIST_FULL_CONTAINER, + ComponentID.FRIEND_LIST_SORT_BY_NAME_BUTTON, + ComponentID.FRIEND_LIST_SORT_BY_LAST_WORLD_CHANGE_BUTTON, + ComponentID.FRIEND_LIST_SORT_BY_WORLD_BUTTON, + ComponentID.FRIEND_LIST_LEGACY_SORT_BUTTON, + ComponentID.FRIEND_LIST_NAMES_CONTAINER, + ComponentID.FRIEND_LIST_SCROLL_BAR, + ComponentID.FRIEND_LIST_LOADING_TEXT, + ComponentID.FRIEND_LIST_PREVIOUS_NAME_HOLDER ); }); } @@ -363,14 +363,14 @@ private void rebuildIgnoreList() { log.debug("Rebuilding ignore list"); client.runScript( - ScriptID.IGNORE_UPDATE, - ComponentID.IGNORE_LIST_FULL_CONTAINER, - ComponentID.IGNORE_LIST_SORT_BY_NAME_BUTTON, - ComponentID.IGNORE_LIST_LEGACY_SORT_BUTTON, - ComponentID.IGNORE_LIST_NAMES_CONTAINER, - ComponentID.IGNORE_LIST_SCROLL_BAR, - ComponentID.IGNORE_LIST_LOADING_TEXT, - ComponentID.IGNORE_LIST_PREVIOUS_NAME_HOLDER + ScriptID.IGNORE_UPDATE, + ComponentID.IGNORE_LIST_FULL_CONTAINER, + ComponentID.IGNORE_LIST_SORT_BY_NAME_BUTTON, + ComponentID.IGNORE_LIST_LEGACY_SORT_BUTTON, + ComponentID.IGNORE_LIST_NAMES_CONTAINER, + ComponentID.IGNORE_LIST_SCROLL_BAR, + ComponentID.IGNORE_LIST_LOADING_TEXT, + ComponentID.IGNORE_LIST_PREVIOUS_NAME_HOLDER ); }); }