PvPTools: Remove fallinhelper
PvPTools: Remove fallinhelper was unused, causing crashes
This commit is contained in:
@@ -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) <stonewall@thots.cc.usa>, 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -77,13 +77,9 @@ import org.apache.commons.lang3.ArrayUtils;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class PvpToolsPlugin extends Plugin
|
public class PvpToolsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
|
||||||
PvpToolsOverlay pvpToolsOverlay;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PlayerCountOverlay playerCountOverlay;
|
PlayerCountOverlay playerCountOverlay;
|
||||||
|
|
||||||
boolean fallinHelperEnabled = false;
|
|
||||||
private PvpToolsPanel panel;
|
private PvpToolsPanel panel;
|
||||||
private MissingPlayersJFrame missingPlayersJFrame;
|
private MissingPlayersJFrame missingPlayersJFrame;
|
||||||
private CurrentPlayersJFrame currentPlayersJFrame;
|
private CurrentPlayersJFrame currentPlayersJFrame;
|
||||||
@@ -154,7 +150,6 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
private boolean countPlayers;
|
private boolean countPlayers;
|
||||||
private boolean countOverHeads;
|
private boolean countOverHeads;
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private boolean fallInHelper;
|
|
||||||
private Keybind hotkey;
|
private Keybind hotkey;
|
||||||
private Keybind renderSelf;
|
private Keybind renderSelf;
|
||||||
private boolean riskCalculatorEnabled;
|
private boolean riskCalculatorEnabled;
|
||||||
@@ -175,17 +170,6 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private PvpToolsConfig config;
|
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)
|
private final HotkeyListener renderselfHotkeyListener = new HotkeyListener(() -> this.renderSelf)
|
||||||
{
|
{
|
||||||
public void hotkeyPressed()
|
public void hotkeyPressed()
|
||||||
@@ -252,9 +236,7 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
updateConfig();
|
updateConfig();
|
||||||
addSubscriptions();
|
addSubscriptions();
|
||||||
|
|
||||||
overlayManager.add(pvpToolsOverlay);
|
|
||||||
overlayManager.add(playerCountOverlay);
|
overlayManager.add(playerCountOverlay);
|
||||||
keyManager.registerKeyListener(fallinHotkeyListener);
|
|
||||||
keyManager.registerKeyListener(renderselfHotkeyListener);
|
keyManager.registerKeyListener(renderselfHotkeyListener);
|
||||||
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "skull.png");
|
final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "skull.png");
|
||||||
|
|
||||||
@@ -293,9 +275,7 @@ public class PvpToolsPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
eventBus.unregister(this);
|
eventBus.unregister(this);
|
||||||
|
|
||||||
overlayManager.remove(pvpToolsOverlay);
|
|
||||||
overlayManager.remove(playerCountOverlay);
|
overlayManager.remove(playerCountOverlay);
|
||||||
keyManager.unregisterKeyListener(fallinHotkeyListener);
|
|
||||||
keyManager.unregisterKeyListener(renderselfHotkeyListener);
|
keyManager.unregisterKeyListener(renderselfHotkeyListener);
|
||||||
clientToolbar.removeNavigation(navButton);
|
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
|
* 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.countPlayers = config.countPlayers();
|
||||||
this.countOverHeads = config.countOverHeads();
|
this.countOverHeads = config.countOverHeads();
|
||||||
this.fallInHelper = config.fallInHelper();
|
|
||||||
this.hotkey = config.hotkey();
|
this.hotkey = config.hotkey();
|
||||||
this.renderSelf = config.renderSelf();
|
this.renderSelf = config.renderSelf();
|
||||||
this.riskCalculatorEnabled = config.riskCalculatorEnabled();
|
this.riskCalculatorEnabled = config.riskCalculatorEnabled();
|
||||||
|
|||||||
Reference in New Issue
Block a user