pvptools: fix attack/cast hidden options (#986)

* pvptools: fix attack/cast options

* menuentryswapper: fix tob/cox hide cast options

* menuentryswapper: fix hide cast options in raids

* menuentryswapper: add plugin dependency

* pvptools: add pvp world/wilderness check

* menuentryswapper: fix hiding cast when enabling config setting

* menuentryswapper: fix checkstyle
This commit is contained in:
se7enAte9
2019-07-15 03:30:24 -04:00
committed by Kyleeld
parent b53c3bb1f7
commit ef6ea5b18f
6 changed files with 424 additions and 103 deletions

View File

@@ -208,9 +208,15 @@ public abstract class RSClientMixin implements RSClient
@Inject
private static boolean hideFriendAttackOptions = false;
@Inject
private static boolean hideClanmateAttackOptions = false;
@Inject
private static boolean hideFriendCastOptions = false;
@Inject
private static boolean hideClanmateCastOptions = false;
@Inject
private static Set<String> unhiddenCasts = new HashSet<String>();
@@ -228,6 +234,20 @@ public abstract class RSClientMixin implements RSClient
hideFriendCastOptions = yes;
}
@Inject
@Override
public void setHideClanmateAttackOptions(boolean yes)
{
hideClanmateAttackOptions = yes;
}
@Inject
@Override
public void setHideClanmateCastOptions(boolean yes)
{
hideClanmateCastOptions = yes;
}
@Inject
@Override
public void setUnhiddenCasts(Set<String> casts)
@@ -1644,12 +1664,11 @@ public abstract class RSClientMixin implements RSClient
{
if (client.isSpellSelected())
{
return hideFriendCastOptions
&& (p.isFriended() || p.isClanMember())
&& !unhiddenCasts.contains(client.getSelectedSpellName());
return ((hideFriendCastOptions && p.isFriended()) || (hideClanmateCastOptions && p.isClanMember()))
&& !unhiddenCasts.contains(client.getSelectedSpellName().replaceAll("<[^>]*>", "").toLowerCase());
}
return hideFriendAttackOptions && (p.isFriended() || p.isClanMember());
return ((hideFriendAttackOptions && p.isFriended()) || (hideClanmateAttackOptions && p.isClanMember()));
}
@Inject