API
Find nameplate functions
lib:GetTargetNameplate()
Get the user's current target's nameplate.
Note: this may not be reliable when PLAYER_TARGET_CHANGED fires. Use the LibNameplate_TargetNameplate callback.
Arguments
- None
Return value:
frame: nameplate frame.
lib:GetNameplateByGUID(GUID)
Get a nameplate of a GUID. For LibNP to know a nameplate's GUID, the user must target/mouseover the nameplate.
Arguments
- GUID: GUID from UnitGUID or combatlog.
Return value:
frame: nameplate frame.
lib:GetNameplateByName(name[, maxHP])
Get a nameplate of a name. Nameplates don't show servernames so don't include it in the args. If multiple nameplates share the same name, LibNP will return the first found.
Arguments
- name: name of the player/npc. (without servername)
- maxHP: max HP of the plate you're looking for. (optional)
- Return value:
frame: nameplate frame.
- Return value:
lib:GetNameplateByUnit(unitID)
Get a nameplate of a unitID. LibNP attempts to find the nameplate using the unitID's GUID, current & max health, name (if player/boss).
Arguments
- unitID: valid unitID. (target, party1target, mouseover, pettarget, ect)
Return value:
frame: nameplate frame.
lib:GetAllNameplates()
Returns all known nameplates, not just the visible ones.
Arguments
- None
Return value:
frame, frame, frame, ...
lib:IteratePlates()
Returns all known nameplates, not just the visible ones.
Arguments
- None
Return value:
_, table of all nameplates.
example
for i, plate in LibNameplate:IteratePlates() do print(plate .." belongs to "..LibNameplate:GetName(plate )..".") end
lib:GetNameplateByHealth(currentHP, maxHP)
Get a nameplate matching the health values input.
Arguments
- currentHP: current HP of a player/NPC.
- maxHP: max HP of a player/NPC.
Return value:
frame: nameplate frame.
Get info functions
lib:GetName(frame)
Get the player/npc's name from a nameplate. Note this returns name without server name.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
string: name of the player/npc without servername.
lib:GetLevel(frame)
Get the player/npc's level.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
number: level
lib:GetLevelDifficulty(frame)
Get the nameplate level difficulty.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
string: impossible (red/skull), verydifficult (orange), difficult (yellow), standard (green) or trivial (gray)
lib:GetReaction(frame)
Get the player/npc's reaction to ourselves.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
string: FRIENDLY / NEUTRAL / HOSTILE
lib:GetType(frame)
Get the player/npc's type.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
string: NPC / PLAYER
lib:IsBoss(frame)
Check if a frame is a boss frame.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
boolean: true/false
lib:GetHealthMax(frame)
Get a nameplate's max health.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
number: max HP
lib:GetClass(frame)
Get a nameplate's class. This requires user have Color nameplates by class enabled and be in a PvP zone.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
string: WARRIOR, PRIEST, ect
lib:IsElite(frame)
Check if a nameplate is elite.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
boolean: true/false
lib:GetThreatSituation(frame)
Get a nameplate's threat.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
string: HIGH / MEDIUM / LOW
lib:IsTarget(frame)
Check if a nameplate is the user's target.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
boolean: true/false
lib:GetHealth(frame)
Get a nameplate's current HP.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
number: current HP.
lib:IsMouseover(frame)
Check if the user is mousing over a nameplate.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
boolean: true/false
lib:IsCasting(frame)
Check if the user is casting a spell. Note you can only see your target's nameplate casting bar. So watch UNIT_SPELLCAST_START
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
boolean: true/false
lib:IsInCombat(frame)
Check if a nameplate is in combat.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
boolean: true/false
lib:IsMarked(frame)
Check if a nameplate has a raid icon.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
boolean: true/false
lib:GetRaidIcon(frame)
Get a nameplate's raid icon.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
number: 1-8 or 0
lib:GetGUID(frame)
Get a nameplate's GUID.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
string: unitGUID
Get region/bar functions
Warning, altering these regions/bars could break LibNP's API. If you plan on changing the look of existing nameplates, hide these regions/bars and create new ones to alter.
lib:GetNameRegion(frame)
Get a nameplate's name region.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
region
-
lib:GetLevelRegion(frame)
Get a nameplate's level region.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
region
-
lib:GetBossRegion(frame)
Get a nameplate's boss region.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
region
-
lib:GetEliteRegion(frame)
Get a nameplate's elite region.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
region
-
lib:GetThreatRegion(frame)
Get a nameplate's threat region.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
region
-
lib:GetHightlightRegion(frame)
Get a nameplate's hightlight region.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
region
-
lib:GetRaidIconRegion(frame)
Get a nameplate's raid icon region.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
region
-
lib:GetHealthBar(frame)
Get a nameplate's heath bar frame.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
frame
-
lib:GetCastBar(frame)
Get a nameplate's cast bar frame.
Arguments
- frame: The nameplate frame provided by GetNameplateByXXX API or callbacks.
Return value:
frame
Comments