Commit e2768db0 authored by Tukz's avatar Tukz
Browse files

/who nicknames by class colors

parent b358efa2
......@@ -130,6 +130,7 @@ function Loading:OnEvent(event)
T["Miscellaneous"]["AFK"]:Enable()
T["Miscellaneous"]["MicroMenu"]:Enable()
T["Miscellaneous"]["GuildNamesByClassColor"]:Enable()
T["Miscellaneous"]["WhoNamesByClassColor"]:Enable()
T["Miscellaneous"]["Keybinds"]:Enable()
T["Auras"]:Enable()
T["Maps"]["Minimap"]:Enable()
......
......@@ -97,24 +97,4 @@ function GetColoredName(event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, a
end
return arg2
end
-- Temp, for /who command, shaman color.
local function UpdateWhoShamanColor()
local WhoOffset = FauxScrollFrame_GetOffset(WhoListScrollFrame)
local WhoIndex, Button, Text
for i=1, WHOS_TO_DISPLAY, 1 do
WhoIndex = WhoOffset + i;
Button = _G["WhoFrameButton"..i]
Text = _G["WhoFrameButton"..i.."Class"]
local Info = C_FriendList.GetWhoInfo(WhoIndex)
if Info and Info.filename == "SHAMAN" and Text then
Text:SetTextColor(unpack(T.Colors.class["SHAMAN"]))
end
end
end
hooksecurefunc("WhoList_Update", UpdateWhoShamanColor)
\ No newline at end of file
end
\ No newline at end of file
......@@ -47,6 +47,7 @@
<Script file="Miscellaneous\Grid.lua"/>
<Script file="Miscellaneous\UIErrorFilter.lua"/>
<Script file="Miscellaneous\GuildNamesByClassColor.lua"/>
<Script file="Miscellaneous\WhoNamesByClassColor.lua"/>
<Script file="Miscellaneous\Keybinds.lua"/>
<!-- Auras -->
......
......@@ -30,4 +30,4 @@ function GuildNamesByClassColor:Enable()
hooksecurefunc("GuildStatus_Update", self.Update)
end
Miscellaneous.GuildNamesByClassColor = GuildNamesByClassColor
Miscellaneous.GuildNamesByClassColor = GuildNamesByClassColor
\ No newline at end of file
local T, C, L = select(2, ...):unpack()
local Miscellaneous = T["Miscellaneous"]
local WhoNamesByClassColor = CreateFrame("Frame")
function WhoNamesByClassColor:Update()
local WhoOffset = FauxScrollFrame_GetOffset(WhoListScrollFrame)
local WhoIndex, Button, Text, Name, Class
for i=1, WHOS_TO_DISPLAY, 1 do
WhoIndex = WhoOffset + i
Button = _G["WhoFrameButton"..i]
Class = _G["WhoFrameButton"..i.."Class"]
Name = _G["WhoFrameButton"..i.."Name"]
local Info = C_FriendList.GetWhoInfo(WhoIndex)
if Info and Info.filename then
if Name then
Name:SetTextColor(unpack(T.Colors.class[Info.filename]))
end
if Class then
Class:SetTextColor(1, 1, 1)
end
end
end
end
function WhoNamesByClassColor:Enable()
hooksecurefunc("WhoList_Update", self.Update)
end
Miscellaneous.WhoNamesByClassColor = WhoNamesByClassColor
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment