Allow color tags in comparable options (fixes tanning and sawmill)
This commit is contained in:
@@ -42,7 +42,7 @@ public class BaseComparableEntry extends AbstractComparableEntry
|
||||
|
||||
public BaseComparableEntry(String option, String target, int id, int type, boolean strictOption, boolean strictTarget)
|
||||
{
|
||||
super.option = Text.standardize(option);
|
||||
super.option = option.trim().toLowerCase();
|
||||
super.target = Text.standardize(target);
|
||||
super.id = id;
|
||||
super.type = type;
|
||||
@@ -61,7 +61,7 @@ public class BaseComparableEntry extends AbstractComparableEntry
|
||||
|
||||
if (strictTarget || !Strings.isNullOrEmpty(target))
|
||||
{
|
||||
String tgt = entry.getStandardizedTarget();
|
||||
String tgt = Text.standardize(entry.getTarget(), true);
|
||||
|
||||
if (strictTarget && !tgt.equals(target) || !strictTarget && !tgt.contains(target))
|
||||
{
|
||||
|
||||
@@ -460,11 +460,7 @@ public class MenuManager
|
||||
}
|
||||
}
|
||||
|
||||
String target = event.getTarget();
|
||||
|
||||
// removes tags and level from player names for example:
|
||||
// <col=ffffff>username<col=40ff00> (level-42) or <col=ffffff><img=2>username</col>
|
||||
String username = Text.removeTags(target).split("[(]")[0].trim();
|
||||
String username = Text.removeTags(event.getTarget(), true);
|
||||
|
||||
PlayerMenuOptionClicked playerMenuOptionClicked = new PlayerMenuOptionClicked();
|
||||
playerMenuOptionClicked.setMenuOption(event.getOption());
|
||||
@@ -509,7 +505,7 @@ public class MenuManager
|
||||
*/
|
||||
public AbstractComparableEntry addPriorityEntry(String option, String target)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, target);
|
||||
@@ -521,7 +517,7 @@ public class MenuManager
|
||||
|
||||
public void removePriorityEntry(String option, String target)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, target);
|
||||
@@ -536,7 +532,7 @@ public class MenuManager
|
||||
*/
|
||||
public AbstractComparableEntry addPriorityEntry(String option)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, "", false);
|
||||
|
||||
@@ -547,7 +543,7 @@ public class MenuManager
|
||||
|
||||
public AbstractComparableEntry addPriorityEntry(String option, boolean strictOption)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
|
||||
AbstractComparableEntry entry =
|
||||
newBaseComparableEntry(option, "", -1, -1, false, strictOption);
|
||||
@@ -571,7 +567,7 @@ public class MenuManager
|
||||
|
||||
public void removePriorityEntry(String option)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, "", false);
|
||||
|
||||
@@ -580,7 +576,7 @@ public class MenuManager
|
||||
|
||||
public void removePriorityEntry(String option, boolean strictOption)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
|
||||
AbstractComparableEntry entry =
|
||||
newBaseComparableEntry(option, "", -1, -1, false, strictOption);
|
||||
@@ -606,10 +602,10 @@ public class MenuManager
|
||||
*/
|
||||
public void addSwap(String option, String target, String option2, String target2, boolean strictOption, boolean strictTarget)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
option2 = Text.standardize(option2);
|
||||
option2 = option2.trim().toLowerCase();
|
||||
target2 = Text.standardize(target2);
|
||||
|
||||
AbstractComparableEntry swapFrom = newBaseComparableEntry(option, target, -1, -1, strictOption, strictTarget);
|
||||
@@ -627,10 +623,10 @@ public class MenuManager
|
||||
|
||||
public void removeSwap(String option, String target, String option2, String target2, boolean strictOption, boolean strictTarget)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
option2 = Text.standardize(option2);
|
||||
option2 = option2.trim().toLowerCase();
|
||||
target2 = Text.standardize(target2);
|
||||
|
||||
AbstractComparableEntry swapFrom = newBaseComparableEntry(option, target, -1, -1, strictOption, strictTarget);
|
||||
@@ -672,10 +668,10 @@ public class MenuManager
|
||||
*/
|
||||
public void addSwap(String option, String target, int id, int type, String option2, String target2, int id2, int type2)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
option2 = Text.standardize(option2);
|
||||
option2 = option2.trim().toLowerCase();
|
||||
target2 = Text.standardize(target2);
|
||||
|
||||
AbstractComparableEntry swapFrom = newBaseComparableEntry(option, target, id, type, false, false);
|
||||
@@ -692,10 +688,10 @@ public class MenuManager
|
||||
|
||||
public void removeSwap(String option, String target, int id, int type, String option2, String target2, int id2, int type2)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
option2 = Text.standardize(option2);
|
||||
option2 = option2.trim().toLowerCase();
|
||||
target2 = Text.standardize(target2);
|
||||
|
||||
AbstractComparableEntry swapFrom = newBaseComparableEntry(option, target, id, type, false, false);
|
||||
@@ -724,7 +720,7 @@ public class MenuManager
|
||||
*/
|
||||
public void addHiddenEntry(String option, String target)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, target);
|
||||
@@ -734,7 +730,7 @@ public class MenuManager
|
||||
|
||||
public void removeHiddenEntry(String option, String target)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, target);
|
||||
@@ -748,7 +744,7 @@ public class MenuManager
|
||||
*/
|
||||
public void addHiddenEntry(String option)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, "", false);
|
||||
|
||||
@@ -757,7 +753,7 @@ public class MenuManager
|
||||
|
||||
public void removeHiddenEntry(String option)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, "", false);
|
||||
|
||||
@@ -769,7 +765,7 @@ public class MenuManager
|
||||
*/
|
||||
public void addHiddenEntry(String option, String target, boolean strictOption, boolean strictTarget)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, target, -1, -1, strictOption, strictTarget);
|
||||
@@ -779,7 +775,7 @@ public class MenuManager
|
||||
|
||||
public void removeHiddenEntry(String option, String target, boolean strictOption, boolean strictTarget)
|
||||
{
|
||||
option = Text.standardize(option);
|
||||
option = option.trim().toLowerCase();
|
||||
target = Text.standardize(target);
|
||||
|
||||
AbstractComparableEntry entry = newBaseComparableEntry(option, target, -1, -1, strictOption, strictTarget);
|
||||
|
||||
@@ -529,7 +529,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
final int eventId = event.getIdentifier();
|
||||
final String option = event.getOption().toLowerCase();
|
||||
final String target = event.getMenuEntry().getStandardizedTarget();
|
||||
final String target = Text.standardize(event.getTarget(), true);
|
||||
final NPC hintArrowNpc = client.getHintArrowNpc();
|
||||
|
||||
if (this.getRemoveObjects && !this.getRemovedObjects.equals(""))
|
||||
@@ -762,7 +762,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
if (this.getSwapTanning)
|
||||
{
|
||||
menuManager.addPriorityEntry("Tan All");
|
||||
menuManager.addPriorityEntry("Tan <col=ff7000>All");
|
||||
}
|
||||
|
||||
if (this.getSwapSawmill)
|
||||
@@ -773,7 +773,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
if (this.getSwapSawmillPlanks)
|
||||
{
|
||||
//Not much we can do for this one, Buy all is the only thing, there is no target.
|
||||
menuManager.addPriorityEntry("Buy All").setPriority(10);
|
||||
menuManager.addPriorityEntry("Buy <col=ff7000>All").setPriority(10);
|
||||
}
|
||||
|
||||
if (this.getSwapArdougneCape)
|
||||
|
||||
Reference in New Issue
Block a user