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: Display health deficit 0620038bf95d2c8e77eb088f2345764f428563d4 Vladyslav Bondarenko 2023-08-20 17:55:49
fix(build): Update rockspec dcffb9897deb97fa4039cd4513a51e397ebc4ab7 Vladyslav Bondarenko 2023-08-20 17:16:25
feat!: Update raid frame layout ad51f7e37e8babd30ee45c5b87d931a09c1fc0f3 Vladyslav Bondarenko 2023-08-20 14:45:38
fix: Do not show range to oneself c055a76806c5646e4027698c6a105f06199be4ae Vladyslav Bondarenko 2023-08-20 04:29:32
feat!: Add raid targeting icons 53121d5d75fb55d745734337ab70283496e46e7c Vladyslav Bondarenko 2023-08-19 23:22:01
feat!: Add general threat situation widget a002db1c9c810f21fe1e1c042a435875bbe5f317 Vladyslav Bondarenko 2023-08-19 22:20:58
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
Commit 0620038bf95d2c8e77eb088f2345764f428563d4 - feat: Display health deficit
Given a unit is missing health (is damaged), in addition to current
health amount and health percentage, show the exact amount of health
missing.

This change requires modifying the layout of raid unit buttons to fit
additonal text labels.
Author: Vladyslav Bondarenko
Author date (UTC): 2023-08-20 17:55
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2023-08-20 17:55
Parent(s): dcffb9897deb97fa4039cd4513a51e397ebc4ab7
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: ddde24891595cd9511fe2e81b1fb814aeab0878b
File Lines added Lines deleted
src/ChorusProgressFrameTemplate.lua 79 38
src/ChorusProgressFrameTemplate.xml 23 2
src/ChorusRaidUnitButtonTemplate.xml 3 3
File src/ChorusProgressFrameTemplate.lua changed (mode: 100644) (index 1815f31..0ee693c)
... ... local function validateProgressFrame(self)
29 29 local artwork = self.artwork local artwork = self.artwork
30 30 assert(artwork ~= nil) assert(artwork ~= nil)
31 31
32 local label = self.label
33 assert(label ~= nil)
32 local label1 = self.label1
33 assert(label1 ~= nil)
34
35 local label2 = self.label2
36 assert(label2 ~= nil)
37
38 local label3 = self.label3
39 assert(label3 ~= nil)
34 40
35 41 local ratio = self:GetValue() local ratio = self:GetValue()
36 42 assert(ratio ~= nil) assert(ratio ~= nil)
 
... ... end
77 83 local function applySize(self) local function applySize(self)
78 84 assert(self ~= nil) assert(self ~= nil)
79 85
80 local label = self.label
81 assert(label ~= nil)
86 local label1 = self.label1
87 assert(label1 ~= nil)
88
89 local label2 = self.label2
90 assert(label2 ~= nil)
91
92 local label3 = self.label3
93 assert(label3 ~= nil)
82 94
83 95 if self:GetHeight() >= 12 then if self:GetHeight() >= 12 then
84 label:Show()
96 label1:Show()
97 label2:Show()
98 label3:Show()
85 99 else else
86 label:Hide()
100 label1:Hide()
101 label2:Hide()
102 label3:Hide()
87 103 end end
88 104 end end
89 105
 
... ... local function applyRatio(self, a, b)
94 110 self:SetValue(getRatio(a, b)) self:SetValue(getRatio(a, b))
95 111 end end
96 112
113 local function formatQuantity(quantity)
114 assert(quantity ~= nil)
115 assert('number' == type(quantity))
116
117 local t
118 if math.abs(quantity) < 1000 then
119 t = string.format('%d',quantity)
120 elseif math.abs(quantity) < 1000000 then
121 t = string.format('%.2f K', quantity / 1000)
122 else
123 t = string.format('%.2f M', quantity / 1000000)
124 end
125
126 return t
127 end
128
97 129 local function applyOverlay(self, a, b) local function applyOverlay(self, a, b)
98 130 assert(self ~= nil) assert(self ~= nil)
99 131
 
... ... local function applyOverlay(self, a, b)
111 143
112 144 local ratio = getRatio(a, b) local ratio = getRatio(a, b)
113 145
114 local t = ''
115 local scale
116 local fontSize = 12
117 if a < 1000 then
118 t = t .. string.format('%d', a)
119 elseif a < 1000000 then
120 t = t .. string.format('%.2f K', a / 1000)
121 else
122 t = t .. string.format('%.2f M', a / 1000000)
123 end
124
125 if 23 <= self:GetHeight() then
126 t = t .. '\n'
127 scale = 1 / fontSize / 2
128 else
129 scale = 1 / fontSize
130 t = t .. ' '
131 end
132
133 t = t .. string.format('%.0f%%', ratio * 100)
146 local label1 = self.label1 or _G[self:GetName() .. 'Text1']
147 assert(label1 ~= nil)
148 local t = formatQuantity(a)
149 label1:SetText(t)
134 150
135 local label = self.label or _G[self:GetName() .. 'Text']
136 assert(label ~= nil)
137 label:SetText(t)
151 local label2 = self.label2 or _G[self:GetName() .. 'Text2']
152 assert(label2 ~= nil)
153 local e = string.format('%.0f%%', ratio * 100)
154 label2:SetText(e)
138 155
139 156 --[[ ShadowedUnitFrames recommend this approach for adjusting font size. ]]-- --[[ ShadowedUnitFrames recommend this approach for adjusting font size. ]]--
140 157 if t ~= nil and string.len(t) >= 1 then if t ~= nil and string.len(t) >= 1 then
141 self:SetScale(label:GetStringHeight() * scale)
158 local fontSize = 12
159 self:SetScale(label1:GetStringHeight() / fontSize)
142 160 end end
143 161 end end
144 162
 
... ... local function applyRatioHealth(self, unitDesignation)
153 171 applyRatio(self, a, b) applyRatio(self, a, b)
154 172 end end
155 173
174 local function applyOverlayHealthDeficit(self, a, b)
175 assert(self ~= nil)
176
177 local label3 = self.label3 or _G[self:GetName() .. 'Text3']
178 assert(label3 ~= nil)
179 if a and b and a >= 1 and b >= 1 and a < b then
180 local c = a - b
181 local t = formatQuantity(c)
182 label3:SetText(t)
183 else
184 label3:SetText(nil)
185 end
186 end
187
156 188 local function applyOverlayHealth(self, unitDesignation) local function applyOverlayHealth(self, unitDesignation)
157 189 assert(self ~= nil) assert(self ~= nil)
158 190
159 191 assert(unitDesignation ~= nil) assert(unitDesignation ~= nil)
160 192
161 local label = self.label
162 assert(label ~= nil)
193 local label1 = self.label1
194 assert(label1 ~= nil)
163 195
164 196 local artwork = self.artwork local artwork = self.artwork
165 197 assert(artwork ~= nil) assert(artwork ~= nil)
166 198
167 199 --[[ TODO Use indicators instead of localized text for character alive statuses. ]]-- --[[ TODO Use indicators instead of localized text for character alive statuses. ]]--
168 200 if UnitIsCorpse(unitDesignation) then if UnitIsCorpse(unitDesignation) then
169 label:SetText('(Corpse)')
201 label1:SetText('(Corpse)')
170 202 elseif UnitIsGhost(unitDesignation) then elseif UnitIsGhost(unitDesignation) then
171 label:SetText('(Ghost)')
203 label1:SetText('(Ghost)')
172 204 elseif UnitIsDead(unitDesignation) then elseif UnitIsDead(unitDesignation) then
173 label:SetText('(Dead)')
205 label1:SetText('(Dead)')
174 206 else else
175 207 local a = UnitHealth(unitDesignation) or 0 local a = UnitHealth(unitDesignation) or 0
176 208 local b = UnitHealthMax(unitDesignation) or 1 local b = UnitHealthMax(unitDesignation) or 1
177 209
178 210 applyOverlay(self, a, b) applyOverlay(self, a, b)
211 applyOverlayHealthDeficit(self, a, b)
179 212 end end
180 213 end end
181 214
 
... ... function Chorus.progressFrameMain(self)
403 436 assert(artwork ~= nil) assert(artwork ~= nil)
404 437 self.artwork = artwork self.artwork = artwork
405 438
406 local label = _G[frameDesignation .. 'Text']
407 assert(label ~= nil)
408 self.label = label
439 local label1 = _G[frameDesignation .. 'Text1']
440 assert(label1 ~= nil)
441 self.label1 = label1
442
443 local label2 = _G[frameDesignation .. 'Text2']
444 assert(label2 ~= nil)
445 self.label2 = label2
446
447 local label3 = _G[frameDesignation .. 'Text3']
448 assert(label3 ~= nil)
449 self.label3 = label3
409 450
410 451 self:RegisterEvent('PARTY_CONVERTED_TO_RAID') self:RegisterEvent('PARTY_CONVERTED_TO_RAID')
411 452 self:RegisterEvent('PARTY_MEMBERS_CHANGED') self:RegisterEvent('PARTY_MEMBERS_CHANGED')
File src/ChorusProgressFrameTemplate.xml changed (mode: 100644) (index e3bbe3f..2ac7315)
5 5 <Layers> <Layers>
6 6 <Layer level="BACKGROUND"> <Layer level="BACKGROUND">
7 7 <Texture name="$parentBackground" nonBlocking="true" setAllPoints="true"> <Texture name="$parentBackground" nonBlocking="true" setAllPoints="true">
8 <Color r="0" g="0" b="0" a="1"/>
8 <Color r="0" g="0" b="0" a="0.4"/>
9 9 </Texture> </Texture>
10 10 </Layer> </Layer>
11 11 <Layer level="OVERLAY"> <Layer level="OVERLAY">
12 <FontString name="$parentText" inherits="ChorusFont12Mono" setAllPoints="true"/>
12 <FontString name="$parentText1" inherits="ChorusFont12Mono" justifyH="LEFT">
13 <Anchors>
14 <Anchor point="BOTTOMLEFT">
15 <Offset x="0" y="0"/>
16 </Anchor>
17 </Anchors>
18 </FontString>
19 <FontString name="$parentText2" inherits="ChorusFont12Mono" justifyH="RIGHT">
20 <Anchors>
21 <Anchor point="BOTTOMRIGHT">
22 <Offset x="0" y="0"/>
23 </Anchor>
24 </Anchors>
25 </FontString>
26 <FontString name="$parentText3" inherits="ChorusFont12Mono" justifyH="RIGHT">
27 <Anchors>
28 <Anchor point="TOPRIGHT">
29 <Offset x="0" y="0"/>
30 </Anchor>
31 </Anchors>
32 <Color r="1" g="0" b="0"/>
33 </FontString>
13 34 </Layer> </Layer>
14 35 </Layers> </Layers>
15 36 <BarTexture name="$parentArtwork" file="Interface\TargetingFrame\UI-StatusBar"/> <BarTexture name="$parentArtwork" file="Interface\TargetingFrame\UI-StatusBar"/>
File src/ChorusRaidUnitButtonTemplate.xml changed (mode: 100644) (index 16db61a..2316034)
52 52 <Anchors> <Anchors>
53 53 <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"> <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
54 54 <Offset> <Offset>
55 <AbsDimension x="94" y="-36"/>
55 <AbsDimension x="94" y="-18"/>
56 56 </Offset> </Offset>
57 57 </Anchor> </Anchor>
58 58 </Anchors> </Anchors>
 
61 61 <Anchors> <Anchors>
62 62 <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"> <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
63 63 <Offset> <Offset>
64 <AbsDimension x="0" y="-36"/>
64 <AbsDimension x="0" y="-18"/>
65 65 </Offset> </Offset>
66 66 </Anchor> </Anchor>
67 67 </Anchors> </Anchors>
 
70 70 <Anchors> <Anchors>
71 71 <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPLEFT"> <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPLEFT">
72 72 <Offset> <Offset>
73 <AbsDimension x="0" y="-36"/>
73 <AbsDimension x="0" y="-18"/>
74 74 </Offset> </Offset>
75 75 </Anchor> </Anchor>
76 76 </Anchors> </Anchors>
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