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)
fix!: toggle raid frame 59503ee6ec8744f057e959c026cacb0e39ee62db Vladyslav Bondarenko 2024-06-23 07:58:42
feat!: prepare release 0.9.0 6b15c2a4567dae6b363d69fa84348aa2dbca7b74 Vladyslav Bondarenko 2024-06-18 22:41:56
fix: add UnitIsTapped to known globals list 9536f6ae6bb9f2e4ce1a668f3a55c2ad0a225cb7 Vladyslav Bondarenko 2024-06-18 22:40:45
feat: upgrade cast bar f050d4444480983bfe7475bdafbfeb2c291c3472 Vladyslav Bondarenko 2024-06-18 18:11:20
fix!: only update cast bar when it's visible 7c2081b92a1ec323911520a977c00f68078bae18 Vladyslav Bondarenko 2024-06-18 17:09:56
fix: cast bar always reports ongoing cast d69d60f524a7871053daa2d914badc59e1189e15 Vladyslav Bondarenko 2024-06-18 15:37:59
feat: color unit headers by reaction af87ae82144ba3e49bec3f3cc18919b502d46da8 Vladyslav Bondarenko 2024-06-18 15:19:21
feat: weigh priest effects 99341dd5c6cb03861fdfa802a1cde520887b29b5 Vladyslav Bondarenko 2024-06-18 14:01:45
feat: make cast bar prettier visually 8ef25268de9a70ce741f0e9b4c105d4969afe7ff Vladyslav Bondarenko 2024-06-18 14:01:03
doc: show todo and fixme annotations in the docs a880f593e674df82682c295375319b7a4cf13b20 Vladyslav Bondarenko 2024-06-18 11:58:53
fix: make raid frames protected c94bb2d05a404e2a1e802cf03daa6325cf38827b Vladyslav Bondarenko 2024-06-18 11:57:42
feat: cast bar shows instants and failures c08b3be1c0d8d63b298a71ddf7af734703ffcb42 Vladyslav Bondarenko 2024-06-16 20:42:42
feat: spell channel bar moves in reverse 64e0512304854e28df8ad94363a048fd997dc502 Vladyslav Bondarenko 2024-06-16 19:19:53
doc: valid references to github 6aba3821b71216c07d8f02b24f75006e556dca61 Vladyslav Bondarenko 2024-06-16 17:28:59
build: allow either GNUmake or pdpmake to be used 4f3cd088299dc09f5207caeeddedfcca461d439e Vladyslav Bondarenko 2024-06-16 15:52:32
doc: add minimal documentation 125835dbbef41528e4f545642f62e519e7e8f9fc Vladyslav Bondarenko 2024-06-16 15:34:58
doc: descript aura button API 7d110e3d397a335d2dc0ffbf699acc487730d0d8 Vladyslav Bondarenko 2024-06-16 13:24:52
feat: add ldoc custom see tag handler d28dc9809939a99694d87cf1d0654eb0e2fcd314 Vladyslav Bondarenko 2024-06-16 13:23:24
feat: add optional xmlstarlet support b2db46335cb4aa461c45915d235c6d8d340a3dea Vladyslav Bondarenko 2024-06-16 09:57:27
fix: indent Chorus.xml with tabs and not spaces bf4091ab69c75aafa9256b0503b5addd316e214f Vladyslav Bondarenko 2024-06-16 09:39:28
Commit 59503ee6ec8744f057e959c026cacb0e39ee62db - fix!: toggle raid frame
Known issue: profiles do not toggle correctly when raid size grows or
shrinks.
Author: Vladyslav Bondarenko
Author date (UTC): 2024-06-23 07:58
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2024-06-23 07:58
Parent(s): 9b3aac04bfa206da0d95ef5715e8e9a0983f5c28
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: b629bd1cceaa1af019acb41f49e07e394b8f111c
File Lines added Lines deleted
conf/lua-check/luacheckrc.lua 4 1
src/ChorusGroupFrame.lua 138 60
File conf/lua-check/luacheckrc.lua changed (mode: 100644) (index 6edbd2a..2ad2e00)
... ... stds.wrath = {
32 32 'GetTime', 'GetTime',
33 33 'InCombatLockdown', 'InCombatLockdown',
34 34 'IsSpellInRange', 'IsSpellInRange',
35 'MAX_RAID_MEMBERS',
35 36 'UnitAffectingCombat', 'UnitAffectingCombat',
36 37 'UnitAura', 'UnitAura',
37 38 'UnitCanAttack', 'UnitCanAttack',
 
... ... stds.wrath = {
53 54 'UnitIsDead', 'UnitIsDead',
54 55 'UnitIsEnemy', 'UnitIsEnemy',
55 56 'UnitIsFriend', 'UnitIsFriend',
56 'UnitIsTapped',
57 57 'UnitIsGhost', 'UnitIsGhost',
58 58 'UnitIsPlayer', 'UnitIsPlayer',
59 'UnitIsTapped',
59 60 'UnitIsUnit', 'UnitIsUnit',
60 61 'UnitLevel', 'UnitLevel',
61 62 'UnitName', 'UnitName',
63 'UnitPlayerOrPetInParty',
64 'UnitPlayerOrPetInRaid',
62 65 'UnitPower', 'UnitPower',
63 66 'UnitPowerMax', 'UnitPowerMax',
64 67 'UnitPowerType', 'UnitPowerType',
File src/ChorusGroupFrame.lua changed (mode: 100644) (index 875db12..472e6a5)
2 2 @submodule chorus @submodule chorus
3 3 ]] ]]
4 4
5 local GetInstanceInfo = Chorus.test.GetInstanceInfo or GetInstanceInfo
6 5 local GetNumRaidMembers = Chorus.test.GetNumRaidMembers or GetNumRaidMembers local GetNumRaidMembers = Chorus.test.GetNumRaidMembers or GetNumRaidMembers
7 6 local InCombatLockdown = Chorus.test.InCombatLockdown or InCombatLockdown local InCombatLockdown = Chorus.test.InCombatLockdown or InCombatLockdown
8 7
8 local MAX_RAID_MEMBERS = MAX_RAID_MEMBERS or 40
9
9 10 local Chorus = Chorus local Chorus = Chorus
10 11 local ChorusLargeRaidFrame = ChorusLargeRaidFrame local ChorusLargeRaidFrame = ChorusLargeRaidFrame
11 12 local ChorusPartyFrame = ChorusPartyFrame local ChorusPartyFrame = ChorusPartyFrame
12 13 local ChorusSmallRaidFrame = ChorusSmallRaidFrame local ChorusSmallRaidFrame = ChorusSmallRaidFrame
13 14 local ChorusTinyRaidFrame = ChorusTinyRaidFrame local ChorusTinyRaidFrame = ChorusTinyRaidFrame
14 15
16 Chorus.groupProfileSet = {
17 ChorusPartyFrame,
18 ChorusLargeRaidFrame,
19 ChorusSmallRaidFrame,
20 ChorusTinyRaidFrame
21 }
22
23 local function produceSecureCommand()
24 local t = {
25 {'arena', 5, ChorusPartyFrame},
26 {'party', 4, ChorusPartyFrame},
27 {'raid', 5, ChorusLargeRaidFrame},
28 {'raid', 25, ChorusSmallRaidFrame},
29 {'raid', 40, ChorusTinyRaidFrame},
30 }
31
32 local secureCmd = ''
33 local i = 0
34 while (i < #t) do
35 i = i + 1
36
37 local r = t[i]
38
39 assert(r ~= nil)
40 assert('table' == type(r))
41 assert(3 == #r)
42
43 local j = 0
44
45 local u = r[1]
46 assert(u ~= nil)
47 assert('string' == type(u))
48 --[[ select(2, GetInstanceInfo()) == u ]]--
49 assert('arena' == u or 'party' == u or 'raid' == u)
50
51 local n = r[2]
52 assert(n ~= nil)
53 assert('number' == type(n))
54 n = math.abs(math.ceil(n))
55 assert(n >= 1)
56 assert(n <= MAX_RAID_MEMBERS)
57
58 local statement = ''
59 while (j < n) do
60 j = j + 1
61 local predicate = string.format("[@%s%d,exists]", u, j)
62 statement = statement .. predicate
63 end
64
65 local f = r[3]
66 assert(f ~= nil)
67 assert('table' == type(f) and 'userdata' == type(f[0]))
68
69 local m = f:GetName()
70 assert(m ~= nil)
71 assert('string' == type(m))
72 m = strtrim(m)
73 assert(string.len(m) >= 1)
74
75 statement = string.format("%s %s;\n", statement, m)
76
77 secureCmd = secureCmd .. statement
78 end
79
80 return secureCmd
81 end
82
83
15 84 --[[-- --[[--
16 85 Toggle the visibility raid group profile frame. Toggle the visibility raid group profile frame.
17 86
 
... ... and during combat.
31 100 @function groupFrameToggleInsecure @function groupFrameToggleInsecure
32 101 @return nothing @return nothing
33 102 ]] ]]
34 function Chorus.groupFrameToggleInsecure()
103 function Chorus.groupFrameToggleInsecure(...)
35 104 --[[ @fixme ]]-- --[[ @fixme ]]--
36 105 if InCombatLockdown() then if InCombatLockdown() then
37 106 return return
38 107 end end
39 108
40 local t = {ChorusLargeRaidFrame, ChorusPartyFrame,
41 ChorusSmallRaidFrame, ChorusTinyRaidFrame}
42
43 local i = 0
44 while (i < #t) do
45 i = i + 1
46 local f = t[i]
47 if f then
48 f:Hide()
49 end
50 end
51
52 local thef = nil
53 local _, instanceType = GetInstanceInfo()
54 if 'arena' == instanceType then
55 --[[-- @todo Add real arena group frame, with enemy frames.
56 ]]
57 thef = ChorusPartyFrame
58 elseif 'raid' == instanceType or 'none' == instanceType then
59 local n = GetNumRaidMembers()
60 if n > 25 then
61 thef = ChorusTinyRaidFrame
62 elseif n > 5 then
63 thef = ChorusSmallRaidFrame
64 else
65 thef = ChorusLargeRaidFrame
109 if 'ADDON_LOADED' == select(2, ...) then
110 if 'chorus' ~= select(3, ...) then
111 return
66 112 end end
67 elseif 'party' == instanceType or 'none' == instanceType then
68 thef = ChorusPartyFrame
69 113 end end
70 114
71 if thef then
72 thef:Show()
115 local n = GetNumRaidMembers() or 0
116
117 if n > 25 then
118 ChorusLargeRaidFrame:Hide()
119 ChorusPartyFrame:Hide()
120 ChorusSmallRaidFrame:Hide()
121 ChorusTinyRaidFrame:Show()
122 elseif n > 5 then
123 ChorusLargeRaidFrame:Hide()
124 ChorusPartyFrame:Hide()
125 ChorusSmallRaidFrame:Show()
126 ChorusTinyRaidFrame:Hide()
127 elseif n >= 1 then
128 ChorusLargeRaidFrame:Show()
129 ChorusPartyFrame:Hide()
130 ChorusSmallRaidFrame:Hide()
131 ChorusTinyRaidFrame:Hide()
132 elseif UnitPlayerOrPetInParty('party1') then
133 ChorusLargeRaidFrame:Hide()
134 ChorusPartyFrame:Show()
135 ChorusSmallRaidFrame:Hide()
136 ChorusTinyRaidFrame:Hide()
137 elseif n <= 0 then
138 ChorusLargeRaidFrame:Hide()
139 ChorusPartyFrame:Hide()
140 ChorusSmallRaidFrame:Hide()
141 ChorusTinyRaidFrame:Hide()
73 142 end end
74 143 end end
75 144
 
... ... function Chorus.groupFrameMain(self)
115 184 --[[ NOTE: The order of switch cases in the macro is significant. The --[[ NOTE: The order of switch cases in the macro is significant. The
116 185 first match takes precedence. ]]-- first match takes precedence. ]]--
117 186
118 local secureCmd = [=[[@arena1,exists] ChorusPartyFrame;
119 [@raid26,exists][@raid31,exists][@raid36,exists] ChorusTinyRaidFrame;
120 [@raid6,exists][@raid11,exists][@raid16,exists][@raid21,exists] ChorusSmallRaidFrame;
121 [@raid1,exists] ChorusLargeRaidFrame;
122 [@party1,exists] ChorusPartyFrame;]=]
187 local secureCmd = produceSecureCommand()
123 188 RegisterStateDriver(secureHandler, 'group', secureCmd) RegisterStateDriver(secureHandler, 'group', secureCmd)
124 189
125 190 --[[ When the property `group` of the given protected frame --[[ When the property `group` of the given protected frame
 
... ... function Chorus.groupFrameMain(self)
130 195 ]] ]]
131 196
132 197 secureHandler:WrapScript(secureHandler, 'OnAttributeChanged', [[ secureHandler:WrapScript(secureHandler, 'OnAttributeChanged', [[
133 if name ~= 'state-group' then
134 return
135 end
136 value = strtrim(value)
137
138 local currentGroupFrame = self:GetFrameRef(value)
139
140 local t = newtable()
141 table.insert(t, 'ChorusArenaFrame')
142 table.insert(t, 'ChorusPartyFrame')
143 table.insert(t, 'ChorusHugeRaidFrame')
144 table.insert(t, 'ChorusLargeRaidFrame')
145 table.insert(t, 'ChorusSmallRaidFrame')
146 table.insert(t, 'ChorusTinyRaidFrame')
198 local ChorusLargeRaidFrame = self:GetFrameRef('ChorusLargeRaidFrame')
199 local ChorusPartyFrame = self:GetFrameRef('ChorusPartyFrame')
200 local ChorusSmallRaidFrame = self:GetFrameRef('ChorusSmallRaidFrame')
201 local ChorusTinyRaidFrame = self:GetFrameRef('ChorusTinyRaidFrame')
147 202
148 203 local i = 0 local i = 0
149 while(i < #t) do
204 local n = 0
205 while (i < 40) do
150 206 i = i + 1 i = i + 1
151
152 local f = self:GetFrameRef(t[i])
153 if f and f ~= currentGroupFrame then
154 f:Hide()
207 if UnitPlayerOrPetInRaid('raid' .. tostring(i)) then
208 n = n + 1
155 209 end end
156 210 end end
157 211
158 if currentGroupFrame then
159 currentGroupFrame:Show()
212 if n > 25 then
213 ChorusLargeRaidFrame:Hide()
214 ChorusPartyFrame:Hide()
215 ChorusSmallRaidFrame:Hide()
216 ChorusTinyRaidFrame:Show()
217 elseif n > 5 then
218 ChorusLargeRaidFrame:Hide()
219 ChorusPartyFrame:Hide()
220 ChorusSmallRaidFrame:Show()
221 ChorusTinyRaidFrame:Hide()
222 elseif n >= 1 then
223 ChorusLargeRaidFrame:Show()
224 ChorusPartyFrame:Hide()
225 ChorusSmallRaidFrame:Hide()
226 ChorusTinyRaidFrame:Hide()
227 elseif UnitPlayerOrPetInParty('party1') then
228 ChorusLargeRaidFrame:Hide()
229 ChorusPartyFrame:Show()
230 ChorusSmallRaidFrame:Hide()
231 ChorusTinyRaidFrame:Hide()
232 elseif n <= 0 then
233 ChorusLargeRaidFrame:Hide()
234 ChorusPartyFrame:Hide()
235 ChorusSmallRaidFrame:Hide()
236 ChorusTinyRaidFrame:Hide()
160 237 end end
161 238 ]]) ]])
162 239
163 self:RegisterEvent('PARTY_MEMBERS_CHANGED')
240 self:RegisterEvent('PARTY_CONVERTED_TO_RAID')
164 241 self:RegisterEvent('PLAYER_LOGIN') self:RegisterEvent('PLAYER_LOGIN')
165 self:RegisterEvent('RAID_ROSTER_UPDATE')
242 self:RegisterEvent('ZONE_CHANGED')
243 self:RegisterEvent('ADDON_LOADED')
166 244 self:SetScript('OnEvent', Chorus.groupFrameToggleInsecure) self:SetScript('OnEvent', Chorus.groupFrameToggleInsecure)
167 245 end end
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