so this is currently what I have the tooltip down to and it works fine (well it did as I made some changes here and have yet to test them)... you call it and it returns true if they are the same faction and false if not. I still think an added return to for GetPlayerInfoByGUID would be a better solution... and since this is a WISH LIST... I can wish all I want lol
Lua Code:
local guidCache = {}
local utip = CreateFrame("GameTooltip", "uTip", UIParent, "GameTooltipTemplate")
utip:SetOwner( WorldFrame, "ANCHOR_NONE")
SameFaction = function (guid)
if IsPlayerNeutral() then
return true
end
local _, myFaction = UnitFactionGroup('player')
uTip:ClearLines()
if guid and tonumber(guid:sub(5,5), 16) % 8 == 0 then
if not( guidCache[guid] ) then
utip:SetHyperlink('unit:'..guid)
local tipName, numLines = "uTipTextLeft", _G["uTip"]:NumLines()
local faction = _G[tipName..tostring(numLines)]:GetText() == PVP and _G[tipName..tostring(numLines-1)]:GetText() or _G[tipName..tostring(numLines)]:GetText()
if faction ~= FACTION_ALLIANCE or faction ~= FACTION_HORDE then
if myFaction == FACTION_ALLIANCE then
faction = FACTION_HORDE
else
faction = FACTION_ALLIANCE
end
end
guidCache[guid] = faction
end
return guidCache[guid] == myFaction
end
end