Skip to content

Commit a82eb9c

Browse files
committed
Merge branch 'main' into ptr
2 parents ca4cfdf + 9d49074 commit a82eb9c

File tree

16 files changed

+350
-262
lines changed

16 files changed

+350
-262
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<Ui xmlns='http://www.blizzard.com/wow/ui/'>
2+
<Script file='..\..\..\Core\Modules\ActionBars\ExtraAB.lua'/>
23
<Script file='TotemBar.lua'/>
34
</Ui>

ElvUI/Cata/Modules/Skins/Collectables.lua

+6
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ local function SkinPetFrame()
287287
S:HandleTrimScrollBar(_G.PetJournal.ScrollBar)
288288
hooksecurefunc(PetJournal.ScrollBox, 'Update', JournalScrollButtons)
289289

290+
_G.PetJournalPetCard:StripTextures()
291+
_G.PetJournalPetCard.ShadowOverlay:StripTextures()
292+
293+
S:HandleRotateButton(_G.PetJournalPetCard.modelScene.RotateLeftButton)
294+
S:HandleRotateButton(_G.PetJournalPetCard.modelScene.RotateRightButton)
295+
290296
_G.PetJournalPetCardPetInfo:CreateBackdrop()
291297
_G.PetJournalPetCardPetInfo.favorite:SetParent(_G.PetJournalPetCardPetInfo.backdrop)
292298
_G.PetJournalPetCardPetInfo.backdrop:SetOutside(_G.PetJournalPetCardPetInfoIcon)

ElvUI/Core/Defaults/Profile.lua

+1
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,7 @@ P.unitframe.units.boss.privateAuras.countdownNumbers = false
24722472
P.unitframe.units.boss.privateAuras.icon.size = 20
24732473
P.unitframe.units.boss.privateAuras.parent.point = 'CENTER'
24742474
P.unitframe.units.boss.castbar.width = 215
2475+
P.unitframe.units.boss.castbar.positionsGroup = {anchorPoint = 'BOTTOM', xOffset = 0, yOffset = 0}
24752476
P.unitframe.units.boss.debuffs.enable = true
24762477
P.unitframe.units.boss.debuffs.anchorPoint = 'LEFT'
24772478
P.unitframe.units.boss.debuffs.numrows = 1

ElvUI/Core/General/Core.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ function E:UpdateActionBars(skipCallback)
15381538
ActionBars:UpdateMicroButtons()
15391539
ActionBars:UpdatePetCooldownSettings()
15401540

1541-
if E.Retail then
1541+
if E.Retail or E.Cata then
15421542
ActionBars:UpdateExtraButtons()
15431543
end
15441544

ElvUI/Core/Modules/ActionBars/ActionBars.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,9 @@ function AB:Initialize()
17731773
AB.fadeParent:RegisterEvent('UPDATE_OVERRIDE_ACTIONBAR')
17741774
AB.fadeParent:RegisterEvent('UPDATE_POSSESS_BAR')
17751775
AB.fadeParent:RegisterEvent('PLAYER_CAN_GLIDE_CHANGED')
1776+
1777+
AB:RegisterEvent('PET_BATTLE_CLOSE', 'ReassignBindings')
1778+
AB:RegisterEvent('PET_BATTLE_OPENING_DONE', 'RemoveBindings')
17761779
end
17771780

17781781
if E.Retail or E.Cata then
@@ -1809,11 +1812,8 @@ function AB:Initialize()
18091812

18101813
AB:SetAuraCooldownDuration(E.db.cooldown.targetAuraDuration)
18111814

1812-
if E.Retail then
1813-
AB:SetupExtraButton()
1814-
1815-
AB:RegisterEvent('PET_BATTLE_CLOSE', 'ReassignBindings')
1816-
AB:RegisterEvent('PET_BATTLE_OPENING_DONE', 'RemoveBindings')
1815+
if E.Retail or E.Cata then
1816+
AB:SetupExtraButtons()
18171817
end
18181818

18191819
if (E.Cata and E.myclass == 'SHAMAN') and AB.db.totemBar.enable then
+295
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
local E, L, V, P, G = unpack(ElvUI)
2+
local AB = E:GetModule('ActionBars')
3+
4+
local _G = _G
5+
local pairs = pairs
6+
local unpack = unpack
7+
local tinsert = tinsert
8+
9+
local CreateFrame = CreateFrame
10+
local GetBindingKey = GetBindingKey
11+
local InCombatLockdown = InCombatLockdown
12+
local hooksecurefunc = hooksecurefunc
13+
14+
local ActionButton_UpdateCooldown = ActionButton_UpdateCooldown
15+
16+
local extraBtns, extraHooked, ExtraActionBarHolder, ZoneAbilityHolder = {}, {}
17+
18+
function AB:ExtraButtons_BossStyle(frame)
19+
local button = frame.button
20+
if button and not button.IsSkinned then
21+
AB:StyleButton(button, true) -- registers cooldown too
22+
23+
-- the cooldown is already fired sometimes?
24+
if ActionButton_UpdateCooldown then
25+
ActionButton_UpdateCooldown(button)
26+
end
27+
28+
button.icon:SetDrawLayer('ARTWORK', -1)
29+
button:SetTemplate()
30+
31+
button.holder = ExtraActionBarHolder
32+
button:HookScript('OnEnter', AB.ExtraButtons_OnEnter)
33+
button:HookScript('OnLeave', AB.ExtraButtons_OnLeave)
34+
35+
button.HotKey:SetText(GetBindingKey(button.commandName))
36+
37+
AB:FixKeybindText(button)
38+
AB:FixKeybindColor(button)
39+
40+
AB:ExtraButtons_BossAlpha(button)
41+
42+
tinsert(extraBtns, button)
43+
44+
button.IsSkinned = true
45+
end
46+
end
47+
48+
function AB:ExtraButtons_ZoneStyle()
49+
local zoneAlpha = AB:ExtraButtons_ZoneAlpha()
50+
for spellButton in self.SpellButtonContainer:EnumerateActive() do
51+
if spellButton then
52+
spellButton:SetAlpha(zoneAlpha)
53+
54+
if not spellButton.IsSkinned then
55+
spellButton.NormalTexture:SetAlpha(0)
56+
spellButton:StyleButton()
57+
spellButton:SetTemplate()
58+
59+
spellButton.Icon:SetDrawLayer('ARTWORK', -1)
60+
spellButton.Icon:SetTexCoord(unpack(E.TexCoords))
61+
spellButton.Icon:SetInside()
62+
63+
spellButton.holder = ZoneAbilityHolder
64+
spellButton:HookScript('OnEnter', AB.ExtraButtons_OnEnter)
65+
spellButton:HookScript('OnLeave', AB.ExtraButtons_OnLeave)
66+
67+
if spellButton.Cooldown then
68+
E:RegisterCooldown(spellButton.Cooldown, 'actionbar')
69+
spellButton.Cooldown:SetInside(spellButton)
70+
end
71+
72+
spellButton.IsSkinned = true
73+
end
74+
end
75+
end
76+
end
77+
78+
function AB:ExtraButtons_BossAlpha(button)
79+
local bossAlpha = E.db.actionbar.extraActionButton.alpha
80+
button:SetAlpha(bossAlpha or 1)
81+
82+
if button.style then
83+
button.style:SetAlpha(not E.db.actionbar.extraActionButton.clean and bossAlpha or 0)
84+
end
85+
end
86+
87+
function AB:ExtraButtons_ZoneAlpha()
88+
local zoneAlpha = E.db.actionbar.zoneActionButton.alpha
89+
_G.ZoneAbilityFrame.Style:SetAlpha(not E.db.actionbar.zoneActionButton.clean and zoneAlpha or 0)
90+
91+
return zoneAlpha
92+
end
93+
94+
function AB:ExtraButtons_OnEnter()
95+
if self.holder and self.holder:GetParent() == AB.fadeParent and not AB.fadeParent.mouseLock then
96+
E:UIFrameFadeIn(AB.fadeParent, 0.2, AB.fadeParent:GetAlpha(), 1)
97+
end
98+
99+
if self.buttonType == 'EXTRAACTIONBUTTON' then
100+
AB:BindUpdate(self)
101+
end
102+
end
103+
104+
function AB:ExtraButtons_OnLeave()
105+
if self.holder and self.holder:GetParent() == AB.fadeParent and not AB.fadeParent.mouseLock then
106+
E:UIFrameFadeOut(AB.fadeParent, 0.2, AB.fadeParent:GetAlpha(), 1 - AB.db.globalFadeAlpha)
107+
end
108+
end
109+
110+
function AB:ExtraButtons_GlobalFade()
111+
if ExtraActionBarHolder then
112+
ExtraActionBarHolder:SetParent(E.db.actionbar.extraActionButton.inheritGlobalFade and AB.fadeParent or E.UIParent)
113+
end
114+
115+
if ZoneAbilityHolder then
116+
ZoneAbilityHolder:SetParent(E.db.actionbar.zoneActionButton.inheritGlobalFade and AB.fadeParent or E.UIParent)
117+
end
118+
end
119+
120+
function AB:ExtraButtons_UpdateAlpha()
121+
if not E.private.actionbar.enable then return end
122+
123+
for _, button in pairs(extraBtns) do
124+
AB:ExtraButtons_BossAlpha(button)
125+
end
126+
127+
if _G.ZoneAbilityFrame then
128+
local zoneAlpha = AB:ExtraButtons_ZoneAlpha()
129+
for button in _G.ZoneAbilityFrame.SpellButtonContainer:EnumerateActive() do
130+
button:SetAlpha(zoneAlpha)
131+
end
132+
end
133+
end
134+
135+
function AB:ExtraButtons_UpdateScale()
136+
if not E.private.actionbar.enable then return end
137+
138+
if _G.ZoneAbilityFrame then
139+
AB:ExtraButtons_ZoneScale()
140+
end
141+
142+
if _G.ExtraActionBarFrame then
143+
local scale = E.db.actionbar.extraActionButton.scale
144+
_G.ExtraActionBarFrame:SetScale(scale * E.uiscale)
145+
_G.ExtraActionBarFrame:SetIgnoreParentScale(true)
146+
147+
local width, height = _G.ExtraActionBarFrame.button:GetSize()
148+
ExtraActionBarHolder:SetSize(width * scale, height * scale)
149+
end
150+
end
151+
152+
function AB:ExtraButtons_ZoneScale()
153+
if not E.private.actionbar.enable then return end
154+
155+
if _G.ZoneAbilityFrame then
156+
local scale = E.db.actionbar.zoneActionButton.scale
157+
_G.ZoneAbilityFrame.Style:SetScale(scale)
158+
_G.ZoneAbilityFrame.SpellButtonContainer:SetScale(scale)
159+
160+
local width, height = _G.ZoneAbilityFrame.SpellButtonContainer:GetSize()
161+
ZoneAbilityHolder:SetSize(width * scale, height * scale)
162+
end
163+
end
164+
165+
function AB:ExtraButtons_BossParent(parent)
166+
if parent ~= ExtraActionBarHolder and not AB.NeedsReparentExtraButtons then
167+
AB:ExtraButtons_Reparent()
168+
end
169+
end
170+
171+
function AB:ExtraButtons_ZoneParent(parent)
172+
if parent ~= ZoneAbilityHolder and not AB.NeedsReparentExtraButtons then
173+
AB:ExtraButtons_Reparent()
174+
end
175+
end
176+
177+
function AB:ExtraButtons_Reparent()
178+
if InCombatLockdown() then
179+
AB.NeedsReparentExtraButtons = true
180+
181+
AB:RegisterEvent('PLAYER_REGEN_ENABLED')
182+
183+
return
184+
end
185+
186+
if _G.ZoneAbilityFrame then
187+
_G.ZoneAbilityFrame:SetParent(ZoneAbilityHolder)
188+
end
189+
190+
if _G.ExtraActionBarFrame then
191+
_G.ExtraActionBarFrame:SetParent(ExtraActionBarHolder)
192+
end
193+
end
194+
195+
function AB:ExtraButtons_SetupBoss()
196+
local ExtraActionBarFrame = _G.ExtraActionBarFrame
197+
if not ExtraActionBarFrame then return end
198+
199+
if not extraHooked[ExtraActionBarFrame] then
200+
hooksecurefunc(ExtraActionBarFrame, 'SetParent', AB.ExtraButtons_BossParent)
201+
202+
extraHooked[ExtraActionBarFrame] = true
203+
end
204+
205+
ExtraActionBarFrame:ClearAllPoints()
206+
ExtraActionBarFrame:SetAllPoints()
207+
ExtraActionBarFrame.ignoreInLayout = true
208+
end
209+
210+
function AB:ExtraButtons_SetupZone()
211+
local ZoneAbilityFrame = _G.ZoneAbilityFrame
212+
if not ZoneAbilityFrame then return end
213+
214+
if not extraHooked[ZoneAbilityFrame] then
215+
ZoneAbilityFrame.SpellButtonContainer.holder = ZoneAbilityHolder
216+
ZoneAbilityFrame.SpellButtonContainer:HookScript('OnEnter', AB.ExtraButtons_OnEnter)
217+
ZoneAbilityFrame.SpellButtonContainer:HookScript('OnLeave', AB.ExtraButtons_OnLeave)
218+
219+
hooksecurefunc(ZoneAbilityFrame.SpellButtonContainer, 'SetSize', AB.ExtraButtons_ZoneScale)
220+
hooksecurefunc(ZoneAbilityFrame, 'UpdateDisplayedZoneAbilities', AB.ExtraButtons_ZoneStyle)
221+
hooksecurefunc(ZoneAbilityFrame, 'SetParent', AB.ExtraButtons_ZoneParent)
222+
223+
extraHooked[ZoneAbilityFrame] = true
224+
end
225+
226+
ZoneAbilityFrame:ClearAllPoints()
227+
ZoneAbilityFrame:SetAllPoints()
228+
ZoneAbilityFrame.ignoreInLayout = true
229+
230+
if ZoneAbilityHolder then
231+
ZoneAbilityHolder:Size(52 * E.db.actionbar.zoneActionButton.scale)
232+
end
233+
end
234+
235+
function AB:ExtraButtons_SetupAbility()
236+
local ExtraAbilityContainer = _G.ExtraAbilityContainer
237+
if not ExtraAbilityContainer then return end
238+
239+
if not extraHooked[ExtraAbilityContainer] then
240+
-- try to shutdown the container movement and taints
241+
ExtraAbilityContainer:KillEditMode()
242+
ExtraAbilityContainer:SetScript('OnShow', nil)
243+
ExtraAbilityContainer:SetScript('OnUpdate', nil)
244+
ExtraAbilityContainer.OnUpdate = nil -- remove BaseLayoutMixin.OnUpdate
245+
ExtraAbilityContainer.IsLayoutFrame = nil -- dont let it get readded
246+
247+
hooksecurefunc(ExtraAbilityContainer, 'AddFrame', AB.ExtraButtons_BossStyle)
248+
249+
extraHooked[ExtraAbilityContainer] = true
250+
end
251+
end
252+
253+
function AB:CreateExtraHolders()
254+
if not ExtraActionBarHolder then
255+
ExtraActionBarHolder = CreateFrame('Frame', 'ElvUI_ExtraActionBarHolder', E.UIParent)
256+
ExtraActionBarHolder:Point('BOTTOM', E.UIParent, 'BOTTOM', -150, 300)
257+
E.FrameLocks[ExtraActionBarHolder] = true
258+
259+
E:CreateMover(ExtraActionBarHolder, 'BossButton', L["Boss Button"], nil, nil, nil, 'ALL,ACTIONBARS', nil, 'actionbar,extraButtons,extraActionButton')
260+
end
261+
262+
if not ZoneAbilityHolder then
263+
ZoneAbilityHolder = CreateFrame('Frame', 'ElvUI_ZoneAbilityHolder', E.UIParent)
264+
ZoneAbilityHolder:Point('BOTTOM', E.UIParent, 'BOTTOM', 150, 300)
265+
E.FrameLocks[ZoneAbilityHolder] = true
266+
267+
E:CreateMover(ZoneAbilityHolder, 'ZoneAbility', L["Zone Ability"], nil, nil, nil, 'ALL,ACTIONBARS', nil, 'actionbar,extraButtons,extraActionButton')
268+
end
269+
end
270+
271+
function AB:SetupExtraButtons()
272+
AB:CreateExtraHolders() -- make the holders
273+
AB:ExtraButtons_Reparent() -- reparent to the holders (keep before setup)
274+
AB:ExtraButtons_SetupBoss() -- attach boss
275+
AB:ExtraButtons_SetupZone() -- attach zone
276+
AB:ExtraButtons_SetupAbility() -- attach abilities
277+
AB:UpdateExtraButtons() -- update the settings
278+
end
279+
280+
function AB:UpdateExtraButtons()
281+
AB:ExtraButtons_UpdateAlpha()
282+
AB:ExtraButtons_UpdateScale()
283+
AB:ExtraButtons_GlobalFade()
284+
end
285+
286+
function AB:UpdateExtraBindings()
287+
_G.ExtraActionBarFrame.db = E.db.actionbar.extraActionButton
288+
289+
for _, button in pairs(extraBtns) do
290+
button.HotKey:SetText(GetBindingKey(button.commandName))
291+
292+
AB:FixKeybindText(button)
293+
AB:FixKeybindColor(button)
294+
end
295+
end

ElvUI/Core/Modules/DataTexts/DataTexts.lua

+6-11
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ local tinsert, ipairs, pairs, wipe, sort, gsub = tinsert, ipairs, pairs, wipe, s
1212
local tostring, strfind, strsplit = tostring, strfind, strsplit
1313
local hooksecurefunc = hooksecurefunc
1414

15+
local GetCurrencyListInfo = GetCurrencyListInfo
1516
local CloseDropDownMenus = CloseDropDownMenus
1617
local CreateFrame = CreateFrame
17-
local GetCurrencyInfo = GetCurrencyInfo
18-
local GetCurrencyListInfo = GetCurrencyListInfo
1918
local GetNumSpecializations = GetNumSpecializations
2019
local GetSpecializationInfo = GetSpecializationInfo
2120
local InCombatLockdown = InCombatLockdown
@@ -32,14 +31,14 @@ local C_CurrencyInfo_GetCurrencyListInfo = C_CurrencyInfo.GetCurrencyListInfo
3231
local C_CurrencyInfo_GetCurrencyListLink = C_CurrencyInfo.GetCurrencyListLink
3332
local GetBackpackCurrencyInfo = GetBackpackCurrencyInfo or C_CurrencyInfo.GetBackpackCurrencyInfo
3433
local GetCurrencyListSize = GetCurrencyListSize or C_CurrencyInfo.GetCurrencyListSize
35-
3634
local C_PartyInfo_RequestInviteFromUnit = C_PartyInfo.RequestInviteFromUnit
37-
local BNInviteFriend = BNInviteFriend
38-
local BNRequestInviteFriend = BNRequestInviteFriend
3935
local InviteUnit = C_PartyInfo.InviteUnit
36+
4037
local GetDisplayedInviteType = GetDisplayedInviteType
41-
local SetItemRef = SetItemRef
4238
local ChatFrame_SendBNetTell = ChatFrame_SendBNetTell
39+
local BNRequestInviteFriend = BNRequestInviteFriend
40+
local BNInviteFriend = BNInviteFriend
41+
local SetItemRef = SetItemRef
4342

4443
local MISCELLANEOUS = MISCELLANEOUS
4544
local LFG_TYPE_DUNGEON = LFG_TYPE_DUNGEON
@@ -869,11 +868,7 @@ function DT:CurrencyListInfo(index)
869868
end
870869

871870
function DT:CurrencyInfo(id)
872-
local info = E.Retail and C_CurrencyInfo_GetCurrencyInfo(id) or {}
873-
874-
if E.Cata then
875-
info.name, info.quantity, info.iconFileID, info.earnedThisWeek, info.weeklyMax, info.maxQuantity, info.isDiscovered = GetCurrencyInfo(id)
876-
end
871+
local info = C_CurrencyInfo_GetCurrencyInfo(id) or {}
877872

878873
return info, info and info.name, format(iconString, info and info.iconFileID or '136012')
879874
end

0 commit comments

Comments
 (0)