WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   GuildList player name color (https://www.wowinterface.com/forums/showthread.php?t=58060)

Antiklesys 06-19-20 11:33 PM

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?

SDPhantom 06-22-20 01:35 AM

I'd take a look at GuildRoster_Update(). This is the function that deals with updating the guild roster list.

Antiklesys 06-22-20 03:20 AM

Quote:

Originally Posted by SDPhantom (Post 336202)
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?

SDPhantom 06-23-20 10:21 PM

Didn't realize you were asking for classic.
The equivalent function is GuildStatus_Update() at FriendsFrame.lua:2677.

Kanegasi 06-24-20 02:46 PM

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)

Antiklesys 06-25-20 11:17 AM

Quote:

Originally Posted by Kanegasi (Post 336223)
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 !


All times are GMT -6. The time now is 11:46 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI