Skip to content

Commit

Permalink
Merge branch 'main' into ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Oct 26, 2024
2 parents 110c029 + 589015b commit fd89c3d
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 106 deletions.
80 changes: 43 additions & 37 deletions ElvUI/Cata/Modules/Skins/Channels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,54 @@ local S = E:GetModule('Skins')
local _G = _G
local hooksecurefunc = hooksecurefunc

local function ButtonHeader_Update(header)
local r, g, b = unpack(E.media.rgbvaluecolor)
header.HighlightTexture:SetColorTexture(r, g, b, 0.25)
header.HighlightTexture:SetInside()
header.NormalTexture:SetTexture()
header:SetTemplate('Transparent')
end

function S:Blizzard_Channels()
if not (E.private.skins.blizzard.enable and E.private.skins.blizzard.channels) then return end

local ChannelFrame = _G.ChannelFrame
S:HandleFrame(ChannelFrame, true, nil, -5)

S:HandleButton(ChannelFrame.NewButton)
S:HandleButton(ChannelFrame.SettingsButton)

ChannelFrame.NewButton:PointXY(-1, 4)
_G.ChannelFrameCloseButton:PointXY(2, 2)

-- ScrollBars
S:HandleScrollBar(ChannelFrame.ChannelRoster.ScrollFrame.scrollBar)
ChannelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('TOPLEFT', ChannelFrame.ChannelRoster.ScrollFrame, 'TOPRIGHT', 1, -13)
ChannelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('BOTTOMLEFT', ChannelFrame.ChannelRoster.ScrollFrame, 'BOTTOMRIGHT', 1, 13)

S:HandleScrollBar(ChannelFrame.ChannelList.ScrollBar)
ChannelFrame.ChannelList.ScrollBar:Point('BOTTOMLEFT', ChannelFrame.ChannelList, 'BOTTOMRIGHT', 0, 15)

-- Popups
local CreateChannelPopup = _G.CreateChannelPopup
S:HandleFrame(CreateChannelPopup, true)

S:HandleButton(CreateChannelPopup.OKButton)
S:HandleButton(CreateChannelPopup.CancelButton)

S:HandleEditBox(CreateChannelPopup.Name)
S:HandleEditBox(CreateChannelPopup.Password)

CreateChannelPopup.CloseButton:PointXY(2, 2)

local VoiceChatPromptActivateChannel = _G.VoiceChatPromptActivateChannel
S:HandleFrame(VoiceChatPromptActivateChannel, true)
S:HandleButton(VoiceChatPromptActivateChannel.AcceptButton)
S:HandleCloseButton(VoiceChatPromptActivateChannel.CloseButton, VoiceChatPromptActivateChannel.backrop)
local channelFrame = _G.ChannelFrame
if channelFrame then
S:HandleFrame(channelFrame, true, nil, -5)
S:HandleButton(channelFrame.SettingsButton)
S:HandleButton(channelFrame.NewButton)
channelFrame.NewButton:PointXY(-1, 4)
_G.ChannelFrameCloseButton:PointXY(2, 2)
S:HandleScrollBar(channelFrame.ChannelRoster.ScrollFrame.scrollBar)
channelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('TOPLEFT', channelFrame.ChannelRoster.ScrollFrame, 'TOPRIGHT', 1, -13)
channelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('BOTTOMLEFT', channelFrame.ChannelRoster.ScrollFrame, 'BOTTOMRIGHT', 1, 13)

local channelList = channelFrame.ChannelList
if channelList then
S:HandleScrollBar(channelFrame.ChannelList.ScrollBar)
channelFrame.ChannelList.ScrollBar:Point('BOTTOMLEFT', channelFrame.ChannelList, 'BOTTOMRIGHT', 0, 15)
end
end

local createChannelPopup = _G.CreateChannelPopup
if createChannelPopup then
S:HandleFrame(createChannelPopup, true)
S:HandleButton(createChannelPopup.OKButton)
S:HandleButton(createChannelPopup.CancelButton)
S:HandleEditBox(createChannelPopup.Name)
S:HandleEditBox(createChannelPopup.Password)
createChannelPopup.CloseButton:PointXY(2, 2)
end

local voiceChatPrompt = _G.VoiceChatPromptActivateChannel
if voiceChatPrompt then
S:HandleFrame(voiceChatPrompt, true)
S:HandleButton(voiceChatPrompt.AcceptButton)
S:HandleCloseButton(voiceChatPrompt.CloseButton, voiceChatPrompt.backrop)
end

-- Hide the Channel Header Textures
hooksecurefunc(_G.ChannelButtonHeaderMixin, 'Update', function(s)
s:SetTemplate('Transparent')
s.NormalTexture:SetTexture()
end)
hooksecurefunc(_G.ChannelButtonHeaderMixin, 'Update', ButtonHeader_Update)
end

S:AddCallbackForAddon('Blizzard_Channels')
80 changes: 43 additions & 37 deletions ElvUI/Classic/Modules/Skins/Channels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,54 @@ local S = E:GetModule('Skins')
local _G = _G
local hooksecurefunc = hooksecurefunc

local function ButtonHeader_Update(header)
local r, g, b = unpack(E.media.rgbvaluecolor)
header.HighlightTexture:SetColorTexture(r, g, b, 0.25)
header.HighlightTexture:SetInside()
header.NormalTexture:SetTexture()
header:SetTemplate('Transparent')
end

function S:Blizzard_Channels()
if not (E.private.skins.blizzard.enable and E.private.skins.blizzard.channels) then return end

local ChannelFrame = _G.ChannelFrame
S:HandleFrame(ChannelFrame, true, nil, -5)

S:HandleButton(ChannelFrame.NewButton)
S:HandleButton(ChannelFrame.SettingsButton)

ChannelFrame.NewButton:PointXY(-1, 4)
_G.ChannelFrameCloseButton:PointXY(2, 2)

-- ScrollBars
S:HandleScrollBar(ChannelFrame.ChannelRoster.ScrollFrame.scrollBar)
ChannelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('TOPLEFT', ChannelFrame.ChannelRoster.ScrollFrame, 'TOPRIGHT', 1, -13)
ChannelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('BOTTOMLEFT', ChannelFrame.ChannelRoster.ScrollFrame, 'BOTTOMRIGHT', 1, 13)

S:HandleScrollBar(ChannelFrame.ChannelList.ScrollBar)
ChannelFrame.ChannelList.ScrollBar:Point('BOTTOMLEFT', ChannelFrame.ChannelList, 'BOTTOMRIGHT', 0, 15)

-- Popups
local CreateChannelPopup = _G.CreateChannelPopup
S:HandleFrame(CreateChannelPopup, true)

S:HandleButton(CreateChannelPopup.OKButton)
S:HandleButton(CreateChannelPopup.CancelButton)

S:HandleEditBox(CreateChannelPopup.Name)
S:HandleEditBox(CreateChannelPopup.Password)

CreateChannelPopup.CloseButton:PointXY(2, 2)

local VoiceChatPromptActivateChannel = _G.VoiceChatPromptActivateChannel
S:HandleFrame(VoiceChatPromptActivateChannel, true)
S:HandleButton(VoiceChatPromptActivateChannel.AcceptButton)
S:HandleCloseButton(VoiceChatPromptActivateChannel.CloseButton, VoiceChatPromptActivateChannel.backrop)
local channelFrame = _G.ChannelFrame
if channelFrame then
S:HandleFrame(channelFrame, true, nil, -5)
S:HandleButton(channelFrame.SettingsButton)
S:HandleButton(channelFrame.NewButton)
channelFrame.NewButton:PointXY(-1, 4)
_G.ChannelFrameCloseButton:PointXY(2, 2)
S:HandleScrollBar(channelFrame.ChannelRoster.ScrollFrame.scrollBar)
channelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('TOPLEFT', channelFrame.ChannelRoster.ScrollFrame, 'TOPRIGHT', 1, -13)
channelFrame.ChannelRoster.ScrollFrame.scrollBar:Point('BOTTOMLEFT', channelFrame.ChannelRoster.ScrollFrame, 'BOTTOMRIGHT', 1, 13)

local channelList = channelFrame.ChannelList
if channelList then
S:HandleScrollBar(channelFrame.ChannelList.ScrollBar)
channelFrame.ChannelList.ScrollBar:Point('BOTTOMLEFT', channelFrame.ChannelList, 'BOTTOMRIGHT', 0, 15)
end
end

local createChannelPopup = _G.CreateChannelPopup
if createChannelPopup then
S:HandleFrame(createChannelPopup, true)
S:HandleButton(createChannelPopup.OKButton)
S:HandleButton(createChannelPopup.CancelButton)
S:HandleEditBox(createChannelPopup.Name)
S:HandleEditBox(createChannelPopup.Password)
createChannelPopup.CloseButton:PointXY(2, 2)
end

local voiceChatPrompt = _G.VoiceChatPromptActivateChannel
if voiceChatPrompt then
S:HandleFrame(voiceChatPrompt, true)
S:HandleButton(voiceChatPrompt.AcceptButton)
S:HandleCloseButton(voiceChatPrompt.CloseButton, voiceChatPrompt.backrop)
end

-- Hide the Channel Header Textures
hooksecurefunc(_G.ChannelButtonHeaderMixin, 'Update', function(s)
s:SetTemplate('Transparent')
s.NormalTexture:SetTexture()
end)
hooksecurefunc(_G.ChannelButtonHeaderMixin, 'Update', ButtonHeader_Update)
end

S:AddCallbackForAddon('Blizzard_Channels')
78 changes: 46 additions & 32 deletions ElvUI/Mainline/Modules/Skins/Channels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,59 @@ local E, L, V, P, G = unpack(ElvUI)
local S = E:GetModule('Skins')

local _G = _G
local unpack = unpack
local hooksecurefunc = hooksecurefunc

local function ButtonHeader_Update(header)
local r, g, b = unpack(E.media.rgbvaluecolor)
header.HighlightTexture:SetColorTexture(r, g, b, 0.25)
header.HighlightTexture:SetInside()
header.NormalTexture:SetTexture()
header:SetTemplate('Transparent')
end

function S:Blizzard_Channels()
if not (E.private.skins.blizzard.enable and E.private.skins.blizzard.channels) then return end

local ChannelFrame = _G.ChannelFrame
local CreateChannelPopup = _G.CreateChannelPopup

S:HandlePortraitFrame(ChannelFrame)
CreateChannelPopup:StripTextures()
CreateChannelPopup:SetTemplate('Transparent')

S:HandleButton(ChannelFrame.SettingsButton) -- using -4, 4
S:HandleButton(ChannelFrame.NewButton)
ChannelFrame.NewButton:ClearAllPoints()
ChannelFrame.NewButton:Point('BOTTOMLEFT', ChannelFrame, 4, 4) -- make it match settings button

S:HandleTrimScrollBar(ChannelFrame.ChannelRoster.ScrollBar)

S:HandleTrimScrollBar(ChannelFrame.ChannelList.ScrollBar)
ChannelFrame.ChannelList.ScrollBar:Point('BOTTOMLEFT', ChannelFrame.ChannelList, 'BOTTOMRIGHT', 0, 15)

S:HandleCloseButton(CreateChannelPopup.CloseButton)
S:HandleButton(CreateChannelPopup.OKButton)
S:HandleButton(CreateChannelPopup.CancelButton)

S:HandleEditBox(CreateChannelPopup.Name)
S:HandleEditBox(CreateChannelPopup.Password)

_G.VoiceChatPromptActivateChannel:StripTextures()
_G.VoiceChatPromptActivateChannel:SetTemplate('Transparent')
S:HandleButton(_G.VoiceChatPromptActivateChannel.AcceptButton)
S:HandleCloseButton(_G.VoiceChatPromptActivateChannel.CloseButton)
local channelFrame = _G.ChannelFrame
if channelFrame then
S:HandlePortraitFrame(channelFrame)
S:HandleButton(channelFrame.SettingsButton) -- using -4, 4
S:HandleTrimScrollBar(channelFrame.ChannelRoster.ScrollBar)
S:HandleButton(channelFrame.NewButton)
channelFrame.NewButton:ClearAllPoints()
channelFrame.NewButton:Point('BOTTOMLEFT', channelFrame, 4, 4) -- make it match settings button

local channelList = channelFrame.ChannelList
if channelList then
S:HandleTrimScrollBar(channelList.ScrollBar)
channelList.ScrollBar:Point('BOTTOMLEFT', channelList, 'BOTTOMRIGHT', 0, 15)
end
end

local createChannelPopup = _G.CreateChannelPopup
if createChannelPopup then
createChannelPopup:StripTextures()
createChannelPopup:SetTemplate('Transparent')
createChannelPopup.Header:StripTextures()

S:HandleCloseButton(createChannelPopup.CloseButton)
S:HandleButton(createChannelPopup.OKButton)
S:HandleButton(createChannelPopup.CancelButton)
S:HandleEditBox(createChannelPopup.Name)
S:HandleEditBox(createChannelPopup.Password)
end

local voiceChatPrompt = _G.VoiceChatPromptActivateChannel
if voiceChatPrompt then
voiceChatPrompt:StripTextures()
voiceChatPrompt:SetTemplate('Transparent')
S:HandleButton(voiceChatPrompt.AcceptButton)
S:HandleCloseButton(voiceChatPrompt.CloseButton)
end

-- Hide the Channel Header Textures
hooksecurefunc(_G.ChannelButtonHeaderMixin, 'Update', function(s)
s:SetTemplate('Transparent')
s.NormalTexture:SetTexture()
end)
hooksecurefunc(_G.ChannelButtonHeaderMixin, 'Update', ButtonHeader_Update)
end

S:AddCallbackForAddon('Blizzard_Channels')

0 comments on commit fd89c3d

Please sign in to comment.