Use Text.removeTags in MenuManager
To fix the issue with looking up ironman names, use Text.removeTags to remove the <img> tag from name too. Fixes #1925
This commit is contained in:
committed by
Tomas Slusny
parent
287d466c1a
commit
e163a77619
@@ -51,6 +51,7 @@ import net.runelite.api.events.PlayerMenuOptionClicked;
|
||||
import net.runelite.api.events.PlayerMenuOptionsChanged;
|
||||
import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@Singleton
|
||||
@Slf4j
|
||||
@@ -317,7 +318,10 @@ public class MenuManager
|
||||
}
|
||||
|
||||
String target = event.getMenuTarget();
|
||||
String username = target.split("[<>]")[2]; // <col=ffffff>username<col=40ff00> (level-42)
|
||||
|
||||
// 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();
|
||||
|
||||
PlayerMenuOptionClicked playerMenuOptionClicked = new PlayerMenuOptionClicked();
|
||||
playerMenuOptionClicked.setMenuOption(event.getMenuOption());
|
||||
|
||||
Reference in New Issue
Block a user