Refactor L2C

This commit is contained in:
Scott Burns
2019-05-16 00:54:09 +02:00
parent b46794cc76
commit 21f3f55b60
2 changed files with 25 additions and 9 deletions

View File

@@ -31,30 +31,47 @@ import net.runelite.client.config.ConfigItem;
@ConfigGroup("learntoclick")
public interface LearnToClickConfig extends Config
{
@ConfigItem(position = 1, keyName = "blockCompass", name = "Compass", description = "Prevents the camera from moving when you misclick on the compass")
@ConfigItem(
position = 1,
keyName = "blockCompass",
name = "Compass",
description = "Prevents the camera from moving when you misclick on the compass"
)
default boolean shouldBlockCompass()
{
return false;
}
@ConfigItem(position = 2, keyName = "rightClickMap", name = "World Map", description = "Prevents the world map from opening on left click without disabling it entirely")
@ConfigItem(
position = 2,
keyName = "rightClickMap",
name = "World Map",
description = "Prevents the world map from opening on left click without disabling it entirely"
)
default boolean shouldRightClickMap()
{
return false;
}
@ConfigItem(position = 3, keyName = "rightClickXp", name = "Xp Drops Toggle", description = "Prevents toggling xp drops on left click without disabling the toggle function entirely")
@ConfigItem(
position = 3,
keyName = "rightClickXp",
name = "Xp Drops Toggle",
description = "Prevents toggling xp drops on left click without disabling the toggle function entirely"
)
default boolean shouldRightClickXp()
{
return false;
}
@ConfigItem(position = 4, keyName = "rightClickRetaliate", name = "Auto Retaliate", description = "Prevents toggling auto retaliate on left click without disabling the toggle function entirely")
@ConfigItem(
position = 4,
keyName = "rightClickRetaliate",
name = "Auto Retaliate",
description = "Prevents toggling auto retaliate on left click without disabling the toggle function entirely"
)
default boolean shouldRightClickRetaliate()
{
return false;
}
}

View File

@@ -38,7 +38,6 @@ public class LearnToClickPlugin extends Plugin
@Inject
private LearnToClickConfig config;
private boolean forceRightClickFlag;
private MenuEntry[] entries;
@Inject
private Client client;
@@ -86,7 +85,7 @@ public class LearnToClickPlugin extends Plugin
{
forceRightClickFlag = true;
}
entries = client.getMenuEntries();
MenuEntry[] entries = client.getMenuEntries();
if (config.shouldBlockCompass())
{
for (int i = entries.length - 1; i >= 0; i--)