From 41e5d55cfe541800490a01737b0c936f2c68bc66 Mon Sep 17 00:00:00 2001 From: Kyleeld <48519776+Kyleeld@users.noreply.github.com> Date: Tue, 23 Jul 2019 00:36:30 +0100 Subject: [PATCH] PvPTools: Remove fallinhelper PvPTools: Remove fallinhelper was unused, causing crashes --- .../plugins/pvptools/PvpToolsOverlay.java | 50 ------------------- .../plugins/pvptools/PvpToolsPlugin.java | 41 --------------- 2 files changed, 91 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsOverlay.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsOverlay.java deleted file mode 100644 index 5aceb68fa7..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsOverlay.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2019. PKLite - All Rights Reserved - * Unauthorized modification, distribution, or possession of this source file, via any medium is strictly prohibited. - * Proprietary and confidential. Refer to PKLite License file for more information on - * full terms of this copyright and to determine what constitutes authorized use. - * Written by PKLite(ST0NEWALL, others) , 2019 - * - */ - -package net.runelite.client.plugins.pvptools; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics2D; -import javax.inject.Inject; -import javax.inject.Singleton; -import net.runelite.api.Point; -import net.runelite.client.ui.FontManager; -import net.runelite.client.ui.overlay.Overlay; -import net.runelite.client.ui.overlay.OverlayLayer; -import net.runelite.client.ui.overlay.OverlayPosition; -import net.runelite.client.ui.overlay.OverlayPriority; -import net.runelite.client.ui.overlay.OverlayUtil; - -@Singleton -public class PvpToolsOverlay extends Overlay -{ - private final PvpToolsPlugin pvpToolsPlugin; - - @Inject - private PvpToolsOverlay(final PvpToolsPlugin pvpToolsPlugin) - { - this.pvpToolsPlugin = pvpToolsPlugin; - setLayer(OverlayLayer.ABOVE_WIDGETS); - setPriority(OverlayPriority.HIGH); - setPosition(OverlayPosition.DYNAMIC); - } - - - @Override - public Dimension render(Graphics2D graphics) - { - if (pvpToolsPlugin.isFallInHelper() && pvpToolsPlugin.fallinHelperEnabled) - { - graphics.setFont(FontManager.getRunescapeFont().deriveFont(28)); - OverlayUtil.renderTextLocation(graphics, new Point(200, 80), "FALL IN HELPER ENABLED", Color.YELLOW); - } - return null; - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java index b601dde072..1332d1561a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pvptools/PvpToolsPlugin.java @@ -77,13 +77,9 @@ import org.apache.commons.lang3.ArrayUtils; @Singleton public class PvpToolsPlugin extends Plugin { - @Inject - PvpToolsOverlay pvpToolsOverlay; - @Inject PlayerCountOverlay playerCountOverlay; - boolean fallinHelperEnabled = false; private PvpToolsPanel panel; private MissingPlayersJFrame missingPlayersJFrame; private CurrentPlayersJFrame currentPlayersJFrame; @@ -154,7 +150,6 @@ public class PvpToolsPlugin extends Plugin private boolean countPlayers; private boolean countOverHeads; @Getter(AccessLevel.PACKAGE) - private boolean fallInHelper; private Keybind hotkey; private Keybind renderSelf; private boolean riskCalculatorEnabled; @@ -175,17 +170,6 @@ public class PvpToolsPlugin extends Plugin @Inject private PvpToolsConfig config; - /** - * The HotKeyListener for the hot key assigned in the config that triggers the Fall In Helper feature - */ - private final HotkeyListener fallinHotkeyListener = new HotkeyListener(() -> this.hotkey) - { - public void hotkeyPressed() - { - toggleFallinHelper(); - } - }; - private final HotkeyListener renderselfHotkeyListener = new HotkeyListener(() -> this.renderSelf) { public void hotkeyPressed() @@ -252,9 +236,7 @@ public class PvpToolsPlugin extends Plugin updateConfig(); addSubscriptions(); - overlayManager.add(pvpToolsOverlay); overlayManager.add(playerCountOverlay); - keyManager.registerKeyListener(fallinHotkeyListener); keyManager.registerKeyListener(renderselfHotkeyListener); final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "skull.png"); @@ -293,9 +275,7 @@ public class PvpToolsPlugin extends Plugin { eventBus.unregister(this); - overlayManager.remove(pvpToolsOverlay); overlayManager.remove(playerCountOverlay); - keyManager.unregisterKeyListener(fallinHotkeyListener); keyManager.unregisterKeyListener(renderselfHotkeyListener); clientToolbar.removeNavigation(navButton); @@ -443,26 +423,6 @@ public class PvpToolsPlugin extends Plugin } } - /** - * Enables or disables the fall in helper feature - */ - private void toggleFallinHelper() - { - if (!fallinHelperEnabled) - { - client.setIsHidingEntities(true); - client.setPlayersHidden(true); - fallinHelperEnabled = true; - } - else - { - client.setIsHidingEntities(false); - client.setPlayersHidden(false); - fallinHelperEnabled = false; - } - - } - /** * Updates the PvP Tools panel with the numbers for enemy protection prayers */ @@ -724,7 +684,6 @@ public class PvpToolsPlugin extends Plugin { this.countPlayers = config.countPlayers(); this.countOverHeads = config.countOverHeads(); - this.fallInHelper = config.fallInHelper(); this.hotkey = config.hotkey(); this.renderSelf = config.renderSelf(); this.riskCalculatorEnabled = config.riskCalculatorEnabled();