mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-21 20:00:48 +00:00
nameplates: detect players with npc names by level
This commit is contained in:
@@ -473,12 +473,16 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
|||||||
local hpmin, hpmax = plate.original.healthbar:GetMinMaxValues()
|
local hpmin, hpmax = plate.original.healthbar:GetMinMaxValues()
|
||||||
local name = plate.original.name:GetText()
|
local name = plate.original.name:GetText()
|
||||||
local level = plate.original.level:IsShown() and plate.original.level:GetObjectType() == "FontString" and tonumber(plate.original.level:GetText()) or "??"
|
local level = plate.original.level:IsShown() and plate.original.level:GetObjectType() == "FontString" and tonumber(plate.original.level:GetText()) or "??"
|
||||||
local class, _, elite, player = GetUnitData(name, true)
|
local class, ulevel, elite, player = GetUnitData(name, true)
|
||||||
local target = plate.istarget
|
local target = plate.istarget
|
||||||
local mouseover = UnitExists("mouseover") and plate.original.glow:IsShown() or nil
|
local mouseover = UnitExists("mouseover") and plate.original.glow:IsShown() or nil
|
||||||
local unitstr = target and "target" or mouseover and "mouseover" or nil
|
local unitstr = target and "target" or mouseover and "mouseover" or nil
|
||||||
local red, green, blue = plate.original.healthbar:GetStatusBarColor()
|
local red, green, blue = plate.original.healthbar:GetStatusBarColor()
|
||||||
local unittype = GetUnitType(red, green, blue) or "ENEMY_NPC"
|
local unittype = GetUnitType(red, green, blue) or "ENEMY_NPC"
|
||||||
|
|
||||||
|
-- ignore players with npc names if plate level is lower than player level
|
||||||
|
if ulevel and ulevel > (level == "??" and "-1" or level) then player = nil end
|
||||||
|
|
||||||
if player and unittype == "ENEMY_NPC" then unittype = "ENEMY_PLAYER" end
|
if player and unittype == "ENEMY_NPC" then unittype = "ENEMY_PLAYER" end
|
||||||
elite = plate.original.levelicon:IsShown() and not player and "boss" or elite
|
elite = plate.original.levelicon:IsShown() and not player and "boss" or elite
|
||||||
if not class then plate.wait_for_scan = true end
|
if not class then plate.wait_for_scan = true end
|
||||||
|
|||||||
Reference in New Issue
Block a user