|
----------------------------------------------------------------------------- |
|
local function getNameplate(targetGUId, targetName, nameplateId) |
local function getNameplate(targetGUId, rawTargetName, nameplateId) |
if targetGUId == AloftCombatText:GetPlayerTargetGUId() then |
return Aloft:GetTargetNameplate(targetName) |
local targetName, _ = Aloft:ParseUnitName(rawTargetName, nil) -- second return value is not used |
local aloftData = Aloft:GetTargetNameplate(targetName) |
-- ChatFrame7:AddMessage("AloftCombatText.getNameplate() TGT " .. tostring(aloftData and aloftData.name) .. "/" .. tostring(rawTargetName) .. "/" .. tostring(targetName) .. "/" .. tostring(targetGUId) .. "/" .. tostring(nameplateId)) |
return aloftData |
elseif nameplateId then |
local nameplates = Aloft:GetNamedNameplates(targetName) |
local targetName, _ = Aloft:ParseUnitName(rawTargetName) -- second return value is not used |
local nameplates = Aloft:GetNamedNameplates(targetName, nil) |
if nameplates then |
for aloftData in pairs(nameplates) do |
if nameplateId == AloftTargetTrackingData:GetNameplateId(aloftData) then |
-- ChatFrame7:AddMessage("AloftCombatText.getNameplate() ENV " .. tostring(aloftData and aloftData.name) .. "/" .. tostring(rawTargetName) .. "/" .. tostring(targetName) .. "/" .. tostring(targetGUId) .. "/" .. tostring(nameplateId)) |
return aloftData |
end |
end |
else |
-- ChatFrame7:AddMessage("AloftCombatText:getNameplate(): no nameplates " .. tostring(targetName) .. "/" .. tostring(nameplateId)) |
-- nothing happens here but diagnostics |
-- local targetName = Aloft:ParseUnitName(rawTargetName, nil) -- second return value is not used |
-- ChatFrame7:AddMessage("AloftCombatText.getNameplate() NON 1 " .. tostring(rawTargetName) .. "/" .. tostring(targetName) .. "/" .. tostring(targetGUId) .. "/" .. tostring(nameplateId)) |
end |
else |
-- ChatFrame7:AddMessage("AloftCombatText:getNameplate(): no nameplateId " .. tostring(targetName)) |
-- nothing happens here but diagnostics |
-- local targetName = Aloft:ParseUnitName(rawTargetName, nil) -- second return value is not used |
-- ChatFrame7:AddMessage("AloftCombatText.getNameplate() NON 2 " .. tostring(rawTargetName) .. "/" .. tostring(targetName) .. "/" .. tostring(targetGUId) .. "/" .. tostring(nameplateId)) |
end |
return nil |
end |