List of commits:
Subject Hash Author Date (UTC)
feat!: Add power bar 86e4270556a9570778f43abb662f1174ce4351e0 Vladyslav Bondarenko 2022-05-10 20:38:48
fix(choir)!: Update shortcuts without reloading UI 7f29a9404aa869805403f788703e048bcd538da0 Vladyslav Bondarenko 2022-01-26 23:13:05
feat(choir)!: Add spoiler pagination 1f1a418878887241a16374ca31592640a0c2941a Vladyslav Bondarenko 2022-01-08 13:30:53
fix(choir)!: Health bar update processor 7be81c650f45198678e8ca517afeb8413638579d Vladyslav Bondarenko 2022-01-08 10:14:54
feat(choir): Unit button contextual menu 981e9016b0c9a377219a13d2716d09de899efe60 Vladyslav Bondarenko 2022-01-08 10:06:50
fix(choir): Update range indicator correctly e2810d30fe62427920479057e1cc28f3ed45ff31 Vladyslav Bondarenko 2022-01-08 03:34:08
fix(choir): Raid frame and spoiler overlap e1a8da43270859a3c36b67f81357a935f0b6f2ef Vladyslav Bondarenko 2022-01-08 02:00:26
fix(choir): Update only existing units when necessary 82b7e0cfd4354263f27ea206f555e9771f2e8f8c Vladyslav Bondarenko 2021-12-31 07:45:00
feat(choir): Render unit threat situation dee7167e3a7e453425248a1062560f9bfd8b3bb4 Vladyslav Bondarenko 2021-12-28 01:39:09
fix(choir): Render dungeon role correctly for Cata 590a4abfd82659624688c4c1658de87693d3cd30 Vladyslav Bondarenko 2021-12-28 00:31:52
fix(choir): Show raid frame at player login 21a86d3840fb810c4ff4c67490aae7d5251c1bae Vladyslav Bondarenko 2021-11-24 06:07:10
feat(choir)!: Add interface options for raid frame ce677d3d0e7cfe05d1da5b159f52a0808db9ce9a Vladyslav Bondarenko 2021-11-24 06:05:37
feat(choir): Add conf spell shortcut default button c8e2c3493896f5ae589c516f742bbafd528140db Vladyslav Bondarenko 2021-11-24 02:28:19
feat(choir)!: Add configuration menu 12319ce873aecea4bfc0addec7c5ac5c1f225237 Vladyslav Bondarenko 2021-11-21 09:26:05
feat(choir): Add unit game tooltip 3ec490e489bb105f5096d5bb3e56814873deec3f Vladyslav Bondarenko 2021-11-20 09:34:12
fix(choir): Raid group frame arrange correctly b592f3f018ee521a821447ccf837aded703ad447 Vladyslav Bondarenko 2021-11-18 22:02:52
feat(choir): Render group role indicator for units 5f3a7c24d3f79035b8faa156355a2d017688134e Vladyslav Bondarenko 2021-11-18 22:02:27
feat(choir): Adjust raid group frame position f99a54133a1761034baca93bfa8814c614191818 Vladyslav Bondarenko 2021-11-18 00:35:35
feat(choir): Add debuff buttons for raid fe66339420a9eb5e4823cc4fe45e0d97b2983073 Vladyslav Bondarenko 2021-11-17 00:55:54
feat(choir): Add texture to health bars ddaeb29d7ecfd95a98bcc85b3f4f7676c7ccd4d7 Vladyslav Bondarenko 2021-11-14 21:40:26
Commit 86e4270556a9570778f43abb662f1174ce4351e0 - feat!: Add power bar
Add progress bar to unit buttons that shows the remaining amount of the
primary power (resource) of the unit. The possible power types are mana,
energy, rage or runic power.

Additionally reduce the amount of screen space raid unit buttons occupy.
For that purose also employ a different font (typeface) that renders
better in smaller frames.
Author: Vladyslav Bondarenko
Author date (UTC): 2022-05-10 20:38
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2022-05-10 20:40
Parent(s): bc1c607d16989a0f2f8755702f744d7b35d2308b
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: 86a937045b7eeb272b00bd42339cab3d602cc65f
File Lines added Lines deleted
.luacheckrc 10 1
choir.lua 219 117
choir.toc 1 1
File .luacheckrc changed (mode: 100644) (index ce107b5..67208a8)
... ... stds.wow = {
17 17 'InterfaceOptions_AddCategory', 'InterfaceOptions_AddCategory',
18 18 'IsSpellInRange', 'IsSpellInRange',
19 19 'NumberFont_OutlineThick_Mono_Small', 'NumberFont_OutlineThick_Mono_Small',
20 'PowerBarColor',
20 21 'RAID_CLASS_COLORS', 'RAID_CLASS_COLORS',
21 22 'RAID_TARGET_ICON', 'RAID_TARGET_ICON',
22 23 'RegisterUnitWatch', 'RegisterUnitWatch',
 
... ... stds.wow = {
41 42 'UnitIsMercenary', 'UnitIsMercenary',
42 43 'UnitIsPlayer', 'UnitIsPlayer',
43 44 'UnitIsUnit', 'UnitIsUnit',
45 'UnitMana',
46 'UnitManaMax',
44 47 'UnitName', 'UnitName',
45 48 'UnitPlayerOrPetInRaid', 'UnitPlayerOrPetInRaid',
46 49 'UnitPopupMenus', 'UnitPopupMenus',
47 50 'UnitPopup_ShowMenu', 'UnitPopup_ShowMenu',
51 'UnitPower',
52 'UnitPowerMax',
53 'UnitPowerType',
48 54 'UnitThreatSituation', 'UnitThreatSituation',
49 55 'UnregisterUnitWatch', 'UnregisterUnitWatch',
50 56 'date', 'date',
 
... ... stds.choir = {
75 81 'ChoirSpoiler8', 'ChoirSpoiler8',
76 82 'ChoirSpoiler9', 'ChoirSpoiler9',
77 83 'ClearcastingFrame', 'ClearcastingFrame',
78 'UnifontRegular16',
84 'ArimoRegular12',
85 'ArimoRegular16',
86 'CousineRegular12',
87 'CousineRegular16',
79 88 } }
80 89 } }
81 90
File choir.lua changed (mode: 100644) (index 091d36e..da528f4)
1 1 --[[ TODO Add pet target button ]]-- --[[ TODO Add pet target button ]]--
2 --[[ TODO Add close spoiler button ]]--
3 --[[ TODO Add next and previous spoiler button ]]--
4 2 --[[ TODO Add new spoiler for enemy team in arena ]]-- --[[ TODO Add new spoiler for enemy team in arena ]]--
5 3 --[[ TODO Add permanent unit buttons for player, target, focus and pet units ]]-- --[[ TODO Add permanent unit buttons for player, target, focus and pet units ]]--
6 4 --[[ TODO Add offline indicator ]]-- --[[ TODO Add offline indicator ]]--
7 5 --[[ TODO Add rest indicator ]]-- --[[ TODO Add rest indicator ]]--
8 --[[ TODO Add right-click context menu ]]--
9 --[[ TODO Add role check indicator ]]--
10 6 --[[ FIXME Raid frame and spoiler overlap when raid roster updates ]]-- --[[ FIXME Raid frame and spoiler overlap when raid roster updates ]]--
11 7 --[[ FIXME Range indicator sometimes does not update in time ]]-- --[[ FIXME Range indicator sometimes does not update in time ]]--
12 8
 
... ... local function createLabel(ownerFrame, fontObject)
67 63 assert (ownerFrame ~= nil) assert (ownerFrame ~= nil)
68 64
69 65 local t = ownerFrame:CreateFontString((ownerFrame:GetName() or '') .. 'Text', 'OVERLAY') local t = ownerFrame:CreateFontString((ownerFrame:GetName() or '') .. 'Text', 'OVERLAY')
70 fontObject = fontObject or NumberFont_OutlineThick_Mono_Small
66 fontObject = fontObject or ArimoRegular12 or CousineRegular12 or NumberFont_OutlineThick_Mono_Small
71 67 assert (fontObject ~= nil) assert (fontObject ~= nil)
72 68 t:SetFontObject(fontObject) t:SetFontObject(fontObject)
73 69 t:SetAllPoints() t:SetAllPoints()
 
... ... local function getUnitHealthDeficit(unitDesignation)
173 169 return math.abs(c) - math.abs(m) return math.abs(c) - math.abs(m)
174 170 end end
175 171
176 local function getUnitHealthRatio(unitDesignation)
177 assert (unitDesignation ~= nil)
178
179 local m = math.abs(math.max(UnitHealthMax(unitDesignation) or 1, 1))
180 local c = math.abs(UnitHealth(unitDesignation) or 1)
181
182 return c / m
183 end
184
185 172 local function getClassColor(classDesignation) local function getClassColor(classDesignation)
186 173 assert (classDesignation ~= nil) assert (classDesignation ~= nil)
187 174 assert ('string' == type(classDesignation)) assert ('string' == type(classDesignation))
 
... ... local function getClassColor(classDesignation)
196 183 return t['r'], t['g'], t['b'] return t['r'], t['g'], t['b']
197 184 end end
198 185
199 local function healthBarUpdateOverlay(healthBarFrame, overlay, unitDesignation)
200 assert (healthBarFrame ~= nil)
201 assert (overlay ~= nil)
202 assert (unitDesignation ~= nil)
203
204 local ratio = 1
205 if UnitExists(unitDesignation) then
206 ratio = getUnitHealthRatio(unitDesignation) or 1
207 end
208 ratio = math.min(math.max(0, ratio or 1), 1)
209
210 --[[ Apply health bar width changes. ]]--
211 overlay:SetPoint('BOTTOMLEFT', healthBarFrame, 'BOTTOMLEFT', 0, 0)
212 overlay:SetPoint('TOPRIGHT', healthBarFrame, 'TOPRIGHT', (ratio - 1) * healthBarFrame:GetWidth(), 0)
213
214 --[[ Apply health bar color changes. ]]--
215 local a = 1
216 local rangeSpell = ChoirRangeSpellName
217 --[[ NOTE IsSpellInRange returns either 0, 1 or nil ]]--
218 if rangeSpell and 1 ~= IsSpellInRange(rangeSpell, unitDesignation) then
219 a = 0.5
220 end
221
222 if ratio <= 0.35 then
223 overlay:SetVertexColor(1, 0, 0, a)
224 elseif ratio <= 0.5 then
225 overlay:SetVertexColor(1, 1, 0, a)
226 else
227 overlay:SetVertexColor(0, 1, 0, a)
228 end
229 end
230
231 186 local function healthBarUpdateText(healthBarFrame, label, unitDesignation) local function healthBarUpdateText(healthBarFrame, label, unitDesignation)
232 187 assert (healthBarFrame ~= nil) assert (healthBarFrame ~= nil)
233 188 assert (label ~= nil) assert (label ~= nil)
 
... ... local function healthBarUpdateText(healthBarFrame, label, unitDesignation)
252 207 end end
253 208
254 209 label:SetText(t) label:SetText(t)
255
256 210 end end
257 211
258 local function healthBarEventProcessor(healthBarFrame, eventCategory, targetUnitDesignation)
259 assert (healthBarFrame ~= nil)
260 assert (eventCategory == 'UNIT_HEALTH' or eventCategory == 'UNIT_COMBAT')
212 local function powerBarUpdateText(barFrame, label, unitDesignation)
213 assert (barFrame ~= nil)
214 assert (label ~= nil)
215 assert (unitDesignation ~= nil)
261 216
262 local unitButton = healthBarFrame:GetParent()
263 assert (unitButton ~= nil)
217 local d = UnitPower(unitDesignation) or 0
218 local t
219 if math.abs(d) > 1000 then
220 t = math.floor(d / 1000) .. ' K'
221 elseif math.abs(d) > 1000000 then
222 t = math.floor(d / 1000000) .. ' M'
223 else
224 t = tostring(math.floor(d))
225 end
226 label:SetText(t)
227 end
264 228
265 local unitDesignation = unitButton:GetAttribute('unit')
229 local function progressBarUpdateText(barFrame, label, unitDesignation, eventCategory)
230 if 'UNIT_HEALTH' == eventCategory then
231 healthBarUpdateText(barFrame, label, unitDesignation)
232 else
233 powerBarUpdateText(barFrame, label, unitDesignation)
234 end
235 end
236
237 local function getUnitProgress(unitDesignation, eventCategory)
266 238 assert (unitDesignation ~= nil) assert (unitDesignation ~= nil)
239 assert ('string' == type(unitDesignation))
240 assert (string.len(unitDesignation) >= 2)
267 241
268 242 if not UnitExists(unitDesignation) then if not UnitExists(unitDesignation) then
269 243 return return
270 244 end end
271 245
272 --[[ Assume UNIT_HEALTH event is processed for the relevant unit. ]]--
273 if targetUnitDesignation ~= unitDesignation then
274 return
246 assert (eventCategory ~= nil)
247 assert ('string' == type(eventCategory))
248 assert (string.len(eventCategory) >= 2)
249
250 local progressRatio
251 if 'UNIT_HEALTH' == eventCategory then
252 local a = math.abs(UnitHealth(unitDesignation) or 0)
253 local b = math.abs(UnitHealthMax(unitDesignation) or 1)
254 progressRatio = a / b
255 elseif 'UNIT_MANA' == eventCategory then
256 local a = math.abs(UnitMana(unitDesignation) or 0)
257 local b = math.abs(UnitManaMax(unitDesignation) or 1)
258 progressRatio = a / b
259 else
260 local a = math.abs(UnitPower(unitDesignation) or 0)
261 local b = math.abs(UnitPowerMax(unitDesignation) or 1)
262 progressRatio = a / b
275 263 end end
276 264
277 local overlay = healthBarFrame.overlay
278 assert (overlay ~= nil)
265 assert (progressRatio ~= nil)
266 assert (progressRatio >= 0)
267 assert (progressRatio <= 1)
268 return progressRatio
269 end
279 270
280 healthBarUpdateOverlay(healthBarFrame, overlay, unitDesignation)
271 local function progressBarUpdateOverlay(barFrame, overlay, unitDesignation, eventCategory)
272 assert (barFrame~= nil)
273 assert (overlay ~= nil)
274 assert (unitDesignation ~= nil)
275 assert (eventCategory ~= nil)
281 276
282 --[[ Apply health bar text content. ]]--
283 local label = healthBarFrame.label
284 assert (label ~= nil)
277 if not UnitExists(unitDesignation) then
278 return
279 end
285 280
286 healthBarUpdateText(healthBarFrame, label, unitDesignation)
281 local ratio = getUnitProgress(unitDesignation, eventCategory)
282 if not ratio then
283 ratio = 0
284 elseif 'number' ~= type(ratio) then
285 ratio = 0
286 else
287 ratio = math.min(math.max(0, ratio), 1)
288 end
287 289
288 local updateFrequencyPerSecond = 0.5
289 healthBarFrame.idleDurationSec = updateFrequencyPerSecond
290 --[[ Apply health bar width changes. ]]--
291 local overlayHeight = overlay:GetHeight()
292 local barHeight = barFrame:GetHeight()
293 local marginTop = (barHeight - overlayHeight) / 2
294 overlay:SetWidth(barFrame:GetWidth())
295 overlay:SetPoint('BOTTOMLEFT', barFrame, 'BOTTOMLEFT', 0, marginTop)
296 overlay:SetPoint('TOPRIGHT', barFrame, 'TOPRIGHT', (ratio - 1) * barFrame:GetWidth(), -marginTop)
297
298 --[[ FIXME When druid shapeshifts the power bar only assumes the color of the primary resource that is mana,
299 -- instead of changing depending on the current shape's resource.
300 -- The number that the text label shows remains correct. ]]--
301 if 'UNIT_POWER' == eventCategory then
302 local colorMap = PowerBarColor
303 assert (colorMap ~= nil)
304 assert ('table' == type(colorMap))
305 local unitPowerTypeIndex = UnitPowerType(unitDesignation)
306 local powerColor = colorMap[unitPowerTypeIndex]
307 if powerColor then
308 assert ('table' == type(powerColor))
309 local red = powerColor['r']
310 local green = powerColor['g']
311 local blue = powerColor['b']
312 overlay:SetVertexColor(red, green, blue)
313 end
314 end
290 315 end end
291 316
292 local function healthBarUpdateProcessor(self, elapsedDurationSec)
293 assert (self ~= nil)
294 assert (elapsedDurationSec ~= nil)
317 local function progressBarEventProcessor(barFrame, eventCategory)
318 assert (barFrame ~= nil)
319 assert (eventCategory ~= nil)
320 assert ('string' == type(eventCategory))
295 321
296 local updateFrequencyPerSecond = 0.5
322 local unitButton = barFrame:GetParent()
323 assert (unitButton ~= nil)
297 324
298 local idleDurationSec = self.idleDurationSec or 0
299 if idleDurationSec > 0 then
300 self.idleDurationSec = idleDurationSec - elapsedDurationSec
301 else
302 self.idleDurationSec = math.abs(updateFrequencyPerSecond)
325 local unitDesignation = unitButton:GetAttribute('unit')
326 assert (unitDesignation ~= nil)
303 327
304 local unitButton = self:GetParent()
305 assert (unitButton ~= nil)
328 if not UnitExists(unitDesignation) then
329 return
330 end
306 331
307 local unitDesignation = unitButton:GetAttribute('unit')
308 assert (unitDesignation ~= nil)
332 local overlay = barFrame.overlay
333 assert (overlay ~= nil)
309 334
310 local overlay = self.overlay
311 assert (overlay ~= nil)
335 local strategy = barFrame.strategy or 'UNIT_HEALTH'
336 assert (strategy ~= nil)
337 assert ('string' == type(strategy))
338 assert (string.len(strategy) >= 1)
312 339
313 healthBarUpdateOverlay(self, overlay, unitDesignation)
314 end
340 barFrame:SetWidth(unitButton:GetWidth())
341 progressBarUpdateOverlay(barFrame, overlay, unitDesignation, strategy)
342
343 --[[ Apply health bar text content. ]]--
344 local label = barFrame.label
345 assert (label ~= nil)
346
347 progressBarUpdateText(barFrame, label, unitDesignation, strategy)
315 348 end end
316 349
317 local function createHealthBar(unitButton, width, height)
350 local function createProgressBar(n, unitButton, strategy, width, height, red, green, blue)
351 assert (n ~= nil)
318 352 assert (unitButton ~= nil) assert (unitButton ~= nil)
353 assert ('UNIT_HEALTH' == strategy or 'UNIT_POWER' == strategy)
319 354
320 355 assert (width ~= nil) assert (width ~= nil)
321 356 assert ('number' == type(width)) assert ('number' == type(width))
 
... ... local function createHealthBar(unitButton, width, height)
327 362 assert (height >= 12) assert (height >= 12)
328 363 assert (height <= 288) assert (height <= 288)
329 364
330 local n = (unitButton:GetName() or '') .. 'HealthBarFrame'
331 local healthBarFrame = CreateFrame('FRAME', n, unitButton)
332 healthBarFrame:SetSize(width, height)
365 if not n then
366 n = (unitButton:GetName() or '') .. 'ProgressBarFrame'
367 end
368
369 local barFrame = _G[n]
370 if barFrame then
371 return barFrame
372 end
373
374 barFrame = CreateFrame('FRAME', n, unitButton)
375 barFrame:SetSize(width, height)
333 376
334 local b = healthBarFrame:CreateTexture(n .. 'Overlay', 'OVERLAY')
335 b:SetAllPoints()
377 local b = barFrame:CreateTexture(n .. 'Overlay', 'OVERLAY')
378 b:SetWidth(width)
379 b:SetHeight(math.min(height, 12))
380 local marginBottom = (height - b:GetHeight()) / 2
381 b:SetPoint('BOTTOMLEFT', 0, marginBottom)
382 b:SetPoint('TOPRIGHT', 0, -marginBottom)
336 383 b:SetTexture("Interface\\AddOns\\choir\\share\\Minimalist.tga") b:SetTexture("Interface\\AddOns\\choir\\share\\Minimalist.tga")
337 b:SetVertexColor(0, 1, 0, 1)
338 384
339 local t = createLabel(healthBarFrame, UnifontRegular16)
385 if not red then
386 red = 0
387 end
388 if not green then
389 green = 1
390 end
391 if not blue then
392 blue = 0
393 end
394 assert (red >= 0)
395 assert (red <= 1)
396 assert (green >= 0)
397 assert (green <= 1)
398 assert (blue >= 0)
399 assert (blue <= 1)
400 b:SetVertexColor(red, green, blue)
340 401
341 healthBarFrame.label = t
342 healthBarFrame.overlay = b
402 local t = createLabel(barFrame)
343 403
344 healthBarFrame:RegisterEvent('UNIT_COMBAT')
345 healthBarFrame:RegisterEvent('UNIT_HEALTH')
404 barFrame.strategy = strategy
405 barFrame.label = t
406 barFrame.overlay = b
346 407
347 healthBarFrame:SetScript('OnEvent', healthBarEventProcessor)
408 barFrame:RegisterEvent('PLAYER_LOGIN')
409 barFrame:RegisterEvent('ADDON_LOADED')
348 410
349 healthBarFrame:SetScript('OnUpdate', healthBarUpdateProcessor)
411 barFrame:RegisterEvent('UNIT_HEALTH')
350 412
351 healthBarFrame:SetScript('OnShow', function(self)
352 assert (self ~= nil)
353 self.idleDurationSec = 0
354 self:SetScript('OnUpdate', healthBarUpdateProcessor)
355 end)
413 barFrame:RegisterEvent('UNIT_ENERGY')
414 barFrame:RegisterEvent('UNIT_MANA')
415 barFrame:RegisterEvent('UNIT_POWER')
416 barFrame:RegisterEvent('UNIT_RAGE')
417 barFrame:RegisterEvent('UNIT_RUNIC_POWER')
356 418
357 healthBarFrame:SetScript('OnHide', function(self)
358 assert (self ~= nil)
359 self.idleDurationSec = 0
360 self:SetScript('OnUpdate', nil)
361 end)
419 barFrame:SetScript('OnEvent', progressBarEventProcessor)
362 420
363 return healthBarFrame
421 return barFrame, t, b
364 422 end end
365 423
366 424 local function headerEventProcessor(headerFrame) local function headerEventProcessor(headerFrame)
 
... ... local function headerEventProcessor(headerFrame)
384 442 n = unitName n = unitName
385 443 end end
386 444
387 local m = math.floor(headerFrame:GetWidth() / 16)
445 local fontWidth = 6
446 local m = math.floor(headerFrame:GetWidth() / fontWidth)
388 447 local sanitizedName = string.sub(n, 1, m) local sanitizedName = string.sub(n, 1, m)
389 448 if string.len(sanitizedName) < string.len(unitName) then if string.len(sanitizedName) < string.len(unitName) then
390 449 sanitizedName = sanitizedName .. '…' sanitizedName = sanitizedName .. '…'
 
... ... local function createHeader(unitButton, width, height)
436 495 local headerFrame = CreateFrame('FRAME', n, unitButton) local headerFrame = CreateFrame('FRAME', n, unitButton)
437 496 headerFrame:SetSize(width, height) headerFrame:SetSize(width, height)
438 497
439 local t = createLabel(headerFrame, UnifontRegular16)
498 local t = createLabel(headerFrame)
440 499 assert (t ~= nil) assert (t ~= nil)
441 500
442 501 headerFrame.label = t headerFrame.label = t
 
... ... local function contextualMenuOnShowCallback(targetFrame, unitDesignation, mouseB
650 709 ToggleDropDownMenu(1, nil, menuFrame, targetFrame:GetName(), 144, 12) ToggleDropDownMenu(1, nil, menuFrame, targetFrame:GetName(), 144, 12)
651 710 end end
652 711
712 local function rangeWidgetUpdateProcessor(self, elapsedDurationSec)
713 assert (self ~= nil)
714 assert (elapsedDurationSec ~= nil)
715
716 local updateFrequencyPerSecond = 0.5
717
718 local idleDurationSec = self.idleDurationSec or 0
719 if idleDurationSec > 0 then
720 self.idleDurationSec = idleDurationSec - elapsedDurationSec
721 else
722 self.idleDurationSec = math.abs(updateFrequencyPerSecond)
723
724 local unitButton = self:GetParent()
725 assert (unitButton ~= nil)
726
727 local unitDesignation = unitButton:GetAttribute('unit')
728 assert (unitDesignation ~= nil)
729
730 --[[ Change button transparency according to range ]]--
731 local a = 1
732 local rangeSpell = ChoirRangeSpellName
733 --[[ NOTE IsSpellInRange returns either 0, 1 or nil ]]--
734 if rangeSpell and 1 ~= IsSpellInRange(rangeSpell, unitDesignation) then
735 a = 0.5
736 end
737 unitButton:SetAlpha(a)
738 end
739 end
740
741 local function createRangeWidget(unitButton)
742 assert (unitButton ~= nil)
743
744 local n = (unitButton:GetName() or '') .. 'RangeWidget'
745 local w = CreateFrame('FRAME', n, unitButton)
746 w:SetScript('OnUpdate', rangeWidgetUpdateProcessor)
747
748 return w
749 end
750
653 751 local function createUnitButton(parentFrame, frameName, unit, local function createUnitButton(parentFrame, frameName, unit,
654 752 someFilterDescriptorFirst, someFilterDescriptorLast, width, height) someFilterDescriptorFirst, someFilterDescriptorLast, width, height)
655 753 assert (parentFrame ~= nil) assert (parentFrame ~= nil)
 
... ... local function createUnitButton(parentFrame, frameName, unit,
686 784 SecureUnitButton_OnLoad(u, unit, contextualMenuOnShowCallback); SecureUnitButton_OnLoad(u, unit, contextualMenuOnShowCallback);
687 785
688 786 local roleWidget = createRoleWidget(u) local roleWidget = createRoleWidget(u)
689 local headerFrame = createHeader(u, width, 24)
690 local healthBarFrame = createHealthBar(u, width, 24)
787 local headerFrame = createHeader(u, width, 16)
788 local healthBarFrame = createProgressBar(frameName .. 'HealthBarFrame', u, 'UNIT_HEALTH', width, 16)
789 local powerBarFrame = createProgressBar(frameName .. 'PowerBarFrame', u, 'UNIT_POWER', width, 16)
691 790 local threatWidget = createThreatWidget(u, width, 6) local threatWidget = createThreatWidget(u, width, 6)
692 791
792 local rangeWidget = createRangeWidget(u)
793 assert (rangeWidget ~= nil)
794
693 795 local buffRowFirst local buffRowFirst
694 796 local buffRowLast local buffRowLast
695 797 if someFilterDescriptorFirst then if someFilterDescriptorFirst then
 
... ... local function createUnitButton(parentFrame, frameName, unit,
699 801 buffRowLast = createClearcastingSubset(u, someFilterDescriptorLast) buffRowLast = createClearcastingSubset(u, someFilterDescriptorLast)
700 802 end end
701 803
702 local sectionTable = {roleWidget, headerFrame, healthBarFrame, threatWidget, buffRowFirst, buffRowLast}
804 local sectionTable = {roleWidget, headerFrame, healthBarFrame, powerBarFrame, threatWidget, buffRowFirst, buffRowLast}
703 805
704 806 local i = 0 local i = 0
705 807 local j = 0 local j = 0
 
... ... local function createSpoilerPaginatorButton(buttonDesignation, spoiler, clickBut
745 847 local artwork = createBackground(paginatorButton) local artwork = createBackground(paginatorButton)
746 848 paginatorButton:SetNormalTexture(artwork) paginatorButton:SetNormalTexture(artwork)
747 849
748 local label = createLabel(paginatorButton, UnifontRegular16)
850 local label = createLabel(paginatorButton)
749 851 paginatorButton:SetFontString(label) paginatorButton:SetFontString(label)
750 852 paginatorButton:SetText(labelText) paginatorButton:SetText(labelText)
751 853
 
... ... local function createGroup(rootFrame, groupNumber, unitTable)
1071 1173 local marginLeft = 0 local marginLeft = 0
1072 1174 local padding = 4 local padding = 4
1073 1175 local buttonWidth = 12 * 16 local buttonWidth = 12 * 16
1074 local buttonHeight = 12 * 12
1176 local buttonHeight = 12 * 6
1075 1177 while (i < #u) do while (i < #u) do
1076 1178 i = i + 1 i = i + 1
1077 1179 local unitDesignation = u[i] local unitDesignation = u[i]
 
... ... local function createGroup(rootFrame, groupNumber, unitTable)
1105 1207 spoiler:SetSize(marginLeft, 12 * 20) spoiler:SetSize(marginLeft, 12 * 20)
1106 1208 spoiler:SetPoint('CENTER', 0, 12 * 6) spoiler:SetPoint('CENTER', 0, 12 * 6)
1107 1209
1108 local title = createLabel(spoiler, UnifontRegular16)
1210 local title = createLabel(spoiler)
1109 1211 title:SetPoint('TOPRIGHT', 0, 0) title:SetPoint('TOPRIGHT', 0, 0)
1110 1212 title:SetPoint('BOTTOMLEFT', spoiler, 'TOPLEFT', spoiler:GetWidth() / 2 - title:GetWidth() / 2, -24) title:SetPoint('BOTTOMLEFT', spoiler, 'TOPLEFT', spoiler:GetWidth() / 2 - title:GetWidth() / 2, -24)
1111 1213 title:SetText('Group ' .. tostring(groupNumber)) title:SetText('Group ' .. tostring(groupNumber))
 
... ... local function createRaidGroupLabel(groupFrame, groupNumber)
1200 1302 local labelWidth = 60 local labelWidth = 60
1201 1303
1202 1304 local groupLabel = groupFrame:CreateFontString(groupFrame:GetName() .. 'Label', 'OVERLAY') local groupLabel = groupFrame:CreateFontString(groupFrame:GetName() .. 'Label', 'OVERLAY')
1203 local fontObject = UnifontRegular16 or NumberFont_OutlineThick_Mono_Small
1305 local fontObject = ArimoRegular16 or CousineRegular16 or NumberFont_OutlineThick_Mono_Small
1204 1306 assert (fontObject ~= nil) assert (fontObject ~= nil)
1205 1307 groupLabel:SetFontObject(fontObject) groupLabel:SetFontObject(fontObject)
1206 1308 groupLabel:SetPoint('BOTTOMLEFT', groupFrame, 'BOTTOMLEFT', 0, 0) groupLabel:SetPoint('BOTTOMLEFT', groupFrame, 'BOTTOMLEFT', 0, 0)
 
... ... local function createRaidGroupFrame(raidFrame, groupNumber, unitSetOverride)
1236 1338 end end
1237 1339
1238 1340 local buttonWidth = 36 * 2 local buttonWidth = 36 * 2
1239 local buttonHeight = 12 * 12
1341 local buttonHeight = 12 * 6
1240 1342 local padding = 34 local padding = 34
1241 1343 local labelWidth = 60 local labelWidth = 60
1242 1344
File choir.toc changed (mode: 100644) (index 58608bc..6a74063)
1 ##Dependencies: Clearcasting, Unifont
1 ##Dependencies: Clearcasting, Croscore
2 2 ##Interface: 30300 ##Interface: 30300
3 3 ##Notes: Raid targeting aid for healers ##Notes: Raid targeting aid for healers
4 4 ##SavedVariablesPerCharacter: ChoirRangeSpellName, ChoirShortcutSpellNameList, ChoirShortcutBindingKeyMap, ChoirConfRaidFlag, ChoirConfRaidX, ChoirConfRaidY ##SavedVariablesPerCharacter: ChoirRangeSpellName, ChoirShortcutSpellNameList, ChoirShortcutBindingKeyMap, ChoirConfRaidFlag, ChoirConfRaidX, ChoirConfRaidY
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/choir

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

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

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