MES: add left click last destination (#2141)
MES: add left click last destination
This commit is contained in:
@@ -1706,6 +1706,18 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
return SlayerRingMode.CHECK;
|
return SlayerRingMode.CHECK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "swapJewelleryBox",
|
||||||
|
name = "Jewellery Box",
|
||||||
|
description = "Swap Teleport Menu with previous destination on Jewellery Box",
|
||||||
|
position = 31,
|
||||||
|
section = "teleportationSection"
|
||||||
|
)
|
||||||
|
default boolean swapJewelleryBox()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------//
|
//------------------------------------------------------------//
|
||||||
// Right Click Options
|
// Right Click Options
|
||||||
//------------------------------------------------------------//
|
//------------------------------------------------------------//
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import com.google.common.collect.ImmutableSet;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -136,38 +137,44 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
MenuOpcode.NPC_FIRST_OPTION, MenuOpcode.NPC_SECOND_OPTION, MenuOpcode.NPC_THIRD_OPTION,
|
MenuOpcode.NPC_FIRST_OPTION, MenuOpcode.NPC_SECOND_OPTION, MenuOpcode.NPC_THIRD_OPTION,
|
||||||
MenuOpcode.NPC_FOURTH_OPTION, MenuOpcode.NPC_FIFTH_OPTION, MenuOpcode.EXAMINE_NPC
|
MenuOpcode.NPC_FOURTH_OPTION, MenuOpcode.NPC_FIFTH_OPTION, MenuOpcode.EXAMINE_NPC
|
||||||
);
|
);
|
||||||
|
private static final List<String> jewelleryBox = Arrays.asList(
|
||||||
|
"duel arena", "castle wars", "clan wars", "burthorpe", "barbarian outpost", "corporeal beast",
|
||||||
|
"tears of guthix", "wintertodt camp", "warriors' guild", "champions' guild", "monastery", "ranging guild",
|
||||||
|
"fishing guild", "mining guild", "crafting guild", "cooking guild", "woodcutting guild", "farming guild",
|
||||||
|
"miscellania", "grand exchange", "falador park", "dondakan's rock", "edgeville", "karamja",
|
||||||
|
"draynor village", "al kharid"
|
||||||
|
);
|
||||||
|
|
||||||
private static final Splitter NEWLINE_SPLITTER = Splitter
|
private static final Splitter NEWLINE_SPLITTER = Splitter
|
||||||
.on("\n")
|
.on("\n")
|
||||||
.omitEmptyStrings()
|
.omitEmptyStrings()
|
||||||
.trimResults();
|
.trimResults();
|
||||||
|
private final Map<AbstractComparableEntry, Integer> customSwaps = new HashMap<>();
|
||||||
|
private final Map<AbstractComparableEntry, Integer> customShiftSwaps = new HashMap<>();
|
||||||
|
private final Map<AbstractComparableEntry, AbstractComparableEntry> dePrioSwaps = new HashMap<>();
|
||||||
|
// 1, 5, 10, 50
|
||||||
|
private final AbstractComparableEntry[][] buyEntries = new AbstractComparableEntry[4][];
|
||||||
|
private final AbstractComparableEntry[][] sellEntries = new AbstractComparableEntry[4][];
|
||||||
|
// 1, 5, 10, X, All
|
||||||
|
private final AbstractComparableEntry[][] withdrawEntries = new AbstractComparableEntry[5][];
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClientThread clientThread;
|
private ClientThread clientThread;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private MenuEntrySwapperConfig config;
|
private MenuEntrySwapperConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PluginManager pluginManager;
|
private PluginManager pluginManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private MenuManager menuManager;
|
private MenuManager menuManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private KeyManager keyManager;
|
private KeyManager keyManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PvpToolsPlugin pvpTools;
|
private PvpToolsPlugin pvpTools;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PvpToolsConfig pvpToolsConfig;
|
private PvpToolsConfig pvpToolsConfig;
|
||||||
|
|
||||||
private boolean buildingMode;
|
private boolean buildingMode;
|
||||||
private boolean inTobRaid = false;
|
private boolean inTobRaid = false;
|
||||||
private boolean inCoxRaid = false;
|
private boolean inCoxRaid = false;
|
||||||
@@ -175,16 +182,6 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
private boolean hotkeyActive;
|
private boolean hotkeyActive;
|
||||||
@Setter(AccessLevel.PRIVATE)
|
@Setter(AccessLevel.PRIVATE)
|
||||||
private boolean controlActive;
|
private boolean controlActive;
|
||||||
private final Map<AbstractComparableEntry, Integer> customSwaps = new HashMap<>();
|
|
||||||
private final Map<AbstractComparableEntry, Integer> customShiftSwaps = new HashMap<>();
|
|
||||||
private final Map<AbstractComparableEntry, AbstractComparableEntry> dePrioSwaps = new HashMap<>();
|
|
||||||
|
|
||||||
// 1, 5, 10, 50
|
|
||||||
private final AbstractComparableEntry[][] buyEntries = new AbstractComparableEntry[4][];
|
|
||||||
private final AbstractComparableEntry[][] sellEntries = new AbstractComparableEntry[4][];
|
|
||||||
// 1, 5, 10, X, All
|
|
||||||
private final AbstractComparableEntry[][] withdrawEntries = new AbstractComparableEntry[5][];
|
|
||||||
|
|
||||||
private String[] removedObjects;
|
private String[] removedObjects;
|
||||||
|
|
||||||
private List<String> bankItemNames = new ArrayList<>();
|
private List<String> bankItemNames = new ArrayList<>();
|
||||||
@@ -263,6 +260,38 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
private boolean swapBoxTrap;
|
private boolean swapBoxTrap;
|
||||||
private boolean swapChase;
|
private boolean swapChase;
|
||||||
private boolean swapClimbUpDown;
|
private boolean swapClimbUpDown;
|
||||||
|
private final HotkeyListener hotkey = new HotkeyListener(() -> this.hotkeyMod)
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void hotkeyPressed()
|
||||||
|
{
|
||||||
|
startHotkey();
|
||||||
|
setHotkeyActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hotkeyReleased()
|
||||||
|
{
|
||||||
|
stopHotkey();
|
||||||
|
setHotkeyActive(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private final HotkeyListener ctrlHotkey = new HotkeyListener(() -> Keybind.CTRL)
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void hotkeyPressed()
|
||||||
|
{
|
||||||
|
startControl();
|
||||||
|
setControlActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void hotkeyReleased()
|
||||||
|
{
|
||||||
|
stopControl();
|
||||||
|
setControlActive(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
private boolean swapCoalBag;
|
private boolean swapCoalBag;
|
||||||
private boolean swapContract;
|
private boolean swapContract;
|
||||||
private boolean swapEnchant;
|
private boolean swapEnchant;
|
||||||
@@ -289,6 +318,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
private boolean swapTrade;
|
private boolean swapTrade;
|
||||||
private boolean swapTravel;
|
private boolean swapTravel;
|
||||||
private boolean swapWildernessLever;
|
private boolean swapWildernessLever;
|
||||||
|
private boolean swapJewelleryBox;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
MenuEntrySwapperConfig provideConfig(ConfigManager configManager)
|
MenuEntrySwapperConfig provideConfig(ConfigManager configManager)
|
||||||
@@ -1179,6 +1209,14 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
menuManager.addPriorityEntry(new GrimyHerbComparableEntry(this.swapGrimyHerbMode, client));
|
menuManager.addPriorityEntry(new GrimyHerbComparableEntry(this.swapGrimyHerbMode, client));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.swapJewelleryBox)
|
||||||
|
{
|
||||||
|
for (String jewellerybox : jewelleryBox)
|
||||||
|
{
|
||||||
|
menuManager.addPriorityEntry(jewellerybox);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeSwaps()
|
private void removeSwaps()
|
||||||
@@ -1301,6 +1339,10 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
menuManager.removePriorityEntry(this.questCapeMode.toString(), "quest point cape");
|
menuManager.removePriorityEntry(this.questCapeMode.toString(), "quest point cape");
|
||||||
menuManager.removePriorityEntry(this.swapHouseAdMode.getEntry());
|
menuManager.removePriorityEntry(this.swapHouseAdMode.getEntry());
|
||||||
menuManager.removeSwap("Bury", "bone", "Use");
|
menuManager.removeSwap("Bury", "bone", "Use");
|
||||||
|
for (String jewellerybox : jewelleryBox)
|
||||||
|
{
|
||||||
|
menuManager.removePriorityEntry(jewellerybox);
|
||||||
|
}
|
||||||
|
|
||||||
switch (this.swapFairyRingMode)
|
switch (this.swapFairyRingMode)
|
||||||
{
|
{
|
||||||
@@ -1369,6 +1411,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
menuManager.removePriorityEntry("Friend's house");
|
menuManager.removePriorityEntry("Friend's house");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isPuroPuro()
|
private boolean isPuroPuro()
|
||||||
@@ -1663,6 +1706,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
this.swapWildernessLever = config.swapWildernessLever();
|
this.swapWildernessLever = config.swapWildernessLever();
|
||||||
this.swapHouseAd = config.swapHouseAd();
|
this.swapHouseAd = config.swapHouseAd();
|
||||||
this.swapHouseAdMode = config.swapHouseAdMode();
|
this.swapHouseAdMode = config.swapHouseAdMode();
|
||||||
|
this.swapJewelleryBox = config.swapJewelleryBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addBuySellEntries()
|
private void addBuySellEntries()
|
||||||
@@ -1917,38 +1961,4 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
removedObjects = null;
|
removedObjects = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final HotkeyListener hotkey = new HotkeyListener(() -> this.hotkeyMod)
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void hotkeyPressed()
|
|
||||||
{
|
|
||||||
startHotkey();
|
|
||||||
setHotkeyActive(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void hotkeyReleased()
|
|
||||||
{
|
|
||||||
stopHotkey();
|
|
||||||
setHotkeyActive(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private final HotkeyListener ctrlHotkey = new HotkeyListener(() -> Keybind.CTRL)
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void hotkeyPressed()
|
|
||||||
{
|
|
||||||
startControl();
|
|
||||||
setControlActive(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void hotkeyReleased()
|
|
||||||
{
|
|
||||||
stopControl();
|
|
||||||
setControlActive(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user