Change all use of heroclass to use RAID_CLASS_COLORS instead. This can be changed to CUSTOM_CLASS_COLORS later with a color picker for each class, but to support CoA classes need to go back to being colored properly.

Fix remaining lua errors covered by ascension patches

Add Addon Skins
Add Enhanced Friends List
This commit is contained in:
Andrew6810
2022-10-28 07:12:13 -07:00
parent 60ef8a38af
commit df7cc26a64
205 changed files with 18480 additions and 35 deletions
+381
View File
@@ -0,0 +1,381 @@
local E, L, V, P, G = unpack(ElvUI)
local EFL = E:GetModule("EnhancedFriendsList")
local function ColorizeSettingName(settingName)
return format("|cff1784d1%s|r", settingName)
end
function EFL:InsertOptions()
E.Options.args.enhanceFriendsList = {
order = 54,
type = "group",
childGroups = "tab",
name = ColorizeSettingName(L["Enhanced Friends List"]),
args = {
header = {
order = 1,
type = "header",
name = L["Enhanced Friends List"]
},
general = {
order = 2,
type = "group",
name = L["General"],
get = function(info) return E.db.enhanceFriendsList[ info[#info] ] end,
set = function(info, value) E.db.enhanceFriendsList[ info[#info] ] = value; EFL:Update(); FriendsList_Update(); FriendsFrameStatusDropDown_Update() end,
args = {
header = {
order = 0,
type = "header",
name = L["General"],
},
showBackground = {
order = 1,
type = "toggle",
name = L["Show Background"]
},
showStatusIcon = {
order = 2,
type = "toggle",
name = L["Show Status Icon"]
},
statusIcons = {
order = 3,
type = "select",
name = L["Status Icons Textures"],
values = {
["Default"] = L["Default"],
["Square"] = "Square",
["D3"] = "Diablo 3"
}
},
nameFont = {
order = 4,
type = "group",
name = L["Name Font"],
guiInline = true,
get = function(info) return E.db.enhanceFriendsList[ info[#info] ] end,
set = function(info, value) E.db.enhanceFriendsList[ info[#info] ] = value; EFL:Update(); FriendsList_Update() end,
args = {
nameFont = {
order = 1,
type = "select", dialogControl = "LSM30_Font",
name = L["Font"],
values = AceGUIWidgetLSMlists.font
},
nameFontSize = {
order = 2,
type = "range",
name = FONT_SIZE,
min = 6, max = 22, step = 1
},
nameFontOutline = {
order = 3,
type = "select",
name = L["Font Outline"],
desc = L["Set the font outline."],
values = {
["NONE"] = NONE,
["OUTLINE"] = "OUTLINE",
["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE",
["THICKOUTLINE"] = "THICKOUTLINE"
}
}
}
},
zoneFont = {
order = 5,
type = "group",
name = L["Zone Font"],
guiInline = true,
get = function(info) return E.db.enhanceFriendsList[ info[#info] ] end,
set = function(info, value) E.db.enhanceFriendsList[ info[#info] ] = value; EFL:Update(); FriendsList_Update() end,
args = {
zoneFont = {
order = 1,
type = "select", dialogControl = "LSM30_Font",
name = L["Font"],
values = AceGUIWidgetLSMlists.font
},
zoneFontSize = {
order = 2,
type = "range",
name = FONT_SIZE,
min = 6, max = 22, step = 1
},
zoneFontOutline = {
order = 3,
type = "select",
name = L["Font Outline"],
desc = L["Set the font outline."],
values = {
["NONE"] = NONE,
["OUTLINE"] = "OUTLINE",
["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE",
["THICKOUTLINE"] = "THICKOUTLINE"
}
}
}
}
}
},
Online = {
order = 3,
type = "group",
name = L["Online Friends"],
get = function(info) return E.db.enhanceFriendsList.Online[ info[#info] ] end,
set = function(info, value) E.db.enhanceFriendsList.Online[ info[#info] ] = value; EFL:Update(); FriendsList_Update() end,
args = {
header = {
order = 0,
type = "header",
name = L["Online Friends"]
},
name = {
order = 1,
type = "group",
name = NAME,
guiInline = true,
args = {
enhancedName = {
order = 1,
type = "toggle",
name = L["Enhanced Name"]
},
colorizeNameOnly = {
order = 2,
type = "toggle",
name = L["Colorize Name Only"],
disabled = function() return not E.db.enhanceFriendsList.Online.enhancedName end
}
}
},
level = {
order = 2,
type = "group",
name = LEVEL,
guiInline = true,
args = {
level = {
order = 1,
type = "toggle",
name = L["Show"]
},
levelColor = {
order = 2,
type = "toggle",
name = L["Level Range Color"],
disabled = function() return not E.db.enhanceFriendsList.Online.level end
},
levelText = {
order = 3,
type = "toggle",
name = L["Level Text"],
disabled = function() return not E.db.enhanceFriendsList.Online.level end
},
shortLevel = {
order = 4,
type = "toggle",
name = L["Short Level"],
disabled = function() return not E.db.enhanceFriendsList.Online.level or not E.db.enhanceFriendsList.Online.levelText end
}
}
},
class = {
order = 3,
type = "group",
name = CLASS,
guiInline = true,
args = {
classText = {
order = 1,
type = "toggle",
name = L["Class Text"]
},
classIcon = {
order = 2,
type = "toggle",
name = L["Class Icon"]
},
classIconStatusColor = {
order = 3,
type = "toggle",
name = L["Class Icon Status Color"],
disabled = function() return not E.db.enhanceFriendsList.Online.classIcon end
}
}
},
zone = {
order = 4,
type = "group",
name = ZONE,
guiInline = true,
args = {
zoneText = {
order = 1,
type = "toggle",
name = L["Zone Text"]
},
spacer = {
order = 2,
type = "description",
name = ""
},
enhancedZone = {
order = 3,
type = "toggle",
name = L["Enhanced Zone"],
disabled = function() return not E.db.enhanceFriendsList.Online.zoneText end
},
enhancedZoneColor = {
order = 4,
type = "color",
name = L["Enhanced Zone Color"],
get = function(info)
local t = E.db.enhanceFriendsList.Online.enhancedZoneColor
local d = P.enhanceFriendsList.Online.enhancedZoneColor
return t.r, t.g, t.b, t.a, d.r, d.g, d.b
end,
set = function(info, r, g, b)
local t = E.db.enhanceFriendsList.Online.enhancedZoneColor
t.r, t.g, t.b = r, g, b
FriendsList_Update()
end,
disabled = function() return not E.db.enhanceFriendsList.Online.zoneText or not E.db.enhanceFriendsList.Online.enhancedZone end
},
spacer2 = {
order = 5,
type = "description",
name = "",
},
sameZone = {
order = 6,
type = "toggle",
name = L["Same Zone"],
desc = L["Friends that are in the same area as you, have their zone info colorized green."],
disabled = function() return not E.db.enhanceFriendsList.Online.zoneText end
},
sameZoneColor = {
order = 7,
type = "color",
name = L["Same Zone Color"],
get = function(info)
local t = E.db.enhanceFriendsList.Online.sameZoneColor
local d = P.enhanceFriendsList.Online.sameZoneColor
return t.r, t.g, t.b, t.a, d.r, d.g, d.b
end,
set = function(info, r, g, b)
local t = E.db.enhanceFriendsList.Online.sameZoneColor
t.r, t.g, t.b = r, g, b
FriendsList_Update()
end,
disabled = function() return not E.db.enhanceFriendsList.Online.zoneText or not E.db.enhanceFriendsList.Online.sameZone end
}
}
}
}
},
Offline = {
order = 4,
type = "group",
name = L["Offline Friends"],
get = function(info) return E.db.enhanceFriendsList.Offline[ info[#info] ] end,
set = function(info, value) E.db.enhanceFriendsList.Offline[ info[#info] ] = value; EFL:Update(); FriendsList_Update() end,
args = {
header = {
order = 0,
type = "header",
name = L["Offline Friends"]
},
name = {
order = 1,
type = "group",
name = NAME,
guiInline = true,
args = {
enhancedName = {
order = 1,
type = "toggle",
name = L["Enhanced Name"]
},
colorizeNameOnly = {
order = 2,
type = "toggle",
name = L["Colorize Name Only"],
disabled = function() return not E.db.enhanceFriendsList.Offline.enhancedName end
}
}
},
level = {
order = 2,
type = "group",
name = LEVEL,
guiInline = true,
args = {
level = {
order = 1,
type = "toggle",
name = L["Show"]
},
levelColor = {
order = 2,
type = "toggle",
name = L["Level Range Color"],
disabled = function() return not E.db.enhanceFriendsList.Offline.level end
},
levelText = {
order = 3,
type = "toggle",
name = L["Level Text"],
desc = L["Hides the 'Level' or 'L' text."],
disabled = function() return not E.db.enhanceFriendsList.Offline.level end
},
shortLevel = {
order = 4,
type = "toggle",
name = L["Short Level"],
disabled = function() return not E.db.enhanceFriendsList.Offline.level or not E.db.enhanceFriendsList.Offline.levelText end
}
}
},
class = {
order = 3,
type = "group",
name = CLASS,
guiInline = true,
args = {
classText = {
order = 1,
type = "toggle",
name = L["Class Text"]
},
classIcon = {
order = 2,
type = "toggle",
name = L["Class Icon"]
}
}
},
zone = {
order = 4,
type = "group",
name = ZONE,
guiInline = true,
args = {
zoneText = {
order = 1,
type = "toggle",
name = L["Zone Text"]
},
lastSeen = {
order = 2,
type = "toggle",
name = L["Last Seen"]
}
}
}
}
}
}
}
end
@@ -0,0 +1,3 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Config.lua"/>
</Ui>
@@ -0,0 +1,404 @@
local E, L, V, P, G = unpack(ElvUI)
local EFL = E:NewModule("EnhancedFriendsList", "AceHook-3.0")
local EP = LibStub("LibElvUIPlugin-1.0")
local LSM = LibStub("LibSharedMedia-3.0", true)
local addonName = ...
local unpack, pairs, ipairs = unpack, pairs, ipairs
local format = format
local GetFriendInfo = GetFriendInfo
local GetQuestDifficultyColor = GetQuestDifficultyColor
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
local FRIENDS_BUTTON_TYPE_WOW = FRIENDS_BUTTON_TYPE_WOW
local LOCALIZED_CLASS_NAMES_FEMALE = LOCALIZED_CLASS_NAMES_FEMALE
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local StatusIcons = {
Default = {
Online = FRIENDS_TEXTURE_ONLINE,
Offline = FRIENDS_TEXTURE_OFFLINE,
DND = FRIENDS_TEXTURE_DND,
AFK = FRIENDS_TEXTURE_AFK
},
Square = {
Online = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\Square\\Online",
Offline = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\Square\\Offline",
DND = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\Square\\DND",
AFK = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\Square\\AFK"
},
D3 = {
Online = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\D3\\Online",
Offline = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\D3\\Offline",
DND = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\D3\\DND",
AFK = "Interface\\AddOns\\ElvUI_EnhancedFriendsList\\Media\\Textures\\D3\\AFK"
}
}
local function GetLevelDiffColorHex(level, offline)
if level ~= 0 then
local color = GetQuestDifficultyColor(level)
return offline and format("|cFF%02x%02x%02x", color.r*160, color.g*160, color.b*160) or format("|cFF%02x%02x%02x", color.r*255, color.g*255, color.b*255)
else
return offline and E:RGBToHex(0.49, 0.52, 0.54) or "|cFFFFFFFF"
end
end
local localizedTable = {}
for k, v in pairs(LOCALIZED_CLASS_NAMES_MALE) do
localizedTable[v] = k
end
for k, v in pairs(LOCALIZED_CLASS_NAMES_FEMALE) do
localizedTable[v] = k
end
local function GetClassColorHex(class, offline)
class = localizedTable[class]
local color = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
if color then
return offline and format("|cff%02x%02x%02x", color.r*160, color.g*160, color.b*160) or format("|cff%02x%02x%02x", color.r*255, color.g*255, color.b*255)
else
return offline and E:RGBToHex(0.49, 0.52, 0.54) or "|cFFFFFFFF"
end
end
local function HexToRGB(hex)
if not hex then return nil end
local rhex, ghex, bhex = string.sub(hex, 5, 6), string.sub(hex, 7, 8), string.sub(hex, 9, 10)
return {r = tonumber(rhex, 16)/225, g = tonumber(ghex, 16)/225, b = tonumber(bhex, 16)/225}
end
function EFL:Update()
for i = 1, #FriendsFrameFriendsScrollFrame.buttons do
local button = FriendsFrameFriendsScrollFrame.buttons[i]
self:Configure_Background(button)
self:Configure_Status(button)
self:Configure_IconFrame(button)
button.name:SetFont(LSM:Fetch("font", E.db.enhanceFriendsList.nameFont), E.db.enhanceFriendsList.nameFontSize, E.db.enhanceFriendsList.nameFontOutline)
button.info:SetFont(LSM:Fetch("font", E.db.enhanceFriendsList.zoneFont), E.db.enhanceFriendsList.zoneFontSize, E.db.enhanceFriendsList.zoneFontOutline)
end
end
-- Status
function EFL:Update_Status(button)
if not E.db.enhanceFriendsList.showStatusIcon then return end
if button.TYPE == "Online" then
button.status:SetTexture(StatusIcons[E.db.enhanceFriendsList.statusIcons][(button.statusType == CHAT_FLAG_DND and "DND" or button.statusType == CHAT_FLAG_AFK and "AFK" or "Online")])
else
button.status:SetTexture(StatusIcons[E.db.enhanceFriendsList.statusIcons].Offline)
end
end
function EFL:Configure_Status(button)
if E.db.enhanceFriendsList.showStatusIcon then
button.status:Show()
else
button.status:Hide()
end
end
-- Name
function EFL:Update_Name(button)
local isOffline = button.TYPE == "Offline" or false
local enhancedName = (self.db[button.TYPE].enhancedName and GetClassColorHex(button.class, isOffline)..button.nameText.."|r" or button.nameText)
local enhancedLevel = self.db[button.TYPE].level and button.levelText and format(self.db[button.TYPE].levelText and (self.db[button.TYPE].shortLevel and L["SHORT_LEVEL_TEMPLATE"] or L["LEVEL_TEMPLATE"]) or "%s", self.db[button.TYPE].levelColor and GetLevelDiffColorHex(button.levelText, isOffline)..button.levelText.."|r" or button.levelText).." " or ""
local enhancedClass = self.db[button.TYPE].classText and button.class or ""
button.name:SetText(enhancedName..((enhancedLevel ~= "" or enhancedClass ~= "") and (self.db[button.TYPE].enhancedName and " - " or ", ") or "")..enhancedLevel..enhancedClass)
local nameColor = self.db[button.TYPE].enhancedName and (self.db[button.TYPE].colorizeNameOnly and (isOffline and FRIENDS_GRAY_COLOR or HIGHLIGHT_FONT_COLOR) or HexToRGB(GetClassColorHex(button.class, isOffline))) or (isOffline and FRIENDS_GRAY_COLOR or FRIENDS_WOW_NAME_COLOR)
button.name:SetTextColor(nameColor.r, nameColor.g, nameColor.b)
local infoText
if isOffline then
if button.lastSeen then
infoText = (self.db[button.TYPE].zoneText and button.area and button.area..(self.db[button.TYPE].lastSeen and " - " or "") or "")..(self.db[button.TYPE].lastSeen and L["Last seen"].." "..FriendsFrame_GetLastOnline(button.lastSeen) or "")
else
infoText = self.db[button.TYPE].zoneText and button.area or ""
end
button.info:SetTextColor(0.49, 0.52, 0.54)
else
infoText = self.db[button.TYPE].zoneText and button.area or ""
local playerZone = GetRealZoneText()
if self.db[button.TYPE].enhancedZone then
if self.db[button.TYPE].sameZone then
if infoText == playerZone then
button.info:SetTextColor(self.db[button.TYPE].sameZoneColor.r, self.db[button.TYPE].sameZoneColor.g, self.db[button.TYPE].sameZoneColor.b)
else
button.info:SetTextColor(self.db[button.TYPE].enhancedZoneColor.r, self.db[button.TYPE].enhancedZoneColor.g, self.db[button.TYPE].enhancedZoneColor.b)
end
else
button.info:SetTextColor(self.db[button.TYPE].enhancedZoneColor.r, self.db[button.TYPE].enhancedZoneColor.g, self.db[button.TYPE].enhancedZoneColor.b)
end
else
if self.db[button.TYPE].sameZone then
if infoText == playerZone then
button.info:SetTextColor(self.db[button.TYPE].sameZoneColor.r, self.db[button.TYPE].sameZoneColor.g, self.db[button.TYPE].sameZoneColor.b)
else
button.info:SetTextColor(0.49, 0.52, 0.54)
end
else
button.info:SetTextColor(0.49, 0.52, 0.54)
end
end
end
button.info:SetText(infoText)
button.name:ClearAllPoints()
if button.iconFrame:IsShown() then
button.name:Point("LEFT", button.iconFrame, "RIGHT", 3, infoText ~= "" and 7 or 0)
else
if E.db.enhanceFriendsList.showStatusIcon then
button.name:Point("TOPLEFT", 22, infoText ~= "" and -3 or -10)
else
button.name:Point("TOPLEFT", 3, infoText ~= "" and -3 or -10)
end
end
end
-- IconFrame
function EFL:Update_IconFrame(button)
if E.db.enhanceFriendsList[button.TYPE].classIcon then
local classFileName = localizedTable[button.class]
if classFileName then
button.iconFrame:Show()
button.iconFrame.texture:SetTexCoord(unpack(CLASS_ICON_TCOORDS[classFileName]))
button.iconFrame:SetAlpha(button.TYPE == "Online" and 1 or 0.6)
if E.db.enhanceFriendsList.Online.classIconStatusColor then
if button.TYPE == "Online" then
if button.statusType == "" then
if E.PixelMode then
button.iconFrame:SetBackdropBorderColor(0, 0, 0, 1)
else
button.iconFrame:SetBackdropBorderColor(0, 0, 0, 0)
end
elseif button.statusType == CHAT_FLAG_AFK then
button.iconFrame:SetBackdropBorderColor(1, 1, 0)
elseif button.statusType == CHAT_FLAG_DND then
button.iconFrame:SetBackdropBorderColor(1, 0, 0)
end
else
if E.PixelMode then
button.iconFrame:SetBackdropBorderColor(0, 0, 0, 1)
else
button.iconFrame:SetBackdropBorderColor(0, 0, 0, 0)
end
end
else
button.iconFrame:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end
else
button.iconFrame:Hide()
end
elseif button.iconFrame:IsShown() then
button.iconFrame:Hide()
end
end
function EFL:Configure_IconFrame(button)
button.iconFrame:ClearAllPoints()
if E.db.enhanceFriendsList.showStatusIcon then
button.iconFrame:Point("LEFT", 22, 0)
else
button.iconFrame:Point("LEFT", 3, 0)
end
end
function EFL:Construct_IconFrame(button)
button.iconFrame = CreateFrame("Frame", "$parentIconFrame", button)
button.iconFrame:Size(26)
button.iconFrame:SetTemplate("Default")
button.iconFrame.texture = button.iconFrame:CreateTexture()
button.iconFrame.texture:SetAllPoints()
button.iconFrame.texture:SetTexture("Interface\\WorldStateFrame\\Icons-Classes")
button.iconFrame:Hide()
end
-- Background
function EFL:Update_Background(button)
if not E.db.enhanceFriendsList.showBackground then return end
if button.TYPE == "Online" then
button.backgroundLeft:SetGradientAlpha("Horizontal", 1,0.824,0,0.05, 1,0.824,0,0)
button.backgroundRight:SetGradientAlpha("Horizontal", 1,0.824,0,0, 1,0.824,0,0.05)
else
button.backgroundLeft:SetGradientAlpha("Horizontal", 0.588,0.588,0.588,0.05, 0.588,0.588,0.588,0)
button.backgroundRight:SetGradientAlpha("Horizontal", 0.588,0.588,0.588,0, 0.588,0.588,0.588,0.05)
end
end
function EFL:Configure_Background(button)
if E.db.enhanceFriendsList.showBackground then
button.backgroundLeft:Show()
button.backgroundRight:Show()
else
button.backgroundLeft:Hide()
button.backgroundRight:Hide()
end
end
function EFL:Construct_Background(button)
button.backgroundLeft = button:CreateTexture(nil, "BACKGROUND")
button.backgroundLeft:SetWidth(button:GetWidth() / 2)
button.backgroundLeft:SetHeight(32)
button.backgroundLeft:SetPoint("LEFT", button, "CENTER")
button.backgroundLeft:SetTexture(E.media.blankTex)
button.backgroundLeft:SetGradientAlpha("Horizontal", 1,0.824,0.0,0.05, 1,0.824,0.0,0)
button.backgroundRight = button:CreateTexture(nil, "BACKGROUND")
button.backgroundRight:SetWidth(button:GetWidth() / 2)
button.backgroundRight:SetHeight(32)
button.backgroundRight:SetPoint("RIGHT", button, "CENTER")
button.backgroundRight:SetTexture(E.media.blankTex)
button.backgroundRight:SetGradientAlpha("Horizontal", 1,0.824,0.0,0, 1,0.824,0.0,0.05)
end
-- Highlight
function EFL:Update_Highlight(button)
if button.TYPE == "Online" then
if button.statusType == "" then
button.highlightLeft:SetGradientAlpha("Horizontal", 0.243,0.570,1,0.35, 0.243,0.570,1,0)
button.highlightRight:SetGradientAlpha("Horizontal", 0.243,0.570,1,0, 0.243,0.570,1,0.35)
elseif button.statusType == CHAT_FLAG_AFK then
button.highlightLeft:SetGradientAlpha("Horizontal", 1,1,0,0.35, 1,1,0,0)
button.highlightRight:SetGradientAlpha("Horizontal", 1,1,0,0, 1,1,0,0.35)
elseif button.statusType == CHAT_FLAG_DND then
button.highlightLeft:SetGradientAlpha("Horizontal", 1,0,0,0.35, 1,0,0,0)
button.highlightRight:SetGradientAlpha("Horizontal", 1,0,0,0, 1,0,0,0.35)
end
else
button.highlightLeft:SetGradientAlpha("Horizontal", 0.486,0.518,0.541,0.35, 0.486,0.518,0.541,0)
button.highlightRight:SetGradientAlpha("Horizontal", 0.486,0.518,0.541,0, 0.486,0.518,0.541,0.35)
end
end
function EFL:Construct_Highlight(button)
button.highlightLeft = button:CreateTexture(nil, "HIGHLIGHT")
button.highlightLeft:SetWidth(button:GetWidth() / 2)
button.highlightLeft:SetHeight(32)
button.highlightLeft:SetPoint("LEFT", button, "CENTER")
button.highlightLeft:SetTexture(E.media.blankTex)
button.highlightLeft:SetGradientAlpha("Horizontal", 0.243,0.570,1,0.35, 0.243,0.570,1,0)
button.highlightRight = button:CreateTexture(nil, "HIGHLIGHT")
button.highlightRight:SetWidth(button:GetWidth() / 2)
button.highlightRight:SetHeight(32)
button.highlightRight:SetPoint("RIGHT", button, "CENTER")
button.highlightRight:SetTexture(E.media.blankTex)
button.highlightRight:SetGradientAlpha("Horizontal", 0.243,0.570,1,0, 0.243,0.570,1,0.35)
end
function EFL:GetLocalFriendInfo(name)
local info = EnhancedFriendsListDB[E.myrealm][name]
if info then
return info[1], info[2], info[3], info[4]
else
return nil, nil, nil, nil
end
end
function EFL:EnhanceFriends_SetButton(button)
if button.buttonType == FRIENDS_BUTTON_TYPE_WOW then
local name, level, class, area, connected, status = GetFriendInfo(button.id)
if not name then return end
button.nameText = name
button.TYPE = connected and "Online" or "Offline"
button.statusType = status
if connected then
if not EnhancedFriendsListDB[E.myrealm][name] then
EnhancedFriendsListDB[E.myrealm][name] = {}
end
EnhancedFriendsListDB[E.myrealm][name] = {level, class, area, format("%i", time())}
else
local lastSeen, lastArea
level, class, lastArea, lastSeen = self:GetLocalFriendInfo(name)
area = lastArea or area
button.lastSeen = lastSeen
end
button.levelText = level
button.class = class
button.area = area
self:Update_Background(button)
self:Update_Status(button)
self:Update_IconFrame(button)
self:Update_Name(button)
self:Update_Highlight(button)
end
end
function EFL:FriendsFrameStatusDropDown_Update()
local status = (StatusIcons[E.db.enhanceFriendsList.statusIcons][(UnitIsDND("Player") and "DND" or UnitIsAFK("Player") and "AFK" or "Online")])
FriendsFrameStatusDropDownStatus:SetTexture(status)
end
function EFL:FriendListUpdate()
self.db = E.db.enhanceFriendsList
if ElvCharacterDB.EnhancedFriendsList_Data then
for i = 1, GetNumFriends() do
local name, level, class, area, connected, status = GetFriendInfo(i)
if ElvCharacterDB.EnhancedFriendsList_Data[name] then
local data = ElvCharacterDB.EnhancedFriendsList_Data[name]
if not EnhancedFriendsListDB[E.myrealm][name] then
EnhancedFriendsListDB[E.myrealm][name] = {}
end
EnhancedFriendsListDB[E.myrealm][name] = {data.level, data.class, data.area, data.lastSeen}
end
end
ElvCharacterDB.EnhancedFriendsList_Data = nil
end
for i = 1, #FriendsFrameFriendsScrollFrame.buttons do
local button = FriendsFrameFriendsScrollFrame.buttons[i]
self:Construct_IconFrame(button)
self:Construct_Background(button)
button.background:Hide()
self:Construct_Highlight(button)
button.highlight:SetVertexColor(0, 0, 0, 0)
end
self:Update()
self:SecureHook("FriendsFrameStatusDropDown_Update")
self:SecureHook(FriendsFrameFriendsScrollFrame, "buttonFunc", "EnhanceFriends_SetButton")
end
function EFL:Initialize()
EP:RegisterPlugin(addonName, self.InsertOptions)
if not EnhancedFriendsListDB then
EnhancedFriendsListDB = {}
end
if not EnhancedFriendsListDB[E.myrealm] then
EnhancedFriendsListDB[E.myrealm] = {}
end
self:FriendListUpdate()
end
local function InitializeCallback()
EFL:Initialize()
end
E:RegisterModule(EFL:GetName(), InitializeCallback)
@@ -0,0 +1,11 @@
## Interface: 30300
## Author: Apollyon, Bunny
## Version: 1.09
## Title: |cff1784d1E|r|cffe5e3e3lvUI|r |cff1784d1E|r|cffe5e3e3nhanced|r |cff1784d1F|r|cffe5e3e3riends|r |cff1784d1L|r|cffe5e3e3ist|r
## SavedVariables: EnhancedFriendsListDB
## RequiredDeps: ElvUI
Locales\Load_Locales.xml
Settings\Load_Settings.xml
ElvUI_EnhancedFriendsList.lua
Config\Load_Config.xml
@@ -0,0 +1,32 @@
-- Chinese localization file for zhCN.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI")
local L = AceLocale:NewLocale("ElvUI", "zhCN")
if not L then return end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
@@ -0,0 +1,32 @@
-- English localization file for enUS and enGB.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI");
local L = AceLocale:NewLocale("ElvUI", "enUS", true, true);
if not L then return; end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
@@ -0,0 +1,32 @@
-- French localization file for frFR.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI");
local L = AceLocale:NewLocale("ElvUI", "frFR");
if not L then return; end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
@@ -0,0 +1,32 @@
-- German localization file for deDE.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI")
local L = AceLocale:NewLocale("ElvUI", "deDE")
if not L then return end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
@@ -0,0 +1,32 @@
-- Korean localization file for koKR.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI")
local L = AceLocale:NewLocale("ElvUI", "koKR")
if not L then return end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
@@ -0,0 +1,11 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="English.lua"/>
<Script file="French.lua"/>
<Script file="Russian.lua"/>
<Script file="German.lua"/>
<Script file="Taiwanese.lua"/>
<Script file="Spanish.lua"/>
<Script file="Korean.lua"/>
<Script file="Chinese.lua"/>
<Script file="Portuguese.lua"/>
</Ui>
@@ -0,0 +1,32 @@
-- Portuguese localization file for ptBR.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI")
local L = AceLocale:NewLocale("ElvUI", "ptBR")
if not L then return end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
@@ -0,0 +1,32 @@
-- Russian localization file for ruRU.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI")
local L = AceLocale:NewLocale("ElvUI", "ruRU")
if not L then return; end
L["LEVEL_TEMPLATE"] = "%s-го уровня";
L["SHORT_LEVEL_TEMPLATE"] = "%s-го ур.";
L["Class Icon"] = "Иконка класса";
L["Class Icon Status Color"] = true;
L["Class Text"] = "Текст класса";
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = "Последний вход";
L["Last seen"] = "Не всети";
L["Level Range Color"] = true;
L["Level Text"] = "Текст уровня";
L["Level"] = "Уровень";
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = "Короткий текст уровеня";
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = "Шрифт локации";
L["Zone Text"] = "Текст локации";
@@ -0,0 +1,32 @@
-- Spanish localization file for esES and esMX.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI")
local L = AceLocale:NewLocale("ElvUI", "esES") or AceLocale:NewLocale("ElvUI", "esMX")
if not L then return end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
@@ -0,0 +1,32 @@
-- Taiwanese localization file for zhTW.
local AceLocale = LibStub:GetLibrary("AceLocale-3.0-ElvUI")
local L = AceLocale:NewLocale("ElvUI", "zhTW")
if not L then return end
L["LEVEL_TEMPLATE"] = "Level %s";
L["SHORT_LEVEL_TEMPLATE"] = "L %s";
L["Class Icon"] = true;
L["Class Icon Status Color"] = true;
L["Class Text"] = true;
L["Colorize Name Only"] = true;
L["Enhanced Friends List"] = true;
L["Enhanced Name"] = true;
L["Enhanced Zone Color"] = true;
L["Enhanced Zone"] = true;
L["Friends that are in the same area as you, have their zone info colorized green."] = true;
L["Last Seen"] = true;
L["Last seen"] = true;
L["Level Range Color"] = true;
L["Level Text"] = true;
L["Level"] = true;
L["Offline Friends"] = true;
L["Online Friends"] = true;
L["Same Zone Color"] = true;
L["Same Zone"] = true;
L["Short Level"] = true;
L["Show Background"] = true;
L["Show Status Icon"] = true;
L["Status Icons Textures"] = true;
L["Zone Font"] = true;
L["Zone Text"] = true;
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Profile.lua"/>
</Ui>
@@ -0,0 +1,44 @@
local E, L, V, P, G = unpack(ElvUI)
-- Profile
P["enhanceFriendsList"] = {
-- General
["showBackground"] = true,
["showStatusIcon"] = true,
["statusIcons"] = "Default",
["nameFont"] = "PT Sans Narrow",
["nameFontSize"] = 12,
["nameFontOutline"] = "NONE",
["zoneFont"] = "PT Sans Narrow",
["zoneFontSize"] = 12,
["zoneFontOutline"] = "NONE",
["Online"] = {
["enhancedName"] = false,
["colorizeNameOnly"] = false,
["enhancedZone"] = false,
["enhancedZoneColor"] = {r = 1, g = 0.96, b = 0.45},
["classText"] = true,
["level"] = true,
["levelColor"] = false,
["levelText"] = true,
["shortLevel"] = false,
["zoneText"] = true,
["sameZone"] = false,
["sameZoneColor"] = {r = 0.3, g = 1.0, b = 0.3},
["classIcon"] = false,
["classIconStatusColor"] = false,
},
["Offline"] = {
["enhancedName"] = false,
["colorizeNameOnly"] = false,
["classText"] = false,
["level"] = false,
["levelColor"] = false,
["levelText"] = false,
["shortLevel"] = false,
["zoneText"] = true,
["lastSeen"] = true,
["classIcon"] = false,
}
}