Skip to content

Commit

Permalink
clean up friends skin
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Nov 14, 2024
1 parent 52192bb commit fff960f
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 128 deletions.
82 changes: 31 additions & 51 deletions ElvUI/Cata/Modules/Skins/Friends.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local unpack, pairs = unpack, pairs

local BNConnected = BNConnected
local BNFeaturesEnabled = BNFeaturesEnabled
local GetNumSubgroupMembers = GetNumSubgroupMembers
local GetQuestDifficultyColor = GetQuestDifficultyColor
local hooksecurefunc = hooksecurefunc

Expand All @@ -26,9 +25,7 @@ function S:FriendsFrame()
-- Friends Frame
local FriendsFrame = _G.FriendsFrame
S:HandleFrame(FriendsFrame, true, nil, -5, 0, -2)

_G.FriendsFrameCloseButton:Point('TOPRIGHT', 0, 2)

S:HandleDropDownBox(_G.FriendsFrameStatusDropdown, 70)
_G.FriendsFrameStatusDropdown:PointXY(256, -55)

Expand All @@ -55,35 +52,32 @@ function S:FriendsFrame()

for i = 1, _G.FRIENDS_FRIENDS_TO_DISPLAY do
local button = 'FriendsFrameFriendsScrollFrameButton'..i
local btn = _G[button]

_G[button..'SummonButtonIcon']:SetTexCoord(unpack(E.TexCoords))
_G[button..'SummonButtonNormalTexture']:SetAlpha(0)
_G[button..'SummonButton']:StyleButton()
_G[button].highlight:SetTexture(E.Media.Textures.Highlight)
_G[button].highlight:SetAlpha(0.3)
btn.highlight:SetTexture(E.Media.Textures.Highlight)
btn.highlight:SetAlpha(0.3)
end

for i = 1, _G.FRIENDS_FRIENDS_TO_DISPLAY do
S:HandleButtonHighlight(_G['FriendsFriendsButton'..i])
end

S:HandleScrollBar(_G.FriendsFrameFriendsScrollFrameScrollBar)

S:HandleButton(_G.AddFriendEntryFrameAcceptButton)
S:HandleButton(_G.AddFriendEntryFrameCancelButton)
S:HandleButton(_G.FriendsFrameAddFriendButton)
S:HandleButton(_G.FriendsFrameSendMessageButton)
S:HandleButton(_G.FriendsFrameUnsquelchButton)

_G.FriendsFrameAddFriendButton:PointXY(-1, 4)

-- Battle.net
local FriendsFrameBattlenetFrame = _G.FriendsFrameBattlenetFrame
FriendsFrameBattlenetFrame:StripTextures()
FriendsFrameBattlenetFrame:GetRegions():Hide()

FriendsFrameBattlenetFrame.UnavailableInfoFrame:Point('TOPLEFT', FriendsFrame, 'TOPRIGHT', 1, -18)

FriendsFrameBattlenetFrame.Tag:SetParent(_G.FriendsListFrame)
FriendsFrameBattlenetFrame.Tag:Point('TOP', FriendsFrame, 'TOP', 0, -8)

Expand All @@ -99,7 +93,6 @@ function S:FriendsFrame()

hooksecurefunc('FriendsFrame_CheckBattlenetStatus', function()
if BNFeaturesEnabled() then

FriendsFrameBattlenetFrame.BroadcastButton:Hide()

if BNConnected() then
Expand All @@ -121,17 +114,14 @@ function S:FriendsFrame()
end)

S:HandleEditBox(_G.AddFriendNameEditBox)

_G.AddFriendFrame:SetTemplate('Transparent')

-- Pending invites
_G.FriendsFrameFriendsScrollFrame:StripTextures()

S:HandleButton(_G.FriendsFrameFriendsScrollFrame.PendingInvitesHeaderButton, true)

_G.FriendsFrameFriendsScrollFrame.PendingInvitesHeaderButton:SetScript('OnMouseUp', nil)
_G.FriendsFrameFriendsScrollFrame.PendingInvitesHeaderButton:SetScript('OnMouseDown', nil)

_G.FriendsFrameFriendsScrollFrame.PendingInvitesHeaderButton.RightArrow:SetTexture(E.Media.Textures.ArrowUp)
_G.FriendsFrameFriendsScrollFrame.PendingInvitesHeaderButton.RightArrow:SetRotation(S.ArrowRotation['right'])
_G.FriendsFrameFriendsScrollFrame.PendingInvitesHeaderButton.DownArrow:SetTexture(E.Media.Textures.ArrowUp)
Expand All @@ -154,19 +144,14 @@ function S:FriendsFrame()

S:HandleButton(_G.FriendsFriendsCloseButton)
S:HandleButton(_G.FriendsFriendsSendRequestButton)

S:HandleEditBox(_G.FriendsFriendsList)

S:HandleScrollBar(_G.FriendsFriendsScrollFrameScrollBar)

S:HandleDropDownBox(_G.FriendsFriendsFrameDropdown, 150)

-- Ignore List Frame
_G.IgnoreListFrame:StripTextures()

S:HandleButton(_G.FriendsFrameIgnorePlayerButton, true)
S:HandleButton(_G.FriendsFrameUnsquelchButton, true)

S:HandleScrollBar(_G.FriendsFrameIgnoreScrollFrameScrollBar)

-- Who Frame
Expand Down Expand Up @@ -216,7 +201,7 @@ function S:FriendsFrame()
local button = _G['WhoFrameButton'..i]
local level = _G['WhoFrameButton'..i..'Level']
local name = _G['WhoFrameButton'..i..'Name']
local class = _G['WhoFrameButton'..i..'Class']
local className = _G['WhoFrameButton'..i..'Class']

button.icon = button:CreateTexture('$parentIcon', 'ARTWORK')
button.icon:Point('LEFT', 45, 0)
Expand All @@ -233,7 +218,7 @@ function S:FriendsFrame()
name:ClearAllPoints()
name:SetPoint('LEFT', 85, 0)

class:Hide()
className:Hide()
end

hooksecurefunc('WhoList_Update', function()
Expand All @@ -245,31 +230,32 @@ function S:FriendsFrame()
end

local playerZone = E.MapInfo.realZoneText
local classTextColor, levelTextColor

for i = 1, numWhos do
local button = _G['WhoFrameButton'..i]
local info = C_FriendList_GetWhoInfo(button.whoIndex)

if info.filename then
classTextColor = E:ClassColor(info.filename)
button.icon:Show()
button.icon:SetTexCoord(E:GetClassCoords(info.filename))
else
classTextColor = _G.HIGHLIGHT_FONT_COLOR
button.icon:Hide()
end

levelTextColor = GetQuestDifficultyColor(info.level)

_G['WhoFrameButton'..i..'Name']:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b)
_G['WhoFrameButton'..i..'Level']:SetTextColor(levelTextColor.r, levelTextColor.g, levelTextColor.b)
_G['WhoFrameButton'..i..'Class']:SetTextColor(1, 1, 1)

if info.area == playerZone then
_G['WhoFrameButton'..i..'Variable']:SetTextColor(0, 1, 0)
else
_G['WhoFrameButton'..i..'Variable']:SetTextColor(1, 1, 1)
if button and button.whoIndex then
local info = C_FriendList_GetWhoInfo(button.whoIndex)
if info.filename then
local classTextColor = E:ClassColor(info.filename)
_G['WhoFrameButton'..i..'Name']:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b)

button.icon:Show()
button.icon:SetTexCoord(E:GetClassCoords(info.filename))
else
local classTextColor = _G.HIGHLIGHT_FONT_COLOR
_G['WhoFrameButton'..i..'Name']:SetTextColor(classTextColor.r, classTextColor.g, classTextColor.b)

button.icon:Hide()
end

local levelTextColor = GetQuestDifficultyColor(info.level)
_G['WhoFrameButton'..i..'Level']:SetTextColor(levelTextColor.r, levelTextColor.g, levelTextColor.b)
_G['WhoFrameButton'..i..'Class']:SetTextColor(1, 1, 1)

if info.area == playerZone then
_G['WhoFrameButton'..i..'Variable']:SetTextColor(0, 1, 0)
else
_G['WhoFrameButton'..i..'Variable']:SetTextColor(1, 1, 1)
end
end
end
end)
Expand All @@ -282,19 +268,13 @@ function S:FriendsFrame()
-- Raid Info Frame
_G.RaidInfoFrame:StripTextures(true)
_G.RaidInfoFrame:CreateBackdrop('Transparent')

_G.RaidInfoFrame:HookScript('OnShow', function()
if GetNumSubgroupMembers() > 0 then
_G.RaidInfoFrame:Point('TOPLEFT', _G.RaidFrame, 'TOPRIGHT', 0, 0)
else
_G.RaidInfoFrame:Point('TOPLEFT', _G.RaidFrame, 'TOPRIGHT', 0, 0)
end
_G.RaidInfoFrame:Point('TOPLEFT', _G.RaidFrame, 'TOPRIGHT', 0, 0)
end)

S:HandleCloseButton(_G.RaidInfoCloseButton, _G.RaidInfoFrame)

_G.RaidInfoScrollFrame:StripTextures()
S:HandleScrollBar(_G.RaidInfoScrollFrameScrollBar)
S:HandleCloseButton(_G.RaidInfoCloseButton, _G.RaidInfoFrame)

_G.RaidInfoInstanceLabel:SetTemplate()
_G.RaidInfoIDLabel:SetTemplate()
Expand Down
Loading

0 comments on commit fff960f

Please sign in to comment.