Merge pull request #1093 from Kyleeld/fallinremove

PvPTools: Remove fallinhelper
This commit is contained in:
Tyler Bochard
2019-07-24 01:20:12 -04:00
committed by GitHub
3 changed files with 9 additions and 124 deletions

View File

@@ -39,33 +39,11 @@ public interface PvpToolsConfig extends Config
return true; return true;
} }
@ConfigItem(
keyName = "fallInHelper",
name = "Fall In Helper",
description = "Hides all non-friendly player entities other than the one that is attacking you.",
position = 2
)
default boolean fallInHelper()
{
return true;
}
@ConfigItem(
keyName = "hotkey",
name = "Fall In Hotkey",
description = "Turns the fall in helper on or off when you press this hotkey",
position = 3
)
default Keybind hotkey()
{
return Keybind.NOT_SET;
}
@ConfigItem( @ConfigItem(
keyName = "renderSelfHotkey", keyName = "renderSelfHotkey",
name = "Render Self Hotkey", name = "Render Self Hotkey",
description = "Toggles renderself when you press the hotkey", description = "Toggles renderself when you press the hotkey",
position = 4 position = 2
) )
default Keybind renderSelf() default Keybind renderSelf()
{ {
@@ -76,7 +54,7 @@ public interface PvpToolsConfig extends Config
keyName = "hideAttack", keyName = "hideAttack",
name = "Hide attack", name = "Hide attack",
description = "Hides the attack option for clanmates, friends, or both", description = "Hides the attack option for clanmates, friends, or both",
position = 5 position = 3
) )
default boolean hideAttack() default boolean hideAttack()
{ {
@@ -87,7 +65,7 @@ public interface PvpToolsConfig extends Config
keyName = "hideAttackMode", keyName = "hideAttackMode",
name = "Mode", name = "Mode",
description = "", description = "",
position = 6, position = 4,
hidden = true, hidden = true,
unhide = "hideAttack" unhide = "hideAttack"
) )
@@ -100,7 +78,7 @@ public interface PvpToolsConfig extends Config
keyName = "hideCast", keyName = "hideCast",
name = "Hide cast", name = "Hide cast",
description = "Hides the cast option for clanmates, friends, or both", description = "Hides the cast option for clanmates, friends, or both",
position = 7 position = 5
) )
default boolean hideCast() default boolean hideCast()
{ {
@@ -111,7 +89,7 @@ public interface PvpToolsConfig extends Config
keyName = "hideCastMode", keyName = "hideCastMode",
name = "Mode", name = "Mode",
description = "", description = "",
position = 8, position = 6,
hidden = true, hidden = true,
unhide = "hideCast" unhide = "hideCast"
) )
@@ -124,7 +102,7 @@ public interface PvpToolsConfig extends Config
keyName = "hideCastIgnored", keyName = "hideCastIgnored",
name = "Ignored spells", name = "Ignored spells",
description = "Spells that should not be hidden from being cast, separated by a comma", description = "Spells that should not be hidden from being cast, separated by a comma",
position = 9, position = 7,
hidden = true, hidden = true,
unhide = "hideCast" unhide = "hideCast"
) )
@@ -137,7 +115,7 @@ public interface PvpToolsConfig extends Config
keyName = "riskCalculator", keyName = "riskCalculator",
name = "Risk Calculator", name = "Risk Calculator",
description = "Enables a panel in the PvP Tools Panel that shows the players current risk", description = "Enables a panel in the PvP Tools Panel that shows the players current risk",
position = 10 position = 8
) )
default boolean riskCalculatorEnabled() default boolean riskCalculatorEnabled()
{ {
@@ -148,7 +126,7 @@ public interface PvpToolsConfig extends Config
keyName = "missingPlayers", keyName = "missingPlayers",
name = "Missing CC Players", name = "Missing CC Players",
description = "Adds a button to the PvP Tools panel that opens a window showing which CC members are not at the current players location", description = "Adds a button to the PvP Tools panel that opens a window showing which CC members are not at the current players location",
position = 11 position = 9
) )
default boolean missingPlayersEnabled() default boolean missingPlayersEnabled()
{ {
@@ -159,7 +137,7 @@ public interface PvpToolsConfig extends Config
keyName = "currentPlayers", keyName = "currentPlayers",
name = "Current CC Players", name = "Current CC Players",
description = "Adds a button to the PvP Tools panel that opens a window showing which CC members currently at the players location", description = "Adds a button to the PvP Tools panel that opens a window showing which CC members currently at the players location",
position = 12 position = 10
) )
default boolean currentPlayersEnabled() default boolean currentPlayersEnabled()
{ {

View File

@@ -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;
}
}

View File

@@ -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,8 +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 renderSelf; private Keybind renderSelf;
private boolean riskCalculatorEnabled; private boolean riskCalculatorEnabled;
private boolean missingPlayersEnabled; private boolean missingPlayersEnabled;
@@ -175,17 +169,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 +235,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 +274,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 +422,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,8 +683,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.renderSelf = config.renderSelf(); this.renderSelf = config.renderSelf();
this.riskCalculatorEnabled = config.riskCalculatorEnabled(); this.riskCalculatorEnabled = config.riskCalculatorEnabled();
this.missingPlayersEnabled = config.missingPlayersEnabled(); this.missingPlayersEnabled = config.missingPlayersEnabled();