Remove left click calling from BA plugin
Being able to spam left click without paying attention to what actually needs to be called is overpowered. Until we come up with something better (like binding the different calls to Ctrl, Alt, Ctrl+Alt) we shouldn't offer this particular feature
This commit is contained in:
@@ -35,16 +35,6 @@ import net.runelite.client.config.ConfigItem;
|
||||
)
|
||||
public interface BarbarianAssaultConfig extends Config
|
||||
{
|
||||
@ConfigItem(
|
||||
keyName = "removeUnused",
|
||||
name = "Remove incorrect calls",
|
||||
description = "Removes incorrect calls for Role horn"
|
||||
)
|
||||
default boolean removeWrong()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "showTimer",
|
||||
name = "Show call change timer",
|
||||
|
||||
@@ -39,11 +39,8 @@ import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
@@ -111,39 +108,6 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onMenuOpen(MenuEntryAdded event)
|
||||
{
|
||||
if (config.removeWrong() && overlay.getCurrentRound() != null && event.getTarget().endsWith("horn"))
|
||||
{
|
||||
MenuEntry[] menuEntries = client.getMenuEntries();
|
||||
WidgetInfo callInfo = overlay.getCurrentRound().getRoundRole().getCall();
|
||||
Widget callWidget = client.getWidget(callInfo);
|
||||
String call = Calls.getOption(callWidget.getText());
|
||||
MenuEntry correctCall = null;
|
||||
|
||||
entries.clear();
|
||||
for (MenuEntry entry : menuEntries)
|
||||
{
|
||||
String option = entry.getOption();
|
||||
if (option.equals(call))
|
||||
{
|
||||
correctCall = entry;
|
||||
}
|
||||
else if (!option.startsWith("Tell-"))
|
||||
{
|
||||
entries.add(entry);
|
||||
}
|
||||
}
|
||||
|
||||
if (correctCall != null)
|
||||
{
|
||||
entries.add(correctCall);
|
||||
client.setMenuEntries(entries.toArray(new MenuEntry[entries.size()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onVarbitChange(VarbitChanged event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user