opponent info: use long npc name if available
This name is used on the in game hd hud (eg "Baby Muttadile" instead of "Muttadile")
This commit is contained in:
@@ -29,6 +29,10 @@ package net.runelite.api;
|
||||
*/
|
||||
public final class ParamID
|
||||
{
|
||||
/**
|
||||
* Long name for NPCs used in the HP hud
|
||||
*/
|
||||
public static final int NPC_HP_NAME = 510;
|
||||
/**
|
||||
* @see SettingID
|
||||
*/
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.opponentinfo;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FontMetrics;
|
||||
@@ -36,6 +37,8 @@ import net.runelite.api.Actor;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NPCComposition;
|
||||
import net.runelite.api.ParamID;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
@@ -111,6 +114,15 @@ class OpponentInfoOverlay extends OverlayPanel
|
||||
lastMaxHealth = null;
|
||||
if (opponent instanceof NPC)
|
||||
{
|
||||
NPCComposition composition = ((NPC) opponent).getTransformedComposition();
|
||||
if (composition != null)
|
||||
{
|
||||
String longName = composition.getStringValue(ParamID.NPC_HP_NAME);
|
||||
if (!Strings.isNullOrEmpty(longName))
|
||||
{
|
||||
opponentName = longName;
|
||||
}
|
||||
}
|
||||
lastMaxHealth = npcManager.getHealth(((NPC) opponent).getId());
|
||||
}
|
||||
else if (opponent instanceof Player)
|
||||
|
||||
Reference in New Issue
Block a user