vrtc / chorus (public) (License: CC0) (since 2023-08-12) (hash sha1)
World of Warcraft add-on stub. The overall goal is to create a specialized raid frame.
List of commits:
Subject Hash Author Date (UTC)
feat!: create singleton aura tooltip 8e8e798543ef100a71ba2a9d212e66b1ddd667ab Vladyslav Bondarenko 2025-02-02 00:04:55
fix: show auras over role widgets 3bb62c88147af0ee522f4ce963ce206c315f4c9a Vladyslav Bondarenko 2025-02-01 21:27:33
fix: sanitize FrameXML fa5b0bbc1db073aa06e59d9bf03eb8d471a084b2 Vladyslav Bondarenko 2025-02-01 19:20:16
fix: make combat widget more visible 4b01d27fa7eeef55a6dcb866ec30641ee80e6f5b Vladyslav Bondarenko 2025-02-01 18:02:43
fix: make player roles more visible e28bbf987659ac717962de851226aa33409f472a Vladyslav Bondarenko 2025-02-01 18:02:21
feat: remove player from party frame 6d5f8b8a8bb1af9b596895ba42fdefed177560b6 Vladyslav Bondarenko 2025-02-01 16:07:20
feat: bump version to 0.12.0 83bd49398b8bff070bcb3664be634b02c78fa6dc Vladyslav Bondarenko 2025-01-29 16:39:56
fix: appease static analysis ce0659b8b6fb49f42fda914d2fd47da38fb80e63 Vladyslav Bondarenko 2025-01-29 16:39:39
fix!: persist frame position settings correctly 390fb24c1b2a19e378694adfa6efc7c93bdf1a55 Vladyslav Bondarenko 2025-01-29 16:34:56
feat!: drag chorus frames and save their positions e84a0e1d4a43760bbb177de901575ff10b388ccc Vladyslav Bondarenko 2025-01-29 09:37:39
fix: only drag frames out of combat 03ca7d9431c849e824699089dd82739f1c28870e Vladyslav Bondarenko 2025-01-28 07:43:06
feat: bump nightly version 05ac3fad466d01d2591439c6a39e5ae47d38803b Vladyslav Bondarenko 2025-01-27 21:37:11
feat!: add configuration menu 254bab612dbdadb0db925eab00cec81256b032ff Vladyslav Bondarenko 2025-01-27 21:30:05
fix: aura buttons do not violate borders 452ee7ff2e66a63e1c86f1cc1d9056b4ebe5cec4 Vladyslav Bondarenko 2025-01-27 18:02:08
fix: do not overlap tiny aura buttons 6f894b23eb90d2e88f57285ef7d5779550386ab9 Vladyslav Bondarenko 2025-01-27 17:58:48
fix: unify aura button logic 52c88f27f978e6ae528e4d04507f8c73184f904c Vladyslav Bondarenko 2025-01-27 17:50:00
feat!: extend huge unit with more aura buttons 36bba5e5bb7170758410ca3d7e3b619a68591937 Vladyslav Bondarenko 2025-01-17 14:58:43
feat!: extend huge unit with more aura buttons 368dd673050bd53efde56a17055100dc1f24c1ed Vladyslav Bondarenko 2025-01-17 14:58:43
fix: update TOT aura more frequently 29751221b920518b14a51c9bf1b486f5a177ad4f Vladyslav Bondarenko 2024-12-23 16:59:12
feat: rearrange solo and raid frames a7139f7359fe357808e97c4518369b49fd4cbd29 Vladyslav Bondarenko 2024-12-23 19:44:06
Commit 8e8e798543ef100a71ba2a9d212e66b1ddd667ab - feat!: create singleton aura tooltip
Remove all aura tooltips from every unit frame. Instead, create a single
aura tooltip, which state is modified on demand. Hopefully it improves
runtime performance, especially during combat.
Author: Vladyslav Bondarenko
Author date (UTC): 2025-02-02 00:04
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2025-02-02 18:37
Parent(s): bfbf2801905362c915f3dbf1e50f7c68b5ac6bdc
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: 565e81fc16b6994935ae5483b2efe489f59d63c5
File Lines added Lines deleted
conf/lua-check/luacheckrc.lua 3 1
conf/make/src.mk 24 21
src/Chorus.xml 3 1
src/ChorusAuraFrameTemplate.lua 11 3
src/ChorusAuraTooltipFrameTemplate.lua 0 66
src/ChorusAuraTooltipFrameTemplate.xml 3 23
src/ChorusAuraTooltipSingletonFrame.xml 17 0
src/ChorusAuraTooltipToggleButtonTemplate.lua 82 0
src/ChorusAuraTooltipToggleButtonTemplate.xml 36 0
src/ChorusHugeUnitFrameTemplate.xml 1 8
src/ChorusLargeUnitFrameTemplate.xml 1 8
src/ChorusPartyFrame.lua 3 0
src/ChorusPartyFrame.xml 0 3
src/ChorusUnitNameFrameTemplate.lua 2 0
File conf/lua-check/luacheckrc.lua changed (mode: 100644) (index 87bbc31..b6ab491)
... ... stds.framexml = {
167 167
168 168 stds.chorus = { stds.chorus = {
169 169 read_globals = { read_globals = {
170 'ChorusConfMovableCheckBox',
170 'ChorusAuraTooltipSingletonFrame',
171 'ChorusAuraTooltipSingletonFrameSecureClickHandlerFrame',
171 172 'ChorusConfFrameTitle', 'ChorusConfFrameTitle',
173 'ChorusConfMovableCheckBox',
172 174 'ChorusFocusFrame', 'ChorusFocusFrame',
173 175 'ChorusFrame', 'ChorusFrame',
174 176 'ChorusGroupFrame', 'ChorusGroupFrame',
File conf/make/src.mk changed (mode: 100644) (index 09dff50..58afdbd)
8 8
9 9 LUAFILES = \ LUAFILES = \
10 10 ${srcdir}src/Chorus.lua \ ${srcdir}src/Chorus.lua \
11 ${srcdir}src/ChorusTest.lua \
12 ${srcdir}src/local.lua \
13 11 ${srcdir}src/ChorusAuraButtonTemplate.lua \ ${srcdir}src/ChorusAuraButtonTemplate.lua \
14 12 ${srcdir}src/ChorusAuraFrameTemplate.lua \ ${srcdir}src/ChorusAuraFrameTemplate.lua \
15 13 ${srcdir}src/ChorusAuraTooltipFrameTemplate.lua \ ${srcdir}src/ChorusAuraTooltipFrameTemplate.lua \
14 ${srcdir}src/ChorusAuraTooltipToggleButtonTemplate.lua \
16 15 ${srcdir}src/ChorusCastFrameTemplate.lua \ ${srcdir}src/ChorusCastFrameTemplate.lua \
16 ${srcdir}src/ChorusConfFrame.lua \
17 ${srcdir}src/ChorusFrame.lua \
18 ${srcdir}src/ChorusGroupFrame.lua \
19 ${srcdir}src/ChorusPartyFrame.lua \
17 20 ${srcdir}src/ChorusProgressFrameTemplate.lua \ ${srcdir}src/ChorusProgressFrameTemplate.lua \
18 21 ${srcdir}src/ChorusRaidTargetIconFrameTemplate.lua \ ${srcdir}src/ChorusRaidTargetIconFrameTemplate.lua \
19 22 ${srcdir}src/ChorusRangeFrameTemplate.lua \ ${srcdir}src/ChorusRangeFrameTemplate.lua \
23 ${srcdir}src/ChorusSoloFrame.lua \
24 ${srcdir}src/ChorusTest.lua \
20 25 ${srcdir}src/ChorusThreatFrameTemplate.lua \ ${srcdir}src/ChorusThreatFrameTemplate.lua \
21 26 ${srcdir}src/ChorusUnitAffectingCombatFrameTemplate.lua \ ${srcdir}src/ChorusUnitAffectingCombatFrameTemplate.lua \
22 27 ${srcdir}src/ChorusUnitBackdropTemplate.lua \ ${srcdir}src/ChorusUnitBackdropTemplate.lua \
 
... ... ${srcdir}src/ChorusUnitFrameTemplate.lua \
26 31 ${srcdir}src/ChorusUnitGroupRoleFrameTemplate.lua \ ${srcdir}src/ChorusUnitGroupRoleFrameTemplate.lua \
27 32 ${srcdir}src/ChorusUnitLevelFrameTemplate.lua \ ${srcdir}src/ChorusUnitLevelFrameTemplate.lua \
28 33 ${srcdir}src/ChorusUnitNameFrameTemplate.lua \ ${srcdir}src/ChorusUnitNameFrameTemplate.lua \
29 ${srcdir}src/ChorusPartyFrame.lua \
30 ${srcdir}src/ChorusGroupFrame.lua \
31 ${srcdir}src/ChorusConfFrame.lua \
32 ${srcdir}src/ChorusSoloFrame.lua \
33 ${srcdir}src/ChorusFrame.lua
34 ${srcdir}src/local.lua
34 35
35 36 XMLFILES = \ XMLFILES = \
36 37 ${srcdir}src/Chorus.xml \ ${srcdir}src/Chorus.xml \
37 ${srcdir}src/ChorusFont.xml \
38 38 ${srcdir}src/ChorusAuraButtonTemplate.xml \ ${srcdir}src/ChorusAuraButtonTemplate.xml \
39 39 ${srcdir}src/ChorusAuraFrameTemplate.xml \ ${srcdir}src/ChorusAuraFrameTemplate.xml \
40 40 ${srcdir}src/ChorusAuraTooltipFrameTemplate.xml \ ${srcdir}src/ChorusAuraTooltipFrameTemplate.xml \
41 ${srcdir}src/ChorusAuraTooltipSingletonFrame.xml \
42 ${srcdir}src/ChorusAuraTooltipToggleButtonTemplate.xml \
41 43 ${srcdir}src/ChorusCastFrameTemplate.xml \ ${srcdir}src/ChorusCastFrameTemplate.xml \
44 ${srcdir}src/ChorusConfFrame.xml \
45 ${srcdir}src/ChorusFocusFrame.xml \
46 ${srcdir}src/ChorusFont.xml \
47 ${srcdir}src/ChorusFrame.xml \
48 ${srcdir}src/ChorusGroupFrame.xml \
42 49 ${srcdir}src/ChorusHealthFrameTemplate.xml \ ${srcdir}src/ChorusHealthFrameTemplate.xml \
43 50 ${srcdir}src/ChorusHugeUnitFrameTemplate.xml \ ${srcdir}src/ChorusHugeUnitFrameTemplate.xml \
51 ${srcdir}src/ChorusLargeRaidFrame.xml \
44 52 ${srcdir}src/ChorusLargeUnitFrameTemplate.xml \ ${srcdir}src/ChorusLargeUnitFrameTemplate.xml \
53 ${srcdir}src/ChorusPartyFrame.xml \
54 ${srcdir}src/ChorusPlayerFrame.xml \
45 55 ${srcdir}src/ChorusPowerFrameTemplate.xml \ ${srcdir}src/ChorusPowerFrameTemplate.xml \
46 56 ${srcdir}src/ChorusProgressFrameTemplate.xml \ ${srcdir}src/ChorusProgressFrameTemplate.xml \
57 ${srcdir}src/ChorusRaidFrameTemplate.xml \
47 58 ${srcdir}src/ChorusRaidTargetIconFrameTemplate.xml \ ${srcdir}src/ChorusRaidTargetIconFrameTemplate.xml \
48 59 ${srcdir}src/ChorusRangeFrameTemplate.xml \ ${srcdir}src/ChorusRangeFrameTemplate.xml \
60 ${srcdir}src/ChorusSmallRaidFrame.xml \
49 61 ${srcdir}src/ChorusSmallUnitFrameTemplate.xml \ ${srcdir}src/ChorusSmallUnitFrameTemplate.xml \
62 ${srcdir}src/ChorusSoloFrame.xml \
63 ${srcdir}src/ChorusTargetFrame.xml \
50 64 ${srcdir}src/ChorusThreatFrameTemplate.xml \ ${srcdir}src/ChorusThreatFrameTemplate.xml \
65 ${srcdir}src/ChorusTinyRaidFrame.xml \
51 66 ${srcdir}src/ChorusTinyUnitFrameTemplate.xml \ ${srcdir}src/ChorusTinyUnitFrameTemplate.xml \
52 67 ${srcdir}src/ChorusUnitAffectingCombatFrameTemplate.xml \ ${srcdir}src/ChorusUnitAffectingCombatFrameTemplate.xml \
53 68 ${srcdir}src/ChorusUnitBackdropTemplate.xml \ ${srcdir}src/ChorusUnitBackdropTemplate.xml \
 
... ... ${srcdir}src/ChorusUnitButtonTemplate.xml \
56 71 ${srcdir}src/ChorusUnitFrameTemplate.xml \ ${srcdir}src/ChorusUnitFrameTemplate.xml \
57 72 ${srcdir}src/ChorusUnitGroupRoleFrameTemplate.xml \ ${srcdir}src/ChorusUnitGroupRoleFrameTemplate.xml \
58 73 ${srcdir}src/ChorusUnitLevelFrameTemplate.xml \ ${srcdir}src/ChorusUnitLevelFrameTemplate.xml \
59 ${srcdir}src/ChorusUnitNameFrameTemplate.xml \
60 ${srcdir}src/ChorusRaidFrameTemplate.xml \
61 ${srcdir}src/ChorusFocusFrame.xml \
62 ${srcdir}src/ChorusPlayerFrame.xml \
63 ${srcdir}src/ChorusTargetFrame.xml \
64 ${srcdir}src/ChorusPartyFrame.xml \
65 ${srcdir}src/ChorusTinyRaidFrame.xml \
66 ${srcdir}src/ChorusSmallRaidFrame.xml \
67 ${srcdir}src/ChorusLargeRaidFrame.xml \
68 ${srcdir}src/ChorusGroupFrame.xml \
69 ${srcdir}src/ChorusConfFrame.xml \
70 ${srcdir}src/ChorusSoloFrame.xml \
71 ${srcdir}src/ChorusFrame.xml
74 ${srcdir}src/ChorusUnitNameFrameTemplate.xml
File src/Chorus.xml changed (mode: 100644) (index 50abb84..99e2a8a)
8 8 <Include file="ChorusAuraButtonTemplate.xml"/> <Include file="ChorusAuraButtonTemplate.xml"/>
9 9 <Include file="ChorusAuraFrameTemplate.xml"/> <Include file="ChorusAuraFrameTemplate.xml"/>
10 10 <Include file="ChorusAuraTooltipFrameTemplate.xml"/> <Include file="ChorusAuraTooltipFrameTemplate.xml"/>
11 <Include file="ChorusAuraTooltipToggleButtonTemplate.xml"/>
11 12 <Include file="ChorusProgressFrameTemplate.xml"/> <Include file="ChorusProgressFrameTemplate.xml"/>
12 13 <Include file="ChorusHealthFrameTemplate.xml"/> <Include file="ChorusHealthFrameTemplate.xml"/>
13 14 <Include file="ChorusPowerFrameTemplate.xml"/> <Include file="ChorusPowerFrameTemplate.xml"/>
 
27 28 <Include file="ChorusLargeUnitFrameTemplate.xml"/> <Include file="ChorusLargeUnitFrameTemplate.xml"/>
28 29 <Include file="ChorusSmallUnitFrameTemplate.xml"/> <Include file="ChorusSmallUnitFrameTemplate.xml"/>
29 30 <Include file="ChorusTinyUnitFrameTemplate.xml"/> <Include file="ChorusTinyUnitFrameTemplate.xml"/>
31 <!-- Frames (concrete classes, interface implementations, object instances). -->
32 <Include file="ChorusAuraTooltipSingletonFrame.xml"/>
30 33 <!-- `ChorusRaidFrameTemplate.xml` MUST be loaded AFTER all unit templates. --> <!-- `ChorusRaidFrameTemplate.xml` MUST be loaded AFTER all unit templates. -->
31 34 <Include file="ChorusRaidFrameTemplate.xml"/> <Include file="ChorusRaidFrameTemplate.xml"/>
32 <!-- Frames (concrete classes, interface implementations, object instances). -->
33 35 <Include file="ChorusPartyFrame.xml"/> <Include file="ChorusPartyFrame.xml"/>
34 36 <Include file="ChorusTinyRaidFrame.xml"/> <Include file="ChorusTinyRaidFrame.xml"/>
35 37 <Include file="ChorusSmallRaidFrame.xml"/> <Include file="ChorusSmallRaidFrame.xml"/>
File src/ChorusAuraFrameTemplate.lua changed (mode: 100644) (index 3af7b6d..f38b2c8)
... ... local function auraFrameEventProcessor(self, eventCategory, ...)
97 97 end end
98 98 end end
99 99
100 assert(eventCategory ~= nil)
101
102 100 local filter = SecureButton_GetAttribute(self, 'filter') local filter = SecureButton_GetAttribute(self, 'filter')
103 101 assert(filter ~= nil) assert(filter ~= nil)
104 102 assert('string' == type(filter)) assert('string' == type(filter))
 
... ... function Chorus.auraFrameMain(self)
229 227 end end
230 228 end end
231 229
230 --[[ OnAttributeChanged trigger only works out of combat and is only
231 relied on during initialization. ]]--
232
233 self:SetScript('OnAttributeChanged', auraFrameEventProcessor)
234
235 --[[ OnEvent trigger fires for UNIT_AURA mostly. ]]--
236
232 237 self:SetScript('OnEvent', auraFrameEventProcessor) self:SetScript('OnEvent', auraFrameEventProcessor)
233 --self:SetScript('OnShow', auraFrameEventProcessor)
238
239 --[[ OnShow trigger is critical for aura tooltip to work. ]]--
240
241 self:SetScript('OnShow', auraFrameEventProcessor)
234 242
235 243 if auraWeightMap then if auraWeightMap then
236 244 validateAuraWeightMap(auraWeightMap) validateAuraWeightMap(auraWeightMap)
File src/ChorusAuraTooltipFrameTemplate.lua changed (mode: 100644) (index af1c2ec..de3ed46)
... ... local Chorus = Chorus
6 6
7 7 local strtrim = strtrim local strtrim = strtrim
8 8
9 local function getButtonAssociatedTooltipFrame(self)
10 assert(self ~= nil)
11
12 local p = self:GetParent()
13
14 assert(p ~= nil, 'invalid state: aura tooltip toggle button ' ..
15 'must have siblings and therefore must have a parent')
16
17 local tooltipFrame = _G[p:GetName() .. 'AuraTooltipFrame']
18
19 return tooltipFrame
20 end
21
22 --[[--
23 Initialize the button to toggle `ChorusAuraTooltipFrame` in restricted
24 environment.
25
26 When this button is clicked, it must show a frame, that contains an exhaustive
27 list of auras that effect the corresponding unit.
28
29 @function auraTooltipToggleButtonMain
30 @tparam frame self this aura tooltip toggle button
31 ]]
32 local function auraTooltipToggleButtonMain(self)
33 assert(self ~= nil)
34
35 --[[ @warning For some bizzare reason, only programmatically created
36 secure handlers, or secure handlers that descend from secure frames,
37 define the required method of `SetFrameRef`. ]]--
38
39 local nama = (self:GetName() or '') .. 'SecureClickHandlerFrame'
40
41 local secureClickHandler = _G[nama] or CreateFrame('BUTTON', nama, self,
42 'SecureHandlerClickTemplate')
43
44 assert(secureClickHandler ~= nil)
45
46 local tooltipFrame = getButtonAssociatedTooltipFrame(self)
47 assert(tooltipFrame ~= nil, 'invalid state: sibling aura tooltip frame must exist');
48
49 secureClickHandler:SetFrameRef('ChorusAuraTooltipFrame', tooltipFrame);
50
51 secureClickHandler:WrapScript(self, 'OnClick', [=[
52 local tooltipFrame = self:GetFrameRef('ChorusAuraTooltipFrame')
53 if not tooltipFrame then
54 tooltipFrame = owner:GetFrameRef('ChorusAuraTooltipFrame')
55 end
56 if tooltipFrame then
57 tooltipFrame:Show()
58 else
59 error('ChorusAuraTooltipFrameTemplate.lua: invalid state ' ..
60 'could not access aura tooltip frame')
61 return
62 end
63 ]=]);
64
65 --[[ Aura tooltip toggle button is a protected frame. It's visibility
66 must be toggled with a unit watch. Most likely. ]]--
67
68 RegisterUnitWatch(self)
69 end
70
71 9 --[[-- --[[--
72 10 `ChorusAuraTooltipFrameTemplate` is *not* the familiar tooltip frame. Instead, `ChorusAuraTooltipFrameTemplate` is *not* the familiar tooltip frame. Instead,
73 11 it is intended to conditionally show all auras on a given unit. it is intended to conditionally show all auras on a given unit.
 
... ... local function auraTooltipFrameMain(self)
121 59 ]=]) ]=])
122 60 end end
123 61
124 Chorus.auraTooltipToggleButtonMain = function(...)
125 return auraTooltipToggleButtonMain(...)
126 end
127
128 62 Chorus.auraTooltipFrameMain = function(...) Chorus.auraTooltipFrameMain = function(...)
129 63 return auraTooltipFrameMain(...) return auraTooltipFrameMain(...)
130 64 end end
File src/ChorusAuraTooltipFrameTemplate.xml changed (mode: 100644) (index 3c59303..9859335)
78 78 <OnLoad>Chorus.auraTooltipFrameMain(self);</OnLoad> <OnLoad>Chorus.auraTooltipFrameMain(self);</OnLoad>
79 79 </Scripts> </Scripts>
80 80 <Attributes> <Attributes>
81 <Attribute name="useparent-unit" type="boolean" value="true"/>
81 <!-- The 'unit' property is set by clicking a toggle button.
82 See ChorusAuraTooltipToggleButtonTemplate. -->
83 <Attribute name="unit" type="string" value="none"/>
82 84 </Attributes> </Attributes>
83 85 </Frame> </Frame>
84 <Button name="ChorusAuraTooltipFrameToggleButtonTemplate" virtual="true" enableMouse="true" inherits="SecureActionButtonTemplate">
85 <Size>
86 <AbsDimension x="16" y="16"/>
87 </Size>
88 <Scripts>
89 <OnLoad>Chorus.auraTooltipToggleButtonMain(self);</OnLoad>
90 </Scripts>
91 <Attributes>
92 <Attribute name="useparent-unit" type="boolean" value="true"/>
93 </Attributes>
94 <!--<NormalTexture file="Interface\MoneyFrame\Arrow-Right-Up"/>-->
95 <!--<PushedTexture file="Interface\MoneyFrame\Arrow-Right-Down"/>-->
96 <!--<DisabledTexture file="Interface\MoneyFrame\Arrow-Right-Disabled"/>-->
97 <NormalTexture file="Interface\Buttons\UI-Panel-QuestHideButton">
98 <TexCoords left="0" right="0.5" top="0.5" bottom="1"/>
99 </NormalTexture>
100 <PushedTexture file="Interface\Buttons\UI-Panel-QuestHideButton">
101 <TexCoords left="0.5" right="1" top="0.5" bottom="1"/>
102 </PushedTexture>
103 <HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD" />
104 <DisabledTexture file="Interface\Buttons\UI-Panel-QuestHideButton-disabled" />
105 </Button>
106 86 </Ui> </Ui>
File src/ChorusAuraTooltipSingletonFrame.xml added (mode: 100644) (index 0000000..b92c9ca)
1 <?xml version="1.0" encoding="UTF-8"?>
2 <Ui xmlns="http://www.blizzard.com/wow/ui/">
3 <Button name="ChorusAuraTooltipSingletonFrameSecureClickHandlerFrame" inherits="SecureHandlerClickTemplate">
4 </Button>
5 <Frame name="ChorusAuraTooltipSingletonFrame" inherits="ChorusAuraTooltipFrameTemplate" hidden="true">
6 <Anchors>
7 <Anchor point="CENTER">
8 <Offset>
9 <AbsDimension x="0" y="-60"/>
10 </Offset>
11 </Anchor>
12 </Anchors>
13 <Attributes>
14 <Attribute name="unit" type="string" value="none"/>
15 </Attributes>
16 </Frame>
17 </Ui>
File src/ChorusAuraTooltipToggleButtonTemplate.lua added (mode: 100644) (index 0000000..bb6a4d1)
1 local Chorus = Chorus
2
3 local SecureButton_GetUnit = Chorus.test.SecureButton_GetUnit or SecureButton_GetUnit
4
5 local function init(toggleButton)
6 assert(toggleButton ~= nil)
7
8 --[[ Inherit the unit from parent frames. ]]--
9 local u = SecureButton_GetUnit(toggleButton)
10 assert(u ~= nil, 'invalid state: unit required')
11 toggleButton:SetAttribute('attribute-value', u)
12
13 local secureClickHandler = ChorusAuraTooltipSingletonFrameSecureClickHandlerFrame
14 assert(secureClickHandler ~= nil, 'invalid state: secure click handler must exist')
15
16 local tooltipFrame = ChorusAuraTooltipSingletonFrame
17 assert(tooltipFrame ~= nil, 'invalid state: aura tooltip singleton frame must exist');
18 toggleButton:SetAttribute('attribute-frame', tooltipFrame)
19
20 secureClickHandler:SetFrameRef('ChorusAuraTooltipSingletonFrame', tooltipFrame);
21
22 secureClickHandler:WrapScript(toggleButton, 'OnClick', [=[
23 local secureClickHandler = owner
24 local toggleButton = self
25
26 local tooltipFrame = toggleButton:GetFrameRef('ChorusAuraTooltipSingletonFrame')
27 if not tooltipFrame then
28 tooltipFrame = owner:GetFrameRef('ChorusAuraTooltipSingletonFrame')
29 end
30
31 if not tooltipFrame then
32 error('ChorusAuraTooltipSingletonFrameTemplate.lua: invalid state: ' ..
33 'could not access aura tooltip frame')
34 return
35 end
36
37 local u = toggleButton:GetAttribute('attribute-value')
38
39 if tooltipFrame and u then
40 tooltipFrame:SetAttribute('unit', u)
41 --[[ Force trigger 'OnShow' callback on the tooltipFrame. ]]--
42 if tooltipFrame:IsShown() then
43 tooltipFrame:Hide()
44 end
45 tooltipFrame:Show()
46 end
47 ]=])
48
49 --[[ Aura tooltip toggle button is a protected frame. It's visibility
50 must be toggled with a unit watch. Most likely. ]]--
51
52 RegisterUnitWatch(toggleButton)
53 end
54
55 --[[--
56 Initialize the button to toggle `ChorusAuraTooltipSingletonFrame` in restricted
57 environment.
58
59 When this button is clicked, it must show a frame, that contains an exhaustive
60 list of auras that effect the corresponding unit.
61
62 There is only one `ChorusAuraTooltipSingletonFrame` and several toggle buttons
63 for each unit. When the button is clicked, it modifies the state of the aura
64 tooltip, to correspond to the unit the toggle button is associated with.
65
66 @function auraTooltipSingletonToggleButtonMain
67 @tparam frame toggleButton this aura tooltip toggle button
68 ]]
69 function Chorus.auraTooltipSingletonToggleButtonMain(toggleButton)
70 --[[ Delay initialization until the game is loaded entirely. ]]--
71
72 toggleButton:RegisterEvent('PLAYER_LOGIN')
73 toggleButton:SetScript('OnEvent', init)
74 toggleButton:SetScript('OnAttributeChanged', function(self, attributeName)
75 if 'unit' == tostring(attributeName) then
76 --[[ Inherit the unit from parent frames. ]]--
77 local u = SecureButton_GetUnit(self)
78 assert(u ~= nil, 'invalid state: unit required')
79 self:SetAttribute('attribute-value', u)
80 end
81 end)
82 end
File src/ChorusAuraTooltipToggleButtonTemplate.xml added (mode: 100644) (index 0000000..226f287)
1 <?xml version="1.0" encoding="UTF-8"?>
2 <Ui xmlns="http://www.blizzard.com/wow/ui/">
3 <!-- Requires `ChorusAuraTooltipFrameTemplate.xml`
4 and `ChorusAuraTooltipSingletonFrame.xml`. -->
5 <Script file="ChorusAuraTooltipToggleButtonTemplate.lua"/>
6 <Button name="ChorusAuraTooltipSingletonFrameToggleButtonTemplate" virtual="true" enableMouse="true" inherits="SecureActionButtonTemplate">
7 <Size>
8 <AbsDimension x="16" y="16"/>
9 </Size>
10 <Attributes>
11 <Attribute name="type" type="string" value="attribute"/>
12 <!-- The property `attribute-frame` must be applied at runtime.
13 The attribute type `frame` is defined in the engine, and it is required here,
14 but it is not accessibe via FrameXML. -->
15 <!--<Attribute name="attribute-frame" type="frame" value="ChorusAuraTooltipSingletonFrame"/>-->
16 <Attribute name="attribute-name" type="string" value="unit"/>
17 <!-- The `unit` property is inherited from parent and applied to `attribute-value` property dynamically. -->
18 <!--<Attribute name="attribute-value" type="string" value="target"/>-->
19 <Attribute name="useparent-unit" type="boolean" value="true"/>
20 </Attributes>
21 <Scripts>
22 <OnLoad>Chorus.auraTooltipSingletonToggleButtonMain(self);</OnLoad>
23 </Scripts>
24 <!--<NormalTexture file="Interface\MoneyFrame\Arrow-Right-Up"/>-->
25 <!--<PushedTexture file="Interface\MoneyFrame\Arrow-Right-Down"/>-->
26 <!--<DisabledTexture file="Interface\MoneyFrame\Arrow-Right-Disabled"/>-->
27 <NormalTexture file="Interface\Buttons\UI-Panel-QuestHideButton">
28 <TexCoords left="0" right="0.5" top="0.5" bottom="1"/>
29 </NormalTexture>
30 <PushedTexture file="Interface\Buttons\UI-Panel-QuestHideButton">
31 <TexCoords left="0.5" right="1" top="0.5" bottom="1"/>
32 </PushedTexture>
33 <HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD" />
34 <DisabledTexture file="Interface\Buttons\UI-Panel-QuestHideButton-disabled" />
35 </Button>
36 </Ui>
File src/ChorusHugeUnitFrameTemplate.xml changed (mode: 100644) (index 90a08a4..64d4610)
152 152 <Attribute name="filter" type="string" value="HARMFUL"/> <Attribute name="filter" type="string" value="HARMFUL"/>
153 153 </Attributes> </Attributes>
154 154 </Frame> </Frame>
155 <Frame name="$parentAuraTooltipFrame" inherits="ChorusAuraTooltipFrameTemplate">
156 <Anchors>
157 <Anchor point="TOPLEFT">
158 <Offset x="0" y="0"/>
159 </Anchor>
160 </Anchors>
161 </Frame>
162 <Button name="$parentAuraTooltipToggleButton" inherits="ChorusAuraTooltipFrameToggleButtonTemplate">
155 <Button name="$parentAuraTooltipToggleButton" inherits="ChorusAuraTooltipSingletonFrameToggleButtonTemplate">
163 156 <Anchors> <Anchors>
164 157 <Anchor point="TOPRIGHT"> <Anchor point="TOPRIGHT">
165 158 <Offset x="0" y="-90"/> <Offset x="0" y="-90"/>
File src/ChorusLargeUnitFrameTemplate.xml changed (mode: 100644) (index 5fb03cd..725173b)
142 142 <Attribute name="filter" type="string" value="HARMFUL"/> <Attribute name="filter" type="string" value="HARMFUL"/>
143 143 </Attributes> </Attributes>
144 144 </Frame> </Frame>
145 <Frame name="$parentAuraTooltipFrame" inherits="ChorusAuraTooltipFrameTemplate">
146 <Anchors>
147 <Anchor point="TOPLEFT">
148 <Offset x="0" y="0"/>
149 </Anchor>
150 </Anchors>
151 </Frame>
152 <Button name="$parentAuraTooltipToggleButton" inherits="ChorusAuraTooltipFrameToggleButtonTemplate">
145 <Button name="$parentAuraTooltipToggleButton" inherits="ChorusAuraTooltipSingletonFrameToggleButtonTemplate">
153 146 <Anchors> <Anchors>
154 147 <Anchor point="BOTTOMRIGHT"> <Anchor point="BOTTOMRIGHT">
155 148 <Offset x="4" y="10"/> <Offset x="4" y="10"/>
File src/ChorusPartyFrame.lua changed (mode: 100644) (index aac8eb0..f196a39)
... ... local function partyMemberFrameInit(partyMemberFrame)
66 66 local unitFrame = _G[n .. 'UnitFrame'] local unitFrame = _G[n .. 'UnitFrame']
67 67 local petFrame = _G[n .. 'PetFrame'] local petFrame = _G[n .. 'PetFrame']
68 68 local targetFrame = _G[n .. 'TargetFrame'] local targetFrame = _G[n .. 'TargetFrame']
69 local tooltipToggleButton = _G[n .. 'UnitFrameAuraTooltipToggleButton']
69 70 assert(unitFrame ~= nil) assert(unitFrame ~= nil)
70 71 assert(petFrame ~= nil) assert(petFrame ~= nil)
71 72 assert(targetFrame ~= nil) assert(targetFrame ~= nil)
73 assert(tooltipToggleButton ~= nil, "invalid state: cannot find tooltip button for " .. n)
72 74
73 75 unitFrame:SetAttribute('unit', u) unitFrame:SetAttribute('unit', u)
74 76 petFrame:SetAttribute('unit', upet) petFrame:SetAttribute('unit', upet)
75 77 targetFrame:SetAttribute('unit', utarget) targetFrame:SetAttribute('unit', utarget)
78 tooltipToggleButton:SetAttribute('attribute-value', u)
76 79 end end
77 80
78 81 function Chorus.partyMemberFrameMain(partyMemberFrame) function Chorus.partyMemberFrameMain(partyMemberFrame)
File src/ChorusPartyFrame.xml changed (mode: 100644) (index ed99d60..ee7827b)
31 31 </Anchors> </Anchors>
32 32 </Frame> </Frame>
33 33 </Frames> </Frames>
34 <Attributes>
35 <Attribute name="unit" type="string" value="none"/>
36 </Attributes>
37 34 <Scripts> <Scripts>
38 35 <OnLoad>Chorus.partyMemberFrameMain(self);</OnLoad> <OnLoad>Chorus.partyMemberFrameMain(self);</OnLoad>
39 36 </Scripts> </Scripts>
File src/ChorusUnitNameFrameTemplate.lua changed (mode: 100644) (index dd614a9..9ac1c0d)
... ... function Chorus.unitNameFrameMain(self)
90 90 --[[-- @fixme Sometimes some unit buttons in raid frames cannot be --[[-- @fixme Sometimes some unit buttons in raid frames cannot be
91 91 clicked.]] clicked.]]
92 92
93 self:SetScript('OnAttributeChanged', unitNameEventProcessor)
93 94 self:SetScript('OnEvent', unitNameEventProcessor) self:SetScript('OnEvent', unitNameEventProcessor)
95 self:SetScript('OnShow', unitNameEventProcessor)
94 96
95 97 self:RegisterEvent('PARTY_CONVERTED_TO_RAID') self:RegisterEvent('PARTY_CONVERTED_TO_RAID')
96 98 self:RegisterEvent('PARTY_MEMBERS_CHANGED') self:RegisterEvent('PARTY_MEMBERS_CHANGED')
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/vrtc/chorus

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/vrtc/chorus

Clone this repository using git:
git clone git://git.rocketgit.com/user/vrtc/chorus

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main