player indicators plugin: Use ColorUtil functions
This commit is contained in:
@@ -40,6 +40,8 @@ import net.runelite.client.game.ClanManager;
|
|||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
import net.runelite.client.util.Text;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Player Indicators",
|
name = "Player Indicators",
|
||||||
@@ -155,15 +157,9 @@ public class PlayerIndicatorsPlugin extends Plugin
|
|||||||
|
|
||||||
if (color != null && config.colorPlayerMenu())
|
if (color != null && config.colorPlayerMenu())
|
||||||
{
|
{
|
||||||
// strip out existing <col...
|
// strip out existing tags (color, etc.)
|
||||||
String target = lastEntry.getTarget();
|
String target = Text.removeTags(lastEntry.getTarget());
|
||||||
int idx = target.indexOf('>');
|
lastEntry.setTarget(ColorUtil.prependColorTag(target, color));
|
||||||
if (idx != -1)
|
|
||||||
{
|
|
||||||
target = target.substring(idx + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
lastEntry.setTarget("<col=" + Integer.toHexString(color.getRGB() & 0xFFFFFF) + ">" + target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image != -1 && config.showClanRanks())
|
if (image != -1 && config.showClanRanks())
|
||||||
|
|||||||
Reference in New Issue
Block a user