Skip to content

Commit

Permalink
Cleanup ExpandButton
Browse files Browse the repository at this point in the history
  • Loading branch information
Luckyone961 committed Apr 13, 2024
1 parent a9244d2 commit 8569b2d
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions ElvUI/Cata/Modules/Skins/Character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ function S:CharacterFrame()

-- Expand Button
local CharacterFrameExpandButton = _G.CharacterFrameExpandButton
S:HandleNextPrevButton(CharacterFrameExpandButton, nil, nil, nil, nil, nil, 28) -- Default UI button size is 32
S:HandleNextPrevButton(CharacterFrameExpandButton, nil, nil, nil, nil, nil, 26) -- Default UI button size is 32
CharacterFrameExpandButton:ClearAllPoints()
CharacterFrameExpandButton:Point('BOTTOMRIGHT', _G.CharacterFrameInset, 'BOTTOMRIGHT', -3, 2)

CharacterFrameExpandButton:SetNormalTexture(E.Media.Textures.ArrowUp)
CharacterFrameExpandButton.SetNormalTexture = E.noop
Expand All @@ -372,18 +374,14 @@ function S:CharacterFrame()
expandButtonNormal:SetRotation(expandButtonCvar and -1.57 or 1.57)
expandButtonPushed:SetRotation(expandButtonCvar and -1.57 or 1.57)

-- Not sure if there is a better method to hook Mixin funcs
local function HookCollapseExpand(self)
hooksecurefunc(self, 'Collapse', function()
expandButtonNormal:SetRotation(-1.57)
expandButtonPushed:SetRotation(-1.57)
end)
hooksecurefunc(self, 'Expand', function()
expandButtonNormal:SetRotation(1.57)
expandButtonPushed:SetRotation(1.57)
end)
end
HookCollapseExpand(CharacterFrame)
hooksecurefunc(CharacterFrame, 'Collapse', function()
expandButtonNormal:SetRotation(-1.57)
expandButtonPushed:SetRotation(-1.57)
end)
hooksecurefunc(CharacterFrame, 'Expand', function()
expandButtonNormal:SetRotation(1.57)
expandButtonPushed:SetRotation(1.57)
end)

-- Pet Frame
S:HandleStatusBar(_G.PetPaperDollFrameExpBar)
Expand Down

0 comments on commit 8569b2d

Please sign in to comment.