Thread Tools Display Modes
06-19-20, 11:33 PM   #1
Antiklesys
A Murloc Raider
Join Date: Jun 2020
Posts: 5
GuildList player name color

Is there any way to change to color of a specific player in the GuildList frame in Classic?
Wow already does it automatically for "online" and "offline" players but what if I want to change the color or "highlight" the names of certain players?
E.g. I want to color in "red" the names of all my officers regardless of their online or offline status?
Or even change the color of a specific person, whatever is simpler to showcase with a code example.
I've been trying to find some resources about that but failed, anyone can point me in the right direction?

Last edited by Antiklesys : 06-20-20 at 12:50 AM.
  Reply With Quote
06-22-20, 01:35 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
I'd take a look at GuildRoster_Update(). This is the function that deals with updating the guild roster list.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
06-22-20, 03:20 AM   #3
Antiklesys
A Murloc Raider
Join Date: Jun 2020
Posts: 5
Originally Posted by SDPhantom View Post
I'd take a look at GuildRoster_Update(). This is the function that deals with updating the guild roster list.
Hi, I have checked this but I'm not sure whether this is applicable to classic?
It seems that function has achievements, guild lvl xp, etc...isn't that only for retail?
  Reply With Quote
06-23-20, 10:21 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
Didn't realize you were asking for classic.
The equivalent function is GuildStatus_Update() at FriendsFrame.lua:2677.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
06-24-20, 02:46 PM   #5
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Lua Code:
  1. hooksecurefunc("GuildStatus_Update",function(_)
  2.     local index,name,rank,online
  3.     local showOffline=GetGuildRosterShowOffline()
  4.     local offset=FauxScrollFrame_GetOffset(GuildListScrollFrame)
  5.     local frame=FriendsFrame.playerStatusFrame and "GuildFrameButton" or "GuildFrameGuildStatusButton"
  6.     for i=1,GUILDMEMBERS_TO_DISPLAY do
  7.         index=offset+i
  8.         name,_,rank,_,_,_,_,_,online=GetGuildRosterInfo(index)
  9.         if name then
  10.             if online then
  11.  
  12.                     -- colors for online players
  13.  
  14.  
  15.                         -- Guild Master
  16.                 if rank==0 then
  17.                     _G[frame..i.."Name"]:SetTextColor(1.0,0.82,0.0)
  18.  
  19.                         -- rank immediately under GM
  20.                 elseif rank==1 then
  21.                     _G[frame..i.."Name"]:SetTextColor(1.0,0.82,0.0)
  22.  
  23.                         -- and so on
  24.                 elseif rank==2 then
  25.                     _G[frame..i.."Name"]:SetTextColor(1.0,0.82,0.0)
  26.  
  27.  
  28.                 end
  29.             elseif showOffline then
  30.  
  31.                     -- colors for offline players
  32.  
  33.  
  34.                         -- Guild Master
  35.                 if rank==0 then
  36.                     _G[frame..i.."Name"]:SetTextColor(0.5,0.5,0.5)
  37.  
  38.                         -- rank immediately under GM
  39.                 elseif rank==1 then
  40.                     _G[frame..i.."Name"]:SetTextColor(0.5,0.5,0.5)
  41.  
  42.                         -- and so on
  43.                 elseif rank==2 then
  44.                     _G[frame..i.."Name"]:SetTextColor(0.5,0.5,0.5)
  45.  
  46.  
  47.  
  48.                 end
  49.             end
  50.         end
  51.     end
  52. end)

Last edited by Kanegasi : 06-24-20 at 02:50 PM.
  Reply With Quote
06-25-20, 11:17 AM   #6
Antiklesys
A Murloc Raider
Join Date: Jun 2020
Posts: 5
Originally Posted by Kanegasi View Post
Lua Code:
  1. hooksecurefunc("GuildStatus_Update",function(_)
  2.     local index,name,rank,online
  3.     local showOffline=GetGuildRosterShowOffline()
  4.     local offset=FauxScrollFrame_GetOffset(GuildListScrollFrame)
  5.     local frame=FriendsFrame.playerStatusFrame and "GuildFrameButton" or "GuildFrameGuildStatusButton"
  6.     for i=1,GUILDMEMBERS_TO_DISPLAY do
  7.         index=offset+i
  8.         name,_,rank,_,_,_,_,_,online=GetGuildRosterInfo(index)
  9.         if name then
  10.             if online then
  11.  
  12.                     -- colors for online players
  13.  
  14.  
  15.                         -- Guild Master
  16.                 if rank==0 then
  17.                     _G[frame..i.."Name"]:SetTextColor(1.0,0.82,0.0)
  18.  
  19.                         -- rank immediately under GM
  20.                 elseif rank==1 then
  21.                     _G[frame..i.."Name"]:SetTextColor(1.0,0.82,0.0)
  22.  
  23.                         -- and so on
  24.                 elseif rank==2 then
  25.                     _G[frame..i.."Name"]:SetTextColor(1.0,0.82,0.0)
  26.  
  27.  
  28.                 end
  29.             elseif showOffline then
  30.  
  31.                     -- colors for offline players
  32.  
  33.  
  34.                         -- Guild Master
  35.                 if rank==0 then
  36.                     _G[frame..i.."Name"]:SetTextColor(0.5,0.5,0.5)
  37.  
  38.                         -- rank immediately under GM
  39.                 elseif rank==1 then
  40.                     _G[frame..i.."Name"]:SetTextColor(0.5,0.5,0.5)
  41.  
  42.                         -- and so on
  43.                 elseif rank==2 then
  44.                     _G[frame..i.."Name"]:SetTextColor(0.5,0.5,0.5)
  45.  
  46.  
  47.  
  48.                 end
  49.             end
  50.         end
  51.     end
  52. end)
Thank you!
This helps a lot to reach my goal and learn more !
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GuildList player name color

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off