From ffaa1cce1d64049c4223a59402cde3b75ca80a8f Mon Sep 17 00:00:00 2001 From: Wayne Li Date: Fri, 17 Dec 2021 20:43:41 -0800 Subject: [PATCH 1/8] clues: Fix some anagrams (#14486) Fixed spellings and wordings are confirmed from wiki crowdsourced data. --- .../plugins/cluescrolls/clues/AnagramClue.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java index 759fb1195f..8a35abd738 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java @@ -59,7 +59,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("AHA JAR", "Jaraah", new WorldPoint(3359, 3276, 0), "Duel Arena hospital"), new AnagramClue("ARC O LINE", "Caroline", new WorldPoint(2715, 3302, 0), "North Witchaven next to the row boat", "How many fishermen are there on the fishing platform?", "11"), new AnagramClue("ARE COL", "Oracle", new WorldPoint(3013, 3501, 0), "Ice Mountain West of Edgeville", "If x is 15 and y is 3 what is 3x + y?", "48"), - new AnagramClue("ARMCHAIR THE PELT", "Charlie the Tramp", new WorldPoint(3209, 3392, 0), "South entrance of Varrock", "How many coins would I have if I had 0 coins and attempted to buy 3 loaves of bread?", "0"), + new AnagramClue("ARMCHAIR THE PELT", "Charlie the Tramp", new WorldPoint(3209, 3392, 0), "South entrance of Varrock", "How many coins would I have if I have 0 coins and attempt to buy 10 loaves of bread for 3 coins each?", "0"), new AnagramClue("AT HERG", "Regath", new WorldPoint(1719, 3723, 0), "General Store, Arceuus, Zeah", "What is -5 to the power of 2?", "25"), new AnagramClue("A BAS", "Saba", new WorldPoint(2858, 3577, 0), "Death Plateau"), new AnagramClue("AREA CHEF TREK", "Father Aereck", new WorldPoint(3243, 3208, 0), "Lumbridge Church", "How many gravestones are in the church graveyard?", "19 or 20"), @@ -73,7 +73,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("CLASH ION", "Nicholas", new WorldPoint(1841, 3803, 0), "North of Port Piscarilius fishing shop", "How many windows are in Tynan's shop?", "4"), new AnagramClue("C ON GAME HOC", "Gnome Coach", new WorldPoint(2395, 3486, 0), "Gnome Ball course", "How many gnomes on the Gnome ball field have red patches on their uniforms?", "6"), new AnagramClue("COOL NERD", "Old crone", new WorldPoint(3462, 3557, 0), "East of the Slayer Tower", "What is the combined combat level of each species that live in Slayer tower?", "619"), - new AnagramClue("COPPER ORE CRYPTS", "Prospector Percy", new WorldPoint(3061, 3377, 0), "Motherlode Mine", "During a party, everyone shook hands with everyone else. There were 66 handshakes. How many people were at the party?", "12"), + new AnagramClue("COPPER ORE CRYPTS", "Prospector Percy", new WorldPoint(3061, 3377, 0), "Motherlode Mine", "During a party, everyone shook hands with everybody else. There were 66 handshakes. How many people were at the party?", "12"), new AnagramClue("DARN DRAKE", "Daer Krand", new WorldPoint(3728, 3302, 0), "Sisterhood Sanctuary (Slepe Dungeon, northeast of Nightmare Arena)"), new AnagramClue("DED WAR", "Edward", new WorldPoint(3284, 3943, 0), "Inside Rogue's Castle"), new AnagramClue("DEKAGRAM", "Dark mage", new WorldPoint(3039, 4835, 0), "Centre of the Abyss", "How many rifts are found here in the abyss?", "13"), @@ -81,14 +81,14 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("DIM THARN", "Mandrith", new WorldPoint(3182, 3946, 0), "Wilderness Resource Area"), new AnagramClue("DR HITMAN", "Mandrith", new WorldPoint(3182, 3946, 0), "Wilderness Resource Area", "How many scorpions live under the pit?", "28"), new AnagramClue("DR WARDEN FUNK", "Drunken Dwarf", new WorldPoint(2913, 10221, 0), "East Side of Keldagrim"), - new AnagramClue("DRAGONS LAMENT", "Strange Old Man", new WorldPoint(3564, 3288, 0), "Barrows", "One pipe fills a barrel in 1 hour while another pipe can fill the same barrel in 2 hours. How many minutes will it take to fill the take if both pipes are used?", "40"), + new AnagramClue("DRAGONS LAMENT", "Strange Old Man", new WorldPoint(3564, 3288, 0), "Barrows", "One pipe fills a barrel in 1 hour while another pipe can fill the same barrel in 2 hours. How many minutes will it take to fill the tank if both pipes are used?", "40"), new AnagramClue("DT RUN B", "Brundt the Chieftain", new WorldPoint(2658, 3670, 0), "Rellekka, main hall", "How many people are waiting for the next bard to perform?", "4"), new AnagramClue("DUO PLUG", "Dugopul", new WorldPoint(2803, 2744, 0), "Graveyard on Ape Atoll"), - new AnagramClue("EEK ZERO OP", "Zoo keeper", new WorldPoint(2613, 3269, 0), "Ardougne Zoo", "How many animals are in the Ardougne Zoo?", "40"), + new AnagramClue("EEK ZERO OP", "Zoo keeper", new WorldPoint(2613, 3269, 0), "Ardougne Zoo", "How many animals in total are there in the zoo?", "40"), new AnagramClue("EL OW", "Lowe", new WorldPoint(3233, 3423, 0), "Varrock archery store"), new AnagramClue("FORLUN", "Runolf", new WorldPoint(2512, 10256, 0), "Miscellania & Etceteria Dungeon"), new AnagramClue("GOBLIN KERN", "King Bolren", new WorldPoint(2541, 3170, 0), "Tree Gnome Village"), - new AnagramClue("GOT A BOY", "Gabooty", new WorldPoint(2790, 3066, 0), "Centre of Tai Bwo Wannai", "How many buildings in the village?", "11"), + new AnagramClue("GOT A BOY", "Gabooty", new WorldPoint(2790, 3066, 0), "Centre of Tai Bwo Wannai", "How many buildings are in the village?", "11"), new AnagramClue("GOBLETS ODD TOES", "Otto Godblessed", new WorldPoint(2501, 3487, 0), "Otto's Grotto", "How many types of dragon are there beneath the whirlpool's cavern?", "2"), new AnagramClue("HALT US", "Luthas", new WorldPoint(2938, 3152, 0), "Banana plantation, Karamja"), new AnagramClue("HEORIC", "Eohric", new WorldPoint(2900, 3565, 0), "Top floor of Burthorpe Castle", "King Arthur and Merlin sit down at the Round Table with 8 knights. How many degrees does each get?", "36"), @@ -98,9 +98,9 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("I DOOM ICON INN", "Dominic Onion", new WorldPoint(2609, 3116, 0), "Nightmare Zone", "How many reward points does a herb box cost?", "9,500"), new AnagramClue("I EVEN", "Nieve", new WorldPoint(2432, 3422, 0), "The slayer master in Gnome Stronghold", "How many farming patches are there in Gnome stronghold?", "2"), new AnagramClue("IM N ZEZIM", "Immenizz", new WorldPoint(2592, 4324, 0), "The Imp inside Puro-Puro"), - new AnagramClue("KAY SIR", "Sir Kay", new WorldPoint(2760, 3496, 0), "The courtyard in Camelot Castle", "How many fountains are there within the grounds of Camelot castle.", "6"), + new AnagramClue("KAY SIR", "Sir Kay", new WorldPoint(2760, 3496, 0), "The courtyard in Camelot Castle", "How many fountains are there within the grounds of Camelot castle?", "6"), new AnagramClue("LEAKEY", "Kaylee", new WorldPoint(2957, 3370, 0), "Rising Sun Inn in Falador", "How many chairs are there in the Rising Sun?", "18"), - new AnagramClue("LARK IN DOG", "King Roald", new WorldPoint(3220, 3476, 0), "Ground floor of Varrock castle", "How many bookcases are there in the Varrock palace library?", "24"), + new AnagramClue("LARK IN DOG", "King Roald", new WorldPoint(3220, 3476, 0), "Ground floor of Varrock castle", "How many bookcases are there in the palace library?", "24"), new AnagramClue("LOW LAG", "Gallow", new WorldPoint(1805, 3566, 0), "Vinery in the Great Kourend", "How many vine patches can you find in this vinery?", "12"), new AnagramClue("LADDER MEMO GUV", "Guard Vemmeldo", new WorldPoint(2447, 3418, 1), "Gnome Stronghold Bank", "How many magic trees can you find inside the Gnome Stronghold?", "3"), new AnagramClue("MAL IN TAU", "Luminata", new WorldPoint(3508, 3237, 0), "Near Burgh de Rott entrance"), @@ -120,7 +120,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("PEATY PERT", "Party Pete", new WorldPoint(3047, 3376, 0), "Falador Party Room"), new AnagramClue("QUIT HORRIBLE TYRANT", "Brother Tranquility", new WorldPoint(3681, 2963, 0), "Mos Le'Harmless or Harmony Island", "If I have 49 bottles of rum to share between 7 pirates, how many would each pirate get?", "7"), new AnagramClue("QUE SIR", "Squire", new WorldPoint(2975, 3343, 0), "Falador Castle Courtyard", "White knights are superior to black knights. 2 white knights can handle 3 black knights. How many knights do we need for an army of 981 black knights?", "654"), - new AnagramClue("R AK MI", "Karim", new WorldPoint(3273, 3181, 0), "Al Kharid Kebab shop", "I have 16 kebabs, I eat one myself and share the rest equally between 3 friends. How many do they have each?", "5"), + new AnagramClue("R AK MI", "Karim", new WorldPoint(3273, 3181, 0), "Al Kharid Kebab shop", "I have 16 kebabs, I eat one myself and then share the rest equally between 3 friends. How many do they have each?", "5"), new AnagramClue("RAT MAT WITHIN", "Martin Thwait", new WorldPoint(2906, 3537, 0), "Rogues' Den", "How many natural fires burn in Rogue's Den?", "2"), new AnagramClue("RATAI", "Taria", new WorldPoint(2940, 3223, 0), "Rimmington bush patch", "How many buildings are there in Rimmington?", "7"), new AnagramClue("R SLICER", "Clerris", new WorldPoint(1761, 3850, 0), "Arceuus mine, Zeah", "If I have 1,000 blood runes, and cast 131 ice barrage spells, how many blood runes do I have left?", "738"), From 406ce7bd6b2ee93ce14a1e9cd1f97da9ee501a5e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 18 Dec 2021 10:47:18 -0500 Subject: [PATCH 2/8] menu swapper: use menu callback for swap config Co-authored-by: sam --- .../MenuEntrySwapperPlugin.java | 51 +++---------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 68ecf39f3b..a674163d4e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -53,7 +53,6 @@ import net.runelite.api.NPC; import net.runelite.api.events.ClientTick; import net.runelite.api.events.MenuEntryAdded; import net.runelite.api.events.MenuOpened; -import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.PostItemComposition; import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetInfo; @@ -576,6 +575,13 @@ public class MenuEntrySwapperPlugin extends Plugin if (ITEM_MENU_TYPES.contains(menuAction) && entry.getIdentifier() == itemId) { entry.setType(MenuAction.RUNELITE); + entry.onClick(e -> + { + int index = menuAction == MenuAction.ITEM_USE + ? -1 + : menuAction.getId() - MenuAction.ITEM_FIRST_OPTION.getId(); + setSwapConfig(configuringShiftClick, itemId, index); + }); if (activeAction == menuAction) { @@ -663,49 +669,6 @@ public class MenuEntrySwapperPlugin extends Plugin } } - @Subscribe - public void onMenuOptionClicked(MenuOptionClicked event) - { - if (event.getMenuAction() != MenuAction.RUNELITE || event.getParam1() != WidgetInfo.INVENTORY.getId()) - { - return; - } - - int itemId = event.getId(); - - if (itemId == -1) - { - return; - } - - String option = event.getMenuOption(); - String target = event.getMenuTarget(); - ItemComposition itemComposition = itemManager.getItemComposition(itemId); - - if (!itemComposition.getName().equals(Text.removeTags(target))) - { - return; - } - - if (option.equals("Use")) //because "Use" is not in inventoryActions - { - setSwapConfig(configuringShiftClick, itemId, -1); - } - else - { - String[] inventoryActions = itemComposition.getInventoryActions(); - - for (int index = 0; index < inventoryActions.length; index++) - { - if (option.equals(inventoryActions[index])) - { - setSwapConfig(configuringShiftClick, itemId, index); - break; - } - } - } - } - private void swapMenuEntry(MenuEntry[] menuEntries, int index, MenuEntry menuEntry) { final int eventId = menuEntry.getIdentifier(); From 8fa819d035b3a6d0de91396ac8e8ed2b6eaea30e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 18 Dec 2021 11:00:53 -0500 Subject: [PATCH 3/8] menu swapper: don't show default action if one isn't configured Currently it is ambiguous if the configured action is the default action or there is no configured action because either way it prepends a * to the default op. Co-authored-by: sam --- .../MenuEntrySwapperPlugin.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index a674163d4e..1b6a6acd29 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -29,7 +29,6 @@ package net.runelite.client.plugins.menuentryswapper; import com.google.common.annotations.VisibleForTesting; import static com.google.common.base.Predicates.alwaysTrue; import static com.google.common.base.Predicates.equalTo; -import com.google.common.base.Strings; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.LinkedHashMultimap; @@ -529,7 +528,7 @@ public class MenuEntrySwapperPlugin extends Plugin return; } - MenuAction activeAction = MenuAction.ITEM_USE; + MenuAction activeAction = null; final ItemComposition itemComposition = itemManager.getItemComposition(itemId); if (configuringShiftClick) @@ -542,20 +541,18 @@ public class MenuEntrySwapperPlugin extends Plugin { activeAction = MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + shiftClickActionIndex); } + else + { + // Otherwise it is possible that we have Use swap configured + Integer config = getSwapConfig(true, itemId); + if (config != null && config == -1) + { + activeAction = MenuAction.ITEM_USE; + } + } } else { - // The default left click on items is the highest priority action 0-2, and otherwise is use. - final String[] actions = itemComposition.getInventoryActions(); - for (int i = 0; i <= 2; ++i) - { - if (!Strings.isNullOrEmpty(actions[i])) - { - activeAction = MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + i); - break; - } - } - // Apply left click action from configuration Integer config = getSwapConfig(false, itemId); if (config != null) From 0f52e3ff18dcece4ff0ca39148bc2d0a9fb96e55 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 18 Dec 2021 11:19:07 -0500 Subject: [PATCH 4/8] menu swapper: fix built in swaps overriding custom swaps If a swap is configured for the item, never enter into the built in swapping logic. Even if the swap was not applied for this entry, assume either it has already been applied or will be later. Co-authored-by: sam --- .../plugins/menuentryswapper/MenuEntrySwapperPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 1b6a6acd29..7fa8f7fba2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -711,7 +711,7 @@ public class MenuEntrySwapperPlugin extends Plugin if (itemOp) { Integer swapIndex = getSwapConfig(false, eventId); - if (swapIndex != null && index < menuEntries.length - 1) + if (swapIndex != null) { MenuAction swapAction = swapIndex >= 0 ? MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + swapIndex) @@ -720,8 +720,8 @@ public class MenuEntrySwapperPlugin extends Plugin if (menuAction == swapAction) { swap(optionIndexes, menuEntries, index, menuEntries.length - 1); - return; } + return; } } From 46bb6f81bb3b2cd681726e3b0a3bf4048e7b5957 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 18 Dec 2021 14:19:43 -0500 Subject: [PATCH 5/8] Update logback to 1.2.9 logback-parent isn't really a bom but instead includes other unrelated depenedncies like mockito and jodatime, and so I am just adding the individual logback and slf4j dependencies themselves. Also add slf4j-simple in dependencyManagement for the various test dependencies we have on it. --- cache-client/pom.xml | 1 - cache/pom.xml | 1 - http-api/pom.xml | 1 - http-service/pom.xml | 8 +++----- pom.xml | 23 +++++++++++++++++++---- runelite-api/pom.xml | 1 - 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 5f616c30f5..c3a97e17de 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -62,7 +62,6 @@ org.slf4j slf4j-simple - 1.7.12 test diff --git a/cache/pom.xml b/cache/pom.xml index 5aac96d0c6..8ed326415b 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -95,7 +95,6 @@ org.slf4j slf4j-simple - 1.7.12 test diff --git a/http-api/pom.xml b/http-api/pom.xml index 24ffa1bfdd..49bb4a43f0 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -68,7 +68,6 @@ org.slf4j slf4j-simple - 1.7.12 test diff --git a/http-service/pom.xml b/http-service/pom.xml index 671c95d597..15f6992c83 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -23,8 +23,10 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + 4.0.0 + net.runelite runelite-parent @@ -91,10 +93,6 @@ com.google.guava guava - - org.slf4j - slf4j-api - com.github.scribejava scribejava-apis diff --git a/pom.xml b/pom.xml index 3f5542e96d..a58e181871 100644 --- a/pom.xml +++ b/pom.xml @@ -40,6 +40,8 @@ 1 8 1.18.20 + 1.2.9 + 1.7.25 true true @@ -161,10 +163,23 @@ ch.qos.logback - logback-parent - 1.2.3 - pom - import + logback-classic + ${logback.version} + + + ch.qos.logback + logback-core + ${logback.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} com.google.inject diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 62813947a2..219f88d40d 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -60,7 +60,6 @@ org.slf4j slf4j-simple - 1.7.12 test From 0db23d4d7ac5e3ce33afeed971d13afb5dd2ca2e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 18 Dec 2021 14:37:58 -0500 Subject: [PATCH 6/8] ci: use adoptopenjdk --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a117224e5f..144e4b27be 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,8 +21,9 @@ jobs: ${{ runner.os }}-cache- - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: adopt java-version: 11 - name: Build From fab6e467868e6867b8d5c1b503449219ddaedc3d Mon Sep 17 00:00:00 2001 From: testing-ongithub <96100526+testing-ongithub@users.noreply.github.com> Date: Sat, 18 Dec 2021 18:08:44 -0600 Subject: [PATCH 7/8] Add option to disable system tray icon --- .../client/config/RuneLiteConfig.java | 29 ++++++++++++++----- .../java/net/runelite/client/ui/ClientUI.java | 5 +++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java index 5aaa63abbe..d160fccda3 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java @@ -185,11 +185,24 @@ public interface RuneLiteConfig extends Config return true; } + @ConfigItem( + keyName = "trayIcon", + name = "Enable tray icon", + description = "Enables icon in system tray", + warning = "Disabling this may limit your ability to receive tray notifications.\nPlease restart your client after changing this setting.", + position = 20, + section = notificationSettings + ) + default boolean enableTrayIcon() + { + return true; + } + @ConfigItem( keyName = "notificationTray", name = "Enable tray notifications", description = "Enables tray notifications", - position = 20, + position = 21, section = notificationSettings ) default boolean enableTrayNotifications() @@ -201,7 +214,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationRequestFocus", name = "Request focus", description = "Configures the window focus request type on notification", - position = 21, + position = 22, section = notificationSettings ) default RequestFocusType notificationRequestFocus() @@ -213,7 +226,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationSound", name = "Notification sound", description = "Enables the playing of a beep sound when notifications are displayed", - position = 22, + position = 23, section = notificationSettings ) default Notifier.NativeCustomOff notificationSound() @@ -225,7 +238,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationTimeout", name = "Notification timeout", description = "How long notification will be shown in milliseconds. A value of 0 will make it use the system configuration. (Linux only)", - position = 23, + position = 24, section = notificationSettings ) @Units(Units.MILLISECONDS) @@ -238,7 +251,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationGameMessage", name = "Game message notifications", description = "Adds a notification message to the chatbox", - position = 24, + position = 25, section = notificationSettings ) default boolean enableGameMessageNotification() @@ -250,7 +263,7 @@ public interface RuneLiteConfig extends Config keyName = "flashNotification", name = "Flash", description = "Flashes the game frame as a notification", - position = 25, + position = 26, section = notificationSettings ) default FlashNotification flashNotification() @@ -262,7 +275,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationFocused", name = "Send notifications when focused", description = "Toggles all notifications for when the client is focused", - position = 26, + position = 27, section = notificationSettings ) default boolean sendNotificationsWhenFocused() @@ -275,7 +288,7 @@ public interface RuneLiteConfig extends Config keyName = "notificationFlashColor", name = "Notification Flash", description = "Sets the color of the notification flashes.", - position = 27, + position = 28, section = notificationSettings ) default Color notificationFlashColor() diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java index c887a54682..b99ebe437c 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java @@ -521,7 +521,10 @@ public class ClientUI frame.revalidateMinimumSize(); // Create tray icon (needs to be created after frame is packed) - trayIcon = SwingUtil.createTrayIcon(ICON, title, frame); + if (config.enableTrayIcon()) + { + trayIcon = SwingUtil.createTrayIcon(ICON, title, frame); + } // Move frame around (needs to be done after frame is packed) if (config.rememberScreenBounds() && !safeMode) From 39b8b84aaf8e9cbb646c565cc57168ed78597f06 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 19 Dec 2021 23:34:11 -0500 Subject: [PATCH 8/8] chat message manager: fix recoloring gim messages gim messages must always start with | and can't have a leading col tag --- .../net/runelite/client/chat/ChatMessageManager.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java b/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java index f673ea0e60..42bc06a17f 100644 --- a/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java +++ b/runelite-client/src/main/java/net/runelite/client/chat/ChatMessageManager.java @@ -121,6 +121,7 @@ public class ChatMessageManager final MessageNode messageNode = client.getMessages().get(uid); assert messageNode != null : "chat message build for unknown message"; + String message = stringStack[size - 2]; final String username = stringStack[size - 3]; final String channel = stringStack[size - 4]; final ChatMessageType chatMessageType = messageNode.getType(); @@ -191,10 +192,17 @@ public class ChatMessageManager continue; } + String prefix = ""; + if (chatMessageType == ChatMessageType.CLAN_GIM_CHAT || chatMessageType == ChatMessageType.CLAN_GIM_MESSAGE) + { + message = message.substring(1); // remove | + prefix = "|"; + } + // Replace tags in the message with the new color so embedded won't reset the color final Color color = chatColor.getColor(); - stringStack[size - 2] = ColorUtil.wrapWithColorTag( - stringStack[size - 2].replace(ColorUtil.CLOSING_COLOR_TAG, ColorUtil.colorTag(color)), + stringStack[size - 2] = prefix + ColorUtil.wrapWithColorTag( + message.replace(ColorUtil.CLOSING_COLOR_TAG, ColorUtil.colorTag(color)), color); break; }