Removes the hotkey & attack option hiding

Removes the hotkey and makes attack option hiding much more certain
This commit is contained in:
Kyleeld
2019-04-25 21:50:59 +01:00
committed by GitHub
parent 071ccdbe24
commit 7671e61cf3
2 changed files with 803 additions and 840 deletions

View File

@@ -88,18 +88,6 @@ public interface PvpToolsConfig extends Config
return false; return false;
} }
@ConfigItem(
keyName = "attackOptionsHotkey",
name = "Attack Option Hotkey",
description = "Enables a hotkey for attack options to disable or enable hiding quickly",
position = 10,
group = "Right-Click Attack Options"
)
default Keybind attackOptionsHotkey()
{
return Keybind.CTRL;
}
@ConfigItem( @ConfigItem(
keyName = "levelRangeAttackOptions", keyName = "levelRangeAttackOptions",
name = "Moves Other Attack Options", name = "Moves Other Attack Options",

View File

@@ -166,25 +166,6 @@ public class PvpToolsPlugin extends Plugin
} }
}; };
private final HotkeyListener attackOptionsHotKeyListener = new HotkeyListener(() -> config.attackOptionsHotkey())
{
long lastPress = 0;
@Override
public void keyPressed(KeyEvent e)
{
attackHotKeyPressed = true;
}
@Override
public void keyReleased(KeyEvent e)
{
attackHotKeyPressed = (System.currentTimeMillis() - lastPress) < 800;
lastPress = System.currentTimeMillis();
}
};
private int[] overheadCount = new int[]{0, 0, 0}; private int[] overheadCount = new int[]{0, 0, 0};
private Comparator<Item> itemPriceComparator = new Comparator<Item>() private Comparator<Item> itemPriceComparator = new Comparator<Item>()
@@ -196,6 +177,7 @@ public class PvpToolsPlugin extends Plugin
- itemManager.getItemPrice(itemManager.getItemComposition(o2.getId()).getPrice())); - itemManager.getItemPrice(itemManager.getItemComposition(o2.getId()).getPrice()));
} }
}; };
private String mtarget; private String mtarget;
public List getMissingMembers() public List getMissingMembers()
@@ -280,8 +262,6 @@ public class PvpToolsPlugin extends Plugin
clientToolbar.addNavigation(navButton); clientToolbar.addNavigation(navButton);
keyManager.registerKeyListener(attackOptionsHotKeyListener);
if (config.missingPlayersEnabled()) if (config.missingPlayersEnabled())
{ {
panel.missingPlayers.setVisible(true); panel.missingPlayers.setVisible(true);
@@ -298,7 +278,6 @@ public class PvpToolsPlugin extends Plugin
{ {
overlayManager.remove(pvpToolsOverlay); overlayManager.remove(pvpToolsOverlay);
keyManager.unregisterKeyListener(hotkeyListener); keyManager.unregisterKeyListener(hotkeyListener);
keyManager.unregisterKeyListener(attackOptionsHotKeyListener);
clientToolbar.removeNavigation(navButton); clientToolbar.removeNavigation(navButton);
} }
@@ -412,8 +391,6 @@ public class PvpToolsPlugin extends Plugin
@Subscribe @Subscribe
public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded) public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded)
{ {
if (!attackHotKeyPressed)
{
if (config.attackOptionsFriend() || config.attackOptionsClan() || config.levelRangeAttackOptions()) if (config.attackOptionsFriend() || config.attackOptionsClan() || config.levelRangeAttackOptions())
{ {
if (client.getGameState() != GameState.LOGGED_IN) if (client.getGameState() != GameState.LOGGED_IN)
@@ -450,10 +427,8 @@ public class PvpToolsPlugin extends Plugin
} }
} }
} }
}
} }
private void moveEntry(String mtarget) private void moveEntry(String mtarget)
{ {
this.mtarget = mtarget; this.mtarget = mtarget;