Add rank icons back to menu entries
Signed-off-by: PKLite <stonewall@pklite.xyz> (cherry picked from commit f42fbd5624f14169309541f520e00dbe747395a2)
This commit is contained in:
@@ -134,7 +134,7 @@ public class PlayerIndicatorsOverlay extends Overlay
|
||||
}
|
||||
OverlayUtil.renderActorTextAndImage(graphics, actor, builtString, color,
|
||||
ImageUtil.resizeImage(Objects.requireNonNull(clanManager.getClanImage(clanManager.getRank(actor.getName()))), y, y)
|
||||
,x + ACTOR_HORIZONTAL_TEXT_MARGIN, 0);
|
||||
,0,ACTOR_HORIZONTAL_TEXT_MARGIN);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -63,6 +63,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.client.util.PvPUtil;
|
||||
import net.runelite.http.api.hiscore.HiscoreClient;
|
||||
import net.runelite.http.api.hiscore.HiscoreResult;
|
||||
@@ -307,74 +308,78 @@ public class PlayerIndicatorsPlugin extends Plugin
|
||||
{
|
||||
image = clanManager.getIconNumber(rank);
|
||||
}
|
||||
}
|
||||
else if (this.highlightTeam && player.getTeam() > 0 && (localPlayer != null ? localPlayer.getTeam() : -1) == player.getTeam())
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.TEAM)).contains(PlayerIndicationLocation.MENU))
|
||||
else if (this.highlightTeam && player.getTeam() > 0 && (localPlayer != null ? localPlayer.getTeam() : -1) == player.getTeam())
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.TEAM);
|
||||
}
|
||||
}
|
||||
else if (this.highlightOther && !player.isClanMember() && !player.isFriend() && !PvPUtil.isAttackable(client, player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.OTHER)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.OTHER);
|
||||
}
|
||||
}
|
||||
else if (this.highlightTargets && !player.isClanMember() && !client.isFriended(player.getName(),
|
||||
false) && PvPUtil.isAttackable(client, player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.TARGET)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.TARGET);
|
||||
}
|
||||
}
|
||||
else if (this.highlightCallers && isCaller(player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.CALLER)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.CALLER);
|
||||
}
|
||||
}
|
||||
else if (this.highlightCallerTargets && isPile(player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.CALLER_TARGET)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.CALLER_TARGET);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.playerSkull && !player.isClanMember() && player.getSkullIcon() != null)
|
||||
{
|
||||
image2 = 35;
|
||||
}
|
||||
|
||||
if (image != -1 || color != null)
|
||||
{
|
||||
final MenuEntry[] menuEntries = client.getMenuEntries();
|
||||
final MenuEntry lastEntry = menuEntries[menuEntries.length - 1];
|
||||
|
||||
|
||||
if (color != null)
|
||||
{
|
||||
// strip out existing <col...
|
||||
String target = lastEntry.getTarget();
|
||||
final int idx = target.indexOf('>');
|
||||
if (idx != -1)
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.TEAM)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
target = target.substring(idx + 1);
|
||||
color = relationColorHashMap.get(PlayerRelation.TEAM);
|
||||
}
|
||||
}
|
||||
else if (this.highlightOther && !player.isClanMember() && !player.isFriend() && !PvPUtil.isAttackable(client, player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.OTHER)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.OTHER);
|
||||
}
|
||||
}
|
||||
else if (this.highlightTargets && !player.isClanMember() && !client.isFriended(player.getName(),
|
||||
false) && PvPUtil.isAttackable(client, player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.TARGET)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.TARGET);
|
||||
}
|
||||
}
|
||||
else if (this.highlightCallers && isCaller(player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.CALLER)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.CALLER);
|
||||
}
|
||||
}
|
||||
else if (this.highlightCallerTargets && isPile(player))
|
||||
{
|
||||
if (Arrays.asList(this.locationHashMap.get(PlayerRelation.CALLER_TARGET)).contains(PlayerIndicationLocation.MENU))
|
||||
{
|
||||
color = relationColorHashMap.get(PlayerRelation.CALLER_TARGET);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.playerSkull && !player.isClanMember() && player.getSkullIcon() != null)
|
||||
{
|
||||
image2 = 35;
|
||||
}
|
||||
|
||||
if (image != -1 || color != null)
|
||||
{
|
||||
final MenuEntry[] menuEntries = client.getMenuEntries();
|
||||
final MenuEntry lastEntry = menuEntries[menuEntries.length - 1];
|
||||
|
||||
|
||||
if (color != null)
|
||||
{
|
||||
// strip out existing <col...
|
||||
String target = lastEntry.getTarget();
|
||||
final int idx = target.indexOf('>');
|
||||
if (idx != -1)
|
||||
{
|
||||
target = target.substring(idx + 1);
|
||||
}
|
||||
|
||||
lastEntry.setTarget(ColorUtil.prependColorTag(target, color));
|
||||
}
|
||||
if (image != -1)
|
||||
{
|
||||
lastEntry.setTarget("<img=" + image + ">" + lastEntry.getTarget());
|
||||
}
|
||||
|
||||
lastEntry.setTarget(ColorUtil.prependColorTag(target, color));
|
||||
}
|
||||
if (image2 != -1 && this.playerSkull)
|
||||
{
|
||||
lastEntry.setTarget("<img=" + image2 + ">" + lastEntry.getTarget());
|
||||
}
|
||||
|
||||
if (image2 != -1 && this.playerSkull)
|
||||
{
|
||||
lastEntry.setTarget("<img=" + image2 + ">" + lastEntry.getTarget());
|
||||
client.setMenuEntries(menuEntries);
|
||||
}
|
||||
|
||||
client.setMenuEntries(menuEntries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Friend;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.client.util.PvPUtil;
|
||||
|
||||
@@ -95,42 +94,35 @@ public class PlayerIndicatorsService
|
||||
{
|
||||
consumer.accept(p, PlayerRelation.FRIEND);
|
||||
continue;
|
||||
|
||||
}
|
||||
if (clan.test(p) && plugin.getLocationHashMap().containsKey(PlayerRelation.CLAN))
|
||||
{
|
||||
consumer.accept(p, PlayerRelation.CLAN);
|
||||
continue;
|
||||
|
||||
}
|
||||
if (team.test(p) && plugin.getLocationHashMap().containsKey(PlayerRelation.TEAM))
|
||||
{
|
||||
consumer.accept(p, PlayerRelation.TEAM);
|
||||
continue;
|
||||
|
||||
}
|
||||
if (target.test(p) && plugin.getLocationHashMap().containsKey(PlayerRelation.TARGET))
|
||||
{
|
||||
consumer.accept(p, PlayerRelation.TARGET);
|
||||
continue;
|
||||
|
||||
}
|
||||
if (caller.test(p) && plugin.getLocationHashMap().containsKey(PlayerRelation.CALLER))
|
||||
{
|
||||
consumer.accept(p, PlayerRelation.CALLER);
|
||||
continue;
|
||||
|
||||
}
|
||||
if (callerTarget.test(p) && plugin.getLocationHashMap().containsKey(PlayerRelation.CALLER_TARGET))
|
||||
{
|
||||
consumer.accept(p, PlayerRelation.CALLER_TARGET);
|
||||
continue;
|
||||
|
||||
}
|
||||
if (other.test(p) && plugin.getLocationHashMap().containsKey(PlayerRelation.OTHER))
|
||||
{
|
||||
consumer.accept(p, PlayerRelation.OTHER);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user