From 3ad68bcce6c65e17757e5a97d4ba38190bca52bb Mon Sep 17 00:00:00 2001 From: Kyle <48519776+xKylee@users.noreply.github.com> Date: Fri, 13 Dec 2019 19:58:16 +0000 Subject: [PATCH] OpenOSRS: fix hiding plugins (#2123) OpenOSRS: fix hiding plugins --- .../plugins/openosrs/OpenOSRSPlugin.java | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java index 676d4fb7f8..37b14cf244 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java @@ -60,7 +60,7 @@ import net.runelite.client.util.HotkeyListener; public class OpenOSRSPlugin extends Plugin { private final openosrsKeyListener keyListener = new openosrsKeyListener(); - private final List colorOptions = Arrays.asList("externalColor", "pvmColor", "pvpColor", "skillingColor", "utilityColor"); + private final List HidePlugins = Arrays.asList("hidePlugins", "hidePvmPlugins", "hidePvpPlugins", "hideSkillingPlugins", "hideUtilityPlugins", "hideExternalPlugins"); @Inject private OpenOSRSConfig config; @@ -73,7 +73,11 @@ public class OpenOSRSPlugin extends Plugin @Inject private ClientThread clientThread; - + private int entered = -1; + private int enterIdx; + private boolean expectInput; + private boolean detach; + private Keybind keybind; private final HotkeyListener hotkeyListener = new HotkeyListener(() -> this.keybind) { @Override @@ -84,16 +88,10 @@ public class OpenOSRSPlugin extends Plugin client.setOculusOrbNormalSpeed(detach ? 36 : 12); } }; - private int entered = -1; - private int enterIdx; - private boolean expectInput; - private boolean detach; - private Keybind keybind; @Override protected void startUp() { - entered = -1; enterIdx = 0; expectInput = false; @@ -119,7 +117,7 @@ public class OpenOSRSPlugin extends Plugin return; } - if (colorOptions.stream().anyMatch(option -> option.equals(event.getKey()))) + if (HidePlugins.stream().anyMatch(option -> option.equals(event.getKey()))) { updatePlugins(); } @@ -220,6 +218,20 @@ public class OpenOSRSPlugin extends Plugin } } + private void updatePlugins() + { + ConfigPanel.pluginList.forEach(listItem -> + { + if (listItem.getPluginType() == PluginType.GENERAL_USE || listItem.getPluginType() == PluginType.IMPORTANT) + { + return; + } + + listItem.setColor(ConfigPanel.getColorByCategory(config, listItem.getPluginType())); + listItem.setHidden(ConfigPanel.getHiddenByCategory(config, listItem.getPluginType())); + }); + } + private class openosrsKeyListener implements KeyListener { private int lastKeyCycle; @@ -254,18 +266,4 @@ public class OpenOSRSPlugin extends Plugin { } } - - private void updatePlugins() - { - ConfigPanel.pluginList.forEach(listItem -> - { - if (listItem.getPluginType() == PluginType.GENERAL_USE || listItem.getPluginType() == PluginType.IMPORTANT) - { - return; - } - - listItem.setColor(ConfigPanel.getColorByCategory(config, listItem.getPluginType())); - listItem.setHidden(ConfigPanel.getHiddenByCategory(config, listItem.getPluginType())); - }); - } -} \ No newline at end of file +}