@@ -532,66 +532,85 @@ local function buttonOnEnter(self)
532532 GameTooltip :AddLine (L [" BN" ], 0.4 , 0.6 , 1 )
533533 GameTooltip :AddLine (" " )
534534
535- local qIndex , accountName , _ , _ , _ , _ , _ , _ , _ , note , bCastText , bCastTime = unpack (data )
536- local numAcc = C_BattleNet_GetFriendNumGameAccounts (qIndex ) or 0
537-
538- for i = 1 , numAcc do
539- local info = C_BattleNet_GetFriendGameAccountInfo (qIndex , i )
540- if info then
541- local charName = info .characterName or " "
542- local client = info .clientProgram
543- if client == BNET_CLIENT_WOW then
544- if charName ~= " " then
545- if info .timerunningSeasonID and _G .TimerunningUtil and _G .TimerunningUtil .AddSmallIcon then
546- charName = _G .TimerunningUtil .AddSmallIcon (charName )
547- end
535+ local index , accountName , _ , _ , _ , _ , _ , _ , _ , note , broadcastText , broadcastTime = unpack (self .data )
536+ local numGameAccounts = C_BattleNet_GetFriendNumGameAccounts (index )
537+ for i = 1 , numGameAccounts do
538+ local gameAccountInfo = C_BattleNet_GetFriendGameAccountInfo (index , i )
539+ local charName = gameAccountInfo .characterName
540+ local client = gameAccountInfo .clientProgram
541+ local realmName = gameAccountInfo .realmName or " "
542+ local faction = gameAccountInfo .factionName
543+ local class = gameAccountInfo .className or UNKNOWN
544+ local zoneName = gameAccountInfo .areaName or UNKNOWN
545+ local level = gameAccountInfo .characterLevel
546+ local gameText = gameAccountInfo .richPresence or " "
547+ local wowProjectID = gameAccountInfo .wowProjectID
548+ local clientString = " "
549+ local timerunningSeasonID = gameAccountInfo .timerunningSeasonID
550+ if client == BNET_CLIENT_WOW then
551+ if charName ~= " " then -- fix for weird account
552+ if timerunningSeasonID then
553+ charName = TimerunningUtil .AddSmallIcon (charName ) -- add timerunning tag on name
554+ end
555+ realmName = (K .Realm == realmName or realmName == " " ) and " " or " -" .. realmName
548556
549- local rName = (K .Realm == info .realmName or info .realmName == " " ) and " " or " -" .. info .realmName
550- if info .wowProjectID == WOW_PROJECT_CATA then
551- local r , count = string_gsub (info .richPresence or " " , " ^.-%-%s" , " " )
552- if count and count > 0 then
553- rName = " -" .. r
554- end
557+ -- Get TBC realm name from richPresence
558+ if wowProjectID == WOW_PROJECT_CATA then
559+ local realm , count = gsub (gameText , " ^.-%-%s" , " " )
560+ if count > 0 then
561+ realmName = " -" .. realm
555562 end
563+ end
556564
557- local color = K .ColorClass (K .ClassList [info .className ] or info .className )
558- local classHex = K .RGBToHex (color .r , color .g , color .b )
559- local factionIconString = (info .factionName == " Horde" or info .factionName == " Alliance" ) and (" |TInterface\\ FriendsFrame\\ PlusManz-" .. info .factionName .. " :16:|t" ) or " "
560-
561- GameTooltip :AddLine (string_format (" %s%s %s%s%s" , factionIconString , info .characterLevel or 0 , classHex , charName , rName ))
562- local areaLabel = info .areaName or _G .UNKNOWN
563- if info .wowProjectID ~= WOW_PROJECT_ID then
564- areaLabel = " *" .. areaLabel
565- end
566- GameTooltip :AddLine (string_format (" %s%s" , inactiveColor , areaLabel ))
565+ class = K .ClassList [class ]
566+ local classColor = K .RGBToHex (K .ColorClass (class ))
567+ if faction == " Horde" then
568+ clientString = " |TInterface\\ FriendsFrame\\ PlusManz-Horde:16:|t"
569+ elseif faction == " Alliance" then
570+ clientString = " |TInterface\\ FriendsFrame\\ PlusManz-Alliance:16:|t"
567571 end
568- else
569- GameTooltip : AddLine ( string_format ( " |cffffffff%s%s " , getClientLogo ( client , 16 ), accountName or _G . UNKNOWN ))
570- if info . richPresence ~= " " then
571- GameTooltip : AddLine ( string_format ( " %s%s " , inactiveColor , info . richPresence or " " ))
572+ GameTooltip : AddLine ( string_format ( " %s%s %s%s%s " , clientString , level , classColor , charName , realmName ))
573+
574+ if wowProjectID ~= WOW_PROJECT_ID then
575+ zoneName = " * " .. zoneName
572576 end
577+ GameTooltip :AddLine (string_format (" %s%s" , K .GreyColor , zoneName ))
578+ end
579+ else
580+ if C_Texture .IsTitleIconTextureReady (client , Enum .TitleIconVersion .Small ) then
581+ C_Texture .GetTitleIconTexture (client , Enum .TitleIconVersion .Small , function (success , texture )
582+ if success then
583+ clientString = BNet_GetClientEmbeddedTexture (texture , 32 , 32 , 0 )
584+ end
585+ end )
586+ end
587+ GameTooltip :AddLine (string_format (" |cffffffff%s%s" , clientString , accountName ))
588+ if gameText ~= " " then
589+ GameTooltip :AddLine (string_format (" %s%s" , K .GreyColor , gameText ))
573590 end
574591 end
575592 end
576593
577594 if note and note ~= " " then
578595 GameTooltip :AddLine (" " )
579- GameTooltip :AddLine (string_format (noteIconString , note ), 1 , 0.8 , 0 )
596+ GameTooltip :AddLine (string_format (" |T " .. " Interface \\ Buttons \\ UI-GuildButton-PublicNote-Up " .. " :16|t %s " , note ), 1 , 0.8 , 0 )
580597 end
581- if bCastText and bCastText ~= " " then
598+
599+ if broadcastText and broadcastText ~= " " then
582600 GameTooltip :AddLine (" " )
583- GameTooltip :AddLine (string_format (broadcastIconString , bCastText , FriendsFrame_GetLastOnline (bCastTime )), 0.3 , 0.5 , 0.7 , 1 )
601+ GameTooltip :AddLine (string_format (" |TInterface \\ FriendsFrame \\ BroadcastIcon:12|t %s (%s) " , broadcastText , FriendsFrame_GetLastOnline (broadcastTime )), 0.3 , 0.6 , 0.8 )
584602 end
585603 else
586604 GameTooltip :AddLine (L [" WoW" ], 1 , 0.8 , 0 )
587605 GameTooltip :AddLine (" " )
588- local name , level , class , area , _ , note = unpack (data )
589- local color = K .ColorClass (class )
590- GameTooltip :AddLine (string_format (" %s %s%s" , level , K .RGBToHex (color .r , color .g , color .b ), name ))
591- GameTooltip :AddLine (string_format (" %s%s" , inactiveColor , area ))
606+ local name , level , class , area , _ , note = unpack (self .data )
607+ local classColor = K .RGBToHex (K .ColorClass (class ))
608+ GameTooltip :AddLine (string_format (" %s %s%s" , level , classColor , name ))
609+ GameTooltip :AddLine (string_format (" %s%s" , K .GreyColor , area ))
610+
592611 if note and note ~= " " then
593612 GameTooltip :AddLine (" " )
594- GameTooltip :AddLine (string_format (noteIconString , note ), 1 , 0.8 , 0 )
613+ GameTooltip :AddLine (string_format (" |T " .. " Interface \\ Buttons \\ UI-GuildButton-PublicNote-Up " .. " :16|t %s " , note ), 1 , 0.8 , 0 )
595614 end
596615 end
597616 GameTooltip :Show ()
0 commit comments