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!: Highlight offline players 7c28b6efa34f6e5450d2999acfd5a54880aa6df0 Vladyslav Bondarenko 2023-08-19 21:06:38
fix!: Change aura sorting ba249c7309ccbcb14fea727b347c3dd532af73ee Vladyslav Bondarenko 2023-08-19 20:40:31
feat: Show player in party 198e8c86b9b93dd9c3edf7045d5bbcb9142d76d6 Vladyslav Bondarenko 2023-08-19 20:38:40
feat(doc)!: Add project description 4b406a549e83dda3845104e8a6a233eae481a3c8 Vladyslav Bondarenko 2023-08-19 05:58:50
fix: Typo in ChorusRaidFrame 61fb4f93c227e3b94a52df26eeffece12fe86e55 Vladyslav Bondarenko 2023-08-18 21:00:34
feat(build): Document build validation scripts d19d03c4a20c8c02fee8b4c1c00241c58baa12eb Vladyslav Bondarenko 2023-08-18 20:57:35
feat: Update raid frame ff5ad9619c6af14f7e1719cbaaf34fa0465c1f12 Vladyslav Bondarenko 2023-08-18 20:54:29
feat: Update add-on loading mechanism 2d8df81c17fbfcaf8d0bb966a3373503bb32a585 Vladyslav Bondarenko 2023-08-18 19:59:39
feat: Update progress frames on demand only 7c18488e61b5889eca4b057602fbc41883fc53f1 Vladyslav Bondarenko 2023-08-18 19:50:41
feat: Add basic font customization 321c2e6251e2e619101f8d57b4d4b1ef10a79694 Vladyslav Bondarenko 2023-08-18 17:29:12
fix: Improve range indicator accuracy 17ee7011ae6bdd3e28bae4694d40a68ea799d001 Vladyslav Bondarenko 2023-08-17 23:52:43
feat!: Add target range indicator 83b3fae1f675042b7d9e89c09aedc864e8fcaa27 Vladyslav Bondarenko 2023-08-17 22:41:08
feat: Add class color code to target frame 990cdf1d9f44c9916948697e74f86d6490d83304 Vladyslav Bondarenko 2023-08-17 20:59:28
feat: Add solo unit buttons 4658af2b5142ff2ca86c2c4b48577879117a9ecc Vladyslav Bondarenko 2023-08-17 20:38:10
feat: Add power bar to raid unit button b25bd8d28c30cb003bf8cfe2886e2cfd8442d32f Vladyslav Bondarenko 2023-08-17 18:48:29
feat!: Add basic raid frame stub 66e27810a396b564cf7cd737e1f402f4f433b879 Vladyslav Bondarenko 2023-08-17 17:40:08
feat: Add raid frame stub 5fd737cef8e3fc700bab1e6a89ceb68c21495eea Vladyslav Bondarenko 2023-08-16 02:35:08
fix: Show auras correctly at startup 54136c9cedf83fa2a8559b879ab8410a6e28646c Vladyslav Bondarenko 2023-08-15 19:15:48
fix!: Shadowing correct functions 53991b2f7093e765993f8423377602ca22e234da Vladyslav Bondarenko 2023-08-15 18:22:56
fix: Add UnitClass shadowing local e87c61c3cae4cdb945714c67259a6304201968d0 Vladyslav Bondarenko 2023-08-15 18:21:32
Commit 7c28b6efa34f6e5450d2999acfd5a54880aa6df0 - fix!: Highlight offline players
Given a player is disconnected from the game server at runtime, then
modify their corresponding raid unit button accordingly. In particular
disable health bar, power bar and aura frame temporarily, since they are
irrelevant at that point. This also aims to prevent runtime exceptions.

Sometimes current and maximum health or power of a unit return zeros.
Usually this happens when a player goes offline. The problem is that
it's inconsistent and sometimes isn't even representative of the real
state of the game. The add-on implementation sometimes yielded false
alarms because of it. Work around the issue and quietly pretend that
there is no problem. In most cases there isn't one.
Author: Vladyslav Bondarenko
Author date (UTC): 2023-08-19 21:06
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2023-08-19 21:30
Parent(s): ba249c7309ccbcb14fea727b347c3dd532af73ee
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: 10c3fdfe527e1e299f7a960aac9fb071635b84be
File Lines added Lines deleted
etc/luacheckrc.lua 1 0
src/ChorusAuraButtonTemplate.lua 3 2
src/ChorusAuraFrameTemplate.lua 3 1
src/ChorusProgressFrameTemplate.lua 8 3
src/ChorusUnitNameFrameTemplate.lua 9 0
File etc/luacheckrc.lua changed (mode: 100644) (index 6e54361..4656708)
... ... stds.wow = {
17 17 'UnitGUID', 'UnitGUID',
18 18 'UnitHealth', 'UnitHealth',
19 19 'UnitHealthMax', 'UnitHealthMax',
20 'UnitIsConnected',
20 21 'UnitIsCorpse', 'UnitIsCorpse',
21 22 'UnitIsDead', 'UnitIsDead',
22 23 'UnitIsEnemy', 'UnitIsEnemy',
File src/ChorusAuraButtonTemplate.lua changed (mode: 100644) (index 0151ce4..006aed5)
... ... local DebuffTypeColor = DebuffTypeColor
2 2 local GetTime = GetTime local GetTime = GetTime
3 3 local UnitAura = UnitAura local UnitAura = UnitAura
4 4 local UnitExists = UnitExists local UnitExists = UnitExists
5 local UnitIsConnected = UnitIsConnected
5 6
6 7 local Chorus = Chorus local Chorus = Chorus
7 8
 
... ... local function apply(auraButton, unitDesignation, auraIndex, filter)
221 222 assert(string.len(filter) <= 256) assert(string.len(filter) <= 256)
222 223
223 224
224 if not UnitExists(unitDesignation) then
225 if not UnitExists(unitDesignation) or not UnitIsConnected(unitDesignation) then
225 226 auraButton:Hide() auraButton:Hide()
226 227 auraButton:SetScript('OnUpdate', nil) auraButton:SetScript('OnUpdate', nil)
227 228 return return
 
... ... local function auraButtonEventProcessor(self, eventCategory)
262 263 assert(string.len(u) >= 1) assert(string.len(u) >= 1)
263 264 assert(string.len(u) <= 256) assert(string.len(u) <= 256)
264 265
265 if UnitExists(u) then
266 if UnitExists(u) and UnitIsConnected(u) then
266 267 self:Show() self:Show()
267 268 else else
268 269 self:Hide() self:Hide()
File src/ChorusAuraFrameTemplate.lua changed (mode: 100644) (index cb1d4f4..703e773)
1 1 local Chorus = Chorus local Chorus = Chorus
2 2
3 3 local UnitAura = UnitAura local UnitAura = UnitAura
4 local UnitExists = UnitExists
5 local UnitIsConnected = UnitIsConnected
4 6
5 7 --[[ TODO Globalize special spells. ]]-- --[[ TODO Globalize special spells. ]]--
6 8 local auraWeightMap = { local auraWeightMap = {
 
... ... local function auraFrameEventProcessor(self, eventCategory, ...)
136 138 assert(string.len(unitDesignation) >= 1) assert(string.len(unitDesignation) >= 1)
137 139 assert(string.len(unitDesignation) <= 256) assert(string.len(unitDesignation) <= 256)
138 140
139 if UnitExists(unitDesignation) then
141 if UnitExists(unitDesignation) and UnitIsConnected(unitDesignation) then
140 142 self:Show() self:Show()
141 143 else else
142 144 self:Hide() self:Hide()
File src/ChorusProgressFrameTemplate.lua changed (mode: 100644) (index 4045059..1815f31)
... ... local UnitClass = UnitClass
4 4 local UnitExists = UnitExists local UnitExists = UnitExists
5 5 local UnitHealth = UnitHealth local UnitHealth = UnitHealth
6 6 local UnitHealthMax = UnitHealthMax local UnitHealthMax = UnitHealthMax
7 local UnitIsConnected = UnitIsConnected
7 8 local UnitIsCorpse = UnitIsCorpse local UnitIsCorpse = UnitIsCorpse
8 9 local UnitIsDead = UnitIsDead local UnitIsDead = UnitIsDead
9 10 local UnitIsGhost = UnitIsGhost local UnitIsGhost = UnitIsGhost
 
... ... local function getRatio(a, b)
59 60
60 61 assert(b ~= nil) assert(b ~= nil)
61 62 assert('number' == type(b)) assert('number' == type(b))
62 --[[ FIXME Power frame fails when relevant player is disconnected ]]--
63 63 assert(b > 0) assert(b > 0)
64 64
65 65 assert(a <= b) assert(a <= b)
 
... ... local function applySize(self)
88 88 end end
89 89
90 90 local function applyRatio(self, a, b) local function applyRatio(self, a, b)
91 --[[ Work around quirks of the native API. ]]--
92 b = math.max(b, 1)
93
91 94 self:SetValue(getRatio(a, b)) self:SetValue(getRatio(a, b))
92 95 end end
93 96
 
... ... local function applyOverlay(self, a, b)
100 103
101 104 assert(b ~= nil) assert(b ~= nil)
102 105 assert('number' == type(b)) assert('number' == type(b))
106 --[[ Work around quirks of the native API. ]]--
107 b = math.max(b, 1)
103 108 assert(b > 0) assert(b > 0)
104 109
105 110 assert(a <= b) assert(a <= b)
 
... ... local function healthFrameEventProcessor(self)
269 274 assert(string.len(unitDesignation) >= 1) assert(string.len(unitDesignation) >= 1)
270 275 assert(string.len(unitDesignation) <= 256) assert(string.len(unitDesignation) <= 256)
271 276
272 if UnitExists(unitDesignation) then
277 if UnitExists(unitDesignation) and UnitIsConnected(unitDesignation) then
273 278 self:Show() self:Show()
274 279 else else
275 280 self:Hide() self:Hide()
 
... ... local function powerFrameEventProcessor(self)
341 346 assert(string.len(unitDesignation) >= 1) assert(string.len(unitDesignation) >= 1)
342 347 assert(string.len(unitDesignation) <= 256) assert(string.len(unitDesignation) <= 256)
343 348
344 if UnitExists(unitDesignation) then
349 if UnitExists(unitDesignation) and UnitIsConnected(unitDesignation) then
345 350 self:Show() self:Show()
346 351 else else
347 352 self:Hide() self:Hide()
File src/ChorusUnitNameFrameTemplate.lua changed (mode: 100644) (index 890bf97..48bbe16)
... ... local function unitNameEventProcessor(self)
21 21 local name = UnitName(unitDesignation) local name = UnitName(unitDesignation)
22 22 label:SetText(name) label:SetText(name)
23 23
24 if UnitIsConnected(unitDesignation) and UnitExists(unitDesignation) then
25 label:SetTextColor(1, 1, 1)
26 else
27 label:SetTextColor(0.7, 0.7, 0.7)
28 return
29 end
30
24 31 if not self.strategy then if not self.strategy then
25 32 return return
26 33 elseif 'UnitClass' ~= self.strategy then elseif 'UnitClass' ~= self.strategy then
 
... ... function Chorus.unitNameFrameMain(self)
67 74 self:RegisterEvent('PARTY_MEMBER_DISABLE') self:RegisterEvent('PARTY_MEMBER_DISABLE')
68 75 self:RegisterEvent('PARTY_MEMBER_ENABLE') self:RegisterEvent('PARTY_MEMBER_ENABLE')
69 76 self:RegisterEvent('PLAYER_ALIVE') self:RegisterEvent('PLAYER_ALIVE')
77 self:RegisterEvent('PLAYER_ENTERING_WORLD')
70 78 self:RegisterEvent('PLAYER_FOCUS_CHANGED') self:RegisterEvent('PLAYER_FOCUS_CHANGED')
71 79 self:RegisterEvent('PLAYER_LOGIN') self:RegisterEvent('PLAYER_LOGIN')
80 self:RegisterEvent('PLAYER_LOGOUT')
72 81 self:RegisterEvent('PLAYER_TARGET_CHANGED') self:RegisterEvent('PLAYER_TARGET_CHANGED')
73 82 self:RegisterEvent('RAID_ROSTER_UPDATE') self:RegisterEvent('RAID_ROSTER_UPDATE')
74 83 self:RegisterEvent('UNIT_NAME_UPDATE') self:RegisterEvent('UNIT_NAME_UPDATE')
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