Merge pull request #1327 from Ganom/fix-equipment-swaps
menuentryswapper: add equipment swaps, and use them to fix swaps.
This commit is contained in:
@@ -19,6 +19,7 @@ public class BankComparableEntry extends AbstractComparableEntry
|
||||
public boolean matches(MenuEntry entry)
|
||||
{
|
||||
final int groupId = WidgetInfo.TO_GROUP(entry.getParam1());
|
||||
|
||||
if (groupId != WidgetID.BANK_GROUP_ID && groupId != WidgetID.BANK_INVENTORY_GROUP_ID)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.runelite.client.plugins.menuentryswapper;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.menus.AbstractComparableEntry;
|
||||
import net.runelite.client.util.Text;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EquipmentComparableEntry extends AbstractComparableEntry
|
||||
{
|
||||
public EquipmentComparableEntry(String option, String itemName)
|
||||
{
|
||||
this.setOption(Text.standardize(option));
|
||||
this.setTarget(Text.standardize(itemName));
|
||||
}
|
||||
|
||||
public boolean matches(MenuEntry entry)
|
||||
{
|
||||
final int groupId = WidgetInfo.TO_GROUP(entry.getParam1());
|
||||
|
||||
if (groupId != WidgetID.EQUIPMENT_GROUP_ID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return StringUtils.equalsIgnoreCase(entry.getOption(), this.getOption())
|
||||
&& Text.standardize(entry.getTarget()).contains(this.getTarget());
|
||||
}
|
||||
}
|
||||
@@ -1124,8 +1124,8 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
if (this.getSwapConstructionCape)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.constructionCapeMode.toString(), "Construct. cape");
|
||||
menuManager.addPriorityEntry(this.constructionCapeMode.toString(), "Construct. cape(t)");
|
||||
menuManager.addPriorityEntry(this.constructionCapeMode.toString(), "Construct. cape").setPriority(100);
|
||||
menuManager.addPriorityEntry(this.constructionCapeMode.toString(), "Construct. cape(t)").setPriority(100);
|
||||
}
|
||||
|
||||
if (this.getSwapMagicCape)
|
||||
@@ -1360,7 +1360,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
menuManager.addPriorityEntry("Configure", "Fairy ring");
|
||||
break;
|
||||
case LAST_DESTINATION:
|
||||
menuManager.addPriorityEntry("Last-destination");
|
||||
menuManager.addPriorityEntry("Last-destination", "Fairy ring");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1407,54 +1407,52 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
if (this.getCombatBracelet)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getCombatBraceletMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getCombatBraceletMode.toString(), "combat bracelet"));
|
||||
}
|
||||
|
||||
if (this.getGamesNecklace)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getGamesNecklaceMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getGamesNecklaceMode.toString(), "games necklace"));
|
||||
}
|
||||
|
||||
if (this.getDuelingRing)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getDuelingRingMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getDuelingRingMode.toString(), "ring of dueling"));
|
||||
}
|
||||
|
||||
if (this.getGlory)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getGloryMode.toString());
|
||||
menuManager.addPriorityEntry(this.getGloryMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getGloryMode.toString(), "glory"));
|
||||
}
|
||||
|
||||
if (this.getSkillsNecklace)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getSkillsNecklaceMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getSkillsNecklaceMode.toString(), "skills necklace"));
|
||||
}
|
||||
|
||||
if (this.getNecklaceofPassage)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getNecklaceofPassageMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getNecklaceofPassageMode.toString(), "necklace of passage"));
|
||||
}
|
||||
|
||||
if (this.getDigsitePendant)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getDigsitePendantMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getDigsitePendantMode.toString(), "digsite pendant"));
|
||||
}
|
||||
|
||||
if (this.getSlayerRing)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getSlayerRingMode.toString());
|
||||
menuManager.addPriorityEntry(this.getSlayerRingMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getSlayerRingMode.toString(), "slayer ring"));
|
||||
}
|
||||
|
||||
if (this.getXericsTalisman)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getXericsTalismanMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getXericsTalismanMode.toString(), "talisman"));
|
||||
}
|
||||
|
||||
if (this.getRingofWealth)
|
||||
{
|
||||
menuManager.addPriorityEntry(this.getRingofWealthMode.toString());
|
||||
menuManager.addPriorityEntry(new EquipmentComparableEntry(this.getRingofWealthMode.toString(), "ring of wealth"));
|
||||
}
|
||||
|
||||
if (this.swapMax)
|
||||
@@ -1937,4 +1935,4 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
this.hideCastCoX = config.hideCastCoX();
|
||||
this.hideCastIgnoredCoX = Sets.newHashSet(Text.fromCSV(config.hideCastIgnoredCoX().toLowerCase()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user