From 7033e4632ab06938e56f94c2fe57972e38d487e9 Mon Sep 17 00:00:00 2001 From: psikoi Date: Thu, 16 Aug 2018 16:57:59 +0100 Subject: [PATCH 1/2] Add activity priority to world list Adds a special sorting case for empty worlds. They should remain at the bottom of the world list. --- .../client/plugins/worldhopper/WorldSwitcherPanel.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java index f8e9491056..b90aefa6a6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java @@ -130,6 +130,12 @@ class WorldSwitcherPanel extends PluginPanel } }); + // Leave empty activity worlds on the bottom of the list + if (orderIndex == WorldOrder.ACTIVITY) + { + rows.sort((r1, r2) -> r1.getWorld().getActivity().equals("-") ? 1 : -1); + } + rows.sort((r1, r2) -> { boolean b1 = plugin.isFavorite(r1.getWorld()); From 3e9373cc32defdaefd69343314c683c6641d6c4e Mon Sep 17 00:00:00 2001 From: psikoi Date: Thu, 16 Aug 2018 16:59:03 +0100 Subject: [PATCH 2/2] Fix activity ordering incosistency The other ordering options order from bottom to top by default, this should too. --- .../runelite/client/plugins/worldhopper/WorldSwitcherPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java index b90aefa6a6..555ea3eee7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldSwitcherPanel.java @@ -123,7 +123,7 @@ class WorldSwitcherPanel extends PluginPanel case PLAYERS: return Integer.compare(r1.getUpdatedPlayerCount(), r2.getUpdatedPlayerCount()) * (ascendingOrder ? 1 : -1); case ACTIVITY: - return r1.getWorld().getActivity().compareTo(r2.getWorld().getActivity()) * (ascendingOrder ? 1 : -1); + return r1.getWorld().getActivity().compareTo(r2.getWorld().getActivity()) * -1 * (ascendingOrder ? 1 : -1); default: return 0;