mes: add npc contact & hotkey description cleanup (#2255)

mes: add Npc Contact
This commit is contained in:
Kyle
2020-01-16 16:24:10 +00:00
committed by GitHub
parent d43524ae68
commit 47dcb4ba2a
2 changed files with 73 additions and 39 deletions

View File

@@ -1956,11 +1956,24 @@ public interface MenuEntrySwapperConfig extends Config
return ""; return "";
} }
@ConfigItem(
keyName = "swapNpcContact",
name = "NPC Contact",
description = "Enables Hotkey Left Click NPC Contact With Last Contacted NPC.",
position = 2,
section = "hotkeySwapping"
)
default boolean swapNpcContact()
{
return false;
}
@ConfigItem( @ConfigItem(
keyName = "bankWieldItem", keyName = "bankWieldItem",
name = "Bank - Left Click 'Wield'", name = "Bank - Left Click 'Wield'",
description = "Enables Hotkey Left Click 'Wield' In Bank When Pressing The Hotkey", description = "Enables Hotkey Left Click 'Wield' In The Bank Screen.",
position = 2, position = 3,
section = "hotkeySwapping" section = "hotkeySwapping"
) )
@@ -1972,8 +1985,8 @@ public interface MenuEntrySwapperConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "bankWearItem", keyName = "bankWearItem",
name = "Bank - Left Click 'Wear'", name = "Bank - Left Click 'Wear'",
description = "Enables Hotkey Left Click 'Wear' In Bank When Pressing The Hotkey", description = "Enables Hotkey Left Click 'Wear' In The Bank Screen.",
position = 3, position = 4,
section = "hotkeySwapping" section = "hotkeySwapping"
) )
@@ -1985,8 +1998,8 @@ public interface MenuEntrySwapperConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "bankEatItem", keyName = "bankEatItem",
name = "Bank - Left Click 'Eat'", name = "Bank - Left Click 'Eat'",
description = "Enables Left Click 'Eat' In Bank When Pressing The Hotkey", description = "Enables Left Click 'Eat' In The Bank Screen.",
position = 4, position = 5,
section = "hotkeySwapping" section = "hotkeySwapping"
) )
@@ -1998,8 +2011,8 @@ public interface MenuEntrySwapperConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "bankDrinkItem", keyName = "bankDrinkItem",
name = "Bank - Left Click 'Drink'", name = "Bank - Left Click 'Drink'",
description = "Enables Left Click 'Drink' In Bank When Pressing The Hotkey", description = "Enables Left Click 'Drink' In The Bank Screen.",
position = 5, position = 6,
section = "hotkeySwapping" section = "hotkeySwapping"
) )
@@ -2011,8 +2024,8 @@ public interface MenuEntrySwapperConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "bankEquipItem", keyName = "bankEquipItem",
name = "Bank - Left Click 'Equip'", name = "Bank - Left Click 'Equip'",
description = "Enables Left Click 'Equip' In Bank When Pressing The Hotkey", description = "Enables Left Click 'Equip' In The Bank Screen.",
position = 6, position = 7,
section = "hotkeySwapping" section = "hotkeySwapping"
) )
@@ -2024,8 +2037,8 @@ public interface MenuEntrySwapperConfig extends Config
@ConfigItem( @ConfigItem(
keyName = "bankInvigorateItem", keyName = "bankInvigorateItem",
name = "Bank - Left Click 'Invigorate'", name = "Bank - Left Click 'Invigorate'",
description = "Enables Left Click 'Invigorate' In Bank When Pressing The Hotkey", description = "Enables Left Click 'Invigorate' In The Bank Screen.",
position = 7, position = 8,
section = "hotkeySwapping" section = "hotkeySwapping"
) )

View File

@@ -144,6 +144,11 @@ public class MenuEntrySwapperPlugin extends Plugin
"miscellania", "grand exchange", "falador park", "dondakan's rock", "edgeville", "karamja", "miscellania", "grand exchange", "falador park", "dondakan's rock", "edgeville", "karamja",
"draynor village", "al kharid" "draynor village", "al kharid"
); );
private static final List<String> npcContact = Arrays.asList(
"honest jimmy", "bert the sandman", "advisor ghrim", "dark mage", "lanthus", "turael",
"mazchna", "vannaka", "chaeldar", "nieve", "steve", "duradel", "krystilia", "konar",
"murphy", "cyrisus", "smoggy", "ginea", "watson", "barbarian guard", "random"
);
private static final Splitter NEWLINE_SPLITTER = Splitter private static final Splitter NEWLINE_SPLITTER = Splitter
.on("\n") .on("\n")
@@ -266,6 +271,34 @@ public class MenuEntrySwapperPlugin extends Plugin
private boolean bankDrinkItem; private boolean bankDrinkItem;
private boolean bankEquipItem; private boolean bankEquipItem;
private boolean bankInvigorateItem; private boolean bankInvigorateItem;
private boolean swapNpcContact;
private boolean swapCoalBag;
private boolean swapContract;
private boolean swapEnchant;
private boolean swapHardWoodGrove;
private boolean swapHarpoon;
private boolean swapHouseAd;
private boolean swapImps;
private boolean swapInteract;
private boolean swapMax;
private boolean swapMetamorphosis;
private boolean swapMinigame;
private boolean swapNexus;
private boolean swapPay;
private boolean swapPick;
private boolean swapPickpocket;
private boolean swapPlank;
private boolean swapPrivate;
private boolean swapQuestCape;
private boolean swapQuick;
private boolean swapRogueschests;
private boolean swapSearch;
private boolean swapStun;
private boolean swapTeleportItem;
private boolean swapTrade;
private boolean swapTravel;
private boolean swapWildernessLever;
private boolean swapJewelleryBox;
private final HotkeyListener hotkey = new HotkeyListener(() -> this.hotkeyMod) private final HotkeyListener hotkey = new HotkeyListener(() -> this.hotkeyMod)
{ {
@Override @Override
@@ -298,33 +331,7 @@ public class MenuEntrySwapperPlugin extends Plugin
setControlActive(false); setControlActive(false);
} }
}; };
private boolean swapCoalBag;
private boolean swapContract;
private boolean swapEnchant;
private boolean swapHardWoodGrove;
private boolean swapHarpoon;
private boolean swapHouseAd;
private boolean swapImps;
private boolean swapInteract;
private boolean swapMax;
private boolean swapMetamorphosis;
private boolean swapMinigame;
private boolean swapNexus;
private boolean swapPay;
private boolean swapPick;
private boolean swapPickpocket;
private boolean swapPlank;
private boolean swapPrivate;
private boolean swapQuestCape;
private boolean swapQuick;
private boolean swapRogueschests;
private boolean swapSearch;
private boolean swapStun;
private boolean swapTeleportItem;
private boolean swapTrade;
private boolean swapTravel;
private boolean swapWildernessLever;
private boolean swapJewelleryBox;
@Provides @Provides
MenuEntrySwapperConfig provideConfig(ConfigManager configManager) MenuEntrySwapperConfig provideConfig(ConfigManager configManager)
@@ -1512,6 +1519,14 @@ public class MenuEntrySwapperPlugin extends Plugin
menuManager.addPriorityEntry("climb-up").setPriority(100); menuManager.addPriorityEntry("climb-up").setPriority(100);
} }
if (this.swapNpcContact)
{
for (String npccontact : npcContact)
{
menuManager.addPriorityEntry(npccontact, "npc contact");
}
}
eventBus.unregister(HOTKEY); eventBus.unregister(HOTKEY);
} }
@@ -1530,6 +1545,11 @@ public class MenuEntrySwapperPlugin extends Plugin
menuManager.removePriorityEntry(new BankComparableEntry("invigorate", "", false)); menuManager.removePriorityEntry(new BankComparableEntry("invigorate", "", false));
menuManager.removePriorityEntry("climb-up"); menuManager.removePriorityEntry("climb-up");
for (String npccontact : npcContact)
{
menuManager.removePriorityEntry(npccontact, "npc contact");
}
loadCustomSwaps("", customShiftSwaps); loadCustomSwaps("", customShiftSwaps);
eventBus.unregister(HOTKEY); eventBus.unregister(HOTKEY);
} }
@@ -1767,6 +1787,7 @@ public class MenuEntrySwapperPlugin extends Plugin
this.bankDrinkItem = config.bankDrinkItem(); this.bankDrinkItem = config.bankDrinkItem();
this.bankEquipItem = config.bankEquipItem(); this.bankEquipItem = config.bankEquipItem();
this.bankInvigorateItem = config.bankInvigorateItem(); this.bankInvigorateItem = config.bankInvigorateItem();
this.swapNpcContact = config.swapNpcContact();
} }
private void addBuySellEntries() private void addBuySellEntries()