List of commits:
Subject Hash Author Date (UTC)
feat(choir)!: Add spell effects on unit d581df9fce342709267a3221dead4d00b9d14319 Vladyslav Bondarenko 2021-10-31 10:49:19
feat(choir)!: Close spoiler by pressing Esc 22d7370011ac45d25a410a3f569183d0cc9fb232 Vladyslav Bondarenko 2021-10-29 16:10:08
feat(choir)!: Range indicator 931a0510b562986ec76dc22f329f4af4ed723cdf Vladyslav Bondarenko 2021-10-29 10:40:46
fix(choir)!: Health bar in combat a6622578dd5a1b4e4babf699a4cf1e4eb6bb70d6 Vladyslav Bondarenko 2021-10-28 07:42:57
feat(choir)!: Decorate unit buttons 4dc5ed44a9519b275f4256cfe4281110b7a94c9a Vladyslav Bondarenko 2021-10-25 21:20:56
feat(choir)!: Copy action bar binding 70ce056ffda7f12d913ce9a42b128ea257bdd0dc Vladyslav Bondarenko 2021-10-23 23:34:56
feat!: Initial commit 45c4e781e5ff0a69f8b0bea3a869e2384c7ca454 Vladyslav Bondarenko 2021-10-23 06:03:14
Commit d581df9fce342709267a3221dead4d00b9d14319 - feat(choir)!: Add spell effects on unit
Render a subset of active effects on a unit at the bottom of the unit
buttons given that the unit selection context menu is shown.

Additionally resize unit button frames to fit all the additional
information.

Rely on Clearcasting add-on as a mandatory dependency to render the unit
aura (buff, debuff, effect) indicators. The dependency is also unstable.
Changes will be made.
Author: Vladyslav Bondarenko
Author date (UTC): 2021-10-31 10:49
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2021-10-31 10:49
Parent(s): bbbb454880780ca0133ce95e07536710441530bc
Signer:
Signing key:
Signing status: N
Tree: f1cb1875bb2a6de06186db3495c2ba9d9f11bef4
File Lines added Lines deleted
.luacheckrc 10 0
choir.lua 91 7
choir.toc 2 1
File .luacheckrc changed (mode: 100644) (index fd1ecd1..dcef242)
... ... stds.choir = {
31 31 'ChoirRangeSpellName', 'ChoirRangeSpellName',
32 32 }, },
33 33 read_globals = { read_globals = {
34 'ChoirFrame',
34 35 'ChoirSpoiler1', 'ChoirSpoiler1',
36 'ChoirSpoiler2',
37 'ChoirSpoiler3',
38 'ChoirSpoiler4',
39 'ChoirSpoiler5',
40 'ChoirSpoiler6',
41 'ChoirSpoiler7',
42 'ChoirSpoiler8',
43 'ChoirSpoiler9',
44 'ClearcastingFrame',
35 45 } }
36 46 } }
37 47
File choir.lua changed (mode: 100644) (index f526d66..5c0ea52)
... ... local function getDefaultUnitButtonBarColor()
6 6 return 0, 1, 0 return 0, 1, 0
7 7 end end
8 8
9 local function createClearcastingSection(unitButton)
10 assert (unitButton ~= nil)
11
12 if not ClearcastingFrame then
13 trace('could not access Clearcasting module')
14 return
15 end
16
17 local locale = GetLocale()
18 assert (locale == 'enGB' or locale == 'enUS', 'requires English localization')
19
20 local columnQuantity = 5
21 local rowQuantity = 2
22
23 local x = 0
24 local y = 0
25
26 local createIndicator = ClearcastingFrame.createIndicator
27 assert (createIndicator ~= nil)
28
29 local padding = 2
30
31 --[[ FIXME Update indicator unit designation when unit button attribute changes at runtime. ]]--
32 local unitDesignation = unitButton:GetAttribute('unit')
33 assert (unitDesignation ~= nil)
34
35 local section = CreateFrame('FRAME', unitButton:GetName() .. 'ClearcastingSection', unitButton)
36 section:SetPoint('BOTTOMLEFT', 0, 0)
37 section:SetPoint('TOPRIGHT', 0, (36 * rowQuantity + padding * (rowQuantity + 1)) - unitButton:GetHeight())
38
39 local d
40 local harmfulSpellCategoryList = {
41 'Magic', 'Poison', 'Disease', 'Curse', 'HARMFUL',
42 }
43
44 local i = 0
45 while (i < #harmfulSpellCategoryList) do
46 i = i + 1
47 local category = harmfulSpellCategoryList[i]
48 d = createIndicator(section, category, unitDesignation, 'HARMFUL')
49 d:SetPoint('BOTTOMLEFT', d:GetWidth() * x + padding * (x + 1), 12 + (d:GetHeight() + 12) * y + padding * (y + 1))
50 x = x + 1
51 end
52
53 local helpfulSpellMap = {
54 --[[PALADIN]]--
55 {'Hand of Freedom', 'Hand of Protection', 'Sacred Shield', 'Beacon of Light'},
56 --[[PRIEST]]--
57 {'Power Word: Shield', 'Renew', 'Grace', 'Power Infusion', 'Pain Suppression'},
58 --[[DRUID]]--
59 {'Rejuvenation', 'Regrowth', 'Wild Growth'},
60 --[[SHAMAN]]--
61 {'Earth Shield'},
62 }
63
64 y = y + 1
65 local p = 0
66 while (p < #helpfulSpellMap) do
67 p = p + 1
68 local list = helpfulSpellMap[p]
69 local q = 0
70 x = 0
71 assert (#list <= columnQuantity)
72 while (q < #list) do
73 q = q + 1
74 local spellName = list[q]
75 d = createIndicator(section, spellName, unitDesignation, 'PLAYER HELPFUL')
76 d:SetPoint('BOTTOMLEFT', d:GetWidth() * x + padding * (x + 1), 12 + (d:GetHeight() + 12) * y + padding * (y + 1))
77 x = x + 1
78 end
79 end
80
81 return section
82 end
83
9 84 local function createLabel(ownerFrame, fontObject) local function createLabel(ownerFrame, fontObject)
10 85 assert (ownerFrame ~= nil) assert (ownerFrame ~= nil)
11 86
 
... ... local function createUnitButtonBar(unitButton)
146 221 assert (unitButton ~= nil) assert (unitButton ~= nil)
147 222
148 223 local n = unitButton:GetName() or '' local n = unitButton:GetName() or ''
224 local padding = 4
225 local marginTop = 24
226 local marginBottom = 36 * 2 + (2 * 3)
149 227 local bar = CreateFrame('FRAME', n .. 'Bar', unitButton) local bar = CreateFrame('FRAME', n .. 'Bar', unitButton)
150 bar:SetPoint('BOTTOMLEFT', unitButton, 'BOTTOMLEFT', 4, 4)
151 bar:SetPoint('TOPRIGHT', unitButton, 'TOPRIGHT', -4, 12 - unitButton:GetHeight())
228 bar:SetPoint('BOTTOMLEFT', unitButton, 'BOTTOMLEFT', padding, padding + marginBottom)
229 bar:SetPoint('TOPRIGHT', unitButton, 'TOPRIGHT', -padding, -padding - marginTop)
152 230
153 231 local b = bar:CreateTexture(bar:GetName() .. 'Overlay', 'OVERLAY') local b = bar:CreateTexture(bar:GetName() .. 'Overlay', 'OVERLAY')
154 232 b:SetAllPoints() b:SetAllPoints()
 
... ... local function createUnitButton(parentFrame, frameName, unit)
205 283 assert (frameName ~= nil) assert (frameName ~= nil)
206 284 assert (unit ~= nil) assert (unit ~= nil)
207 285
208 --[[ TODO Add debuff indicator, at least the presence of a debuff of a category not the exact effect ]]--
209 --[[ TODO Add ability to cleanse without targeting ]]--
286 --[[ TODO Add children buttons that are secure spell buttons on the same target as the unit button.
287 -- Set override bindings to those buttons as ALT-A, CTRL-A, SHIFT-A, where A is the unit button key.
288 -- The spells assigned to the buttons let be something like Cleanse, Dispel Magic or Flash Heal.
289 -- That way, user may cast something without targeting or hiding the selection spoiler.
290 -- The problem is that it is class dependant.]]--
210 291 local u = CreateFrame('BUTTON', frameName, parentFrame, 'SecureUnitButtonTemplate') local u = CreateFrame('BUTTON', frameName, parentFrame, 'SecureUnitButtonTemplate')
211 292 u:SetAttribute('type', 'target') u:SetAttribute('type', 'target')
212 293 u:SetAttribute('unit', unit) u:SetAttribute('unit', unit)
213 294
214 u:SetSize(12 * 8, 12 * 3)
295 u:SetSize(24 * 5 + 2 * 6, 36 * 2 + 2 * 3 + 24 * 2)
215 296
216 297 local t = createLabel(u) local t = createLabel(u)
217 298 t:SetPoint('BOTTOMLEFT', u, 'BOTTOMLEFT', 4, u:GetHeight() - 24 - 4) t:SetPoint('BOTTOMLEFT', u, 'BOTTOMLEFT', 4, u:GetHeight() - 24 - 4)
 
... ... local function createUnitButton(parentFrame, frameName, unit)
224 305 local bar = createUnitButtonBar(u) local bar = createUnitButtonBar(u)
225 306 u.bar = bar u.bar = bar
226 307
308 local clearcasting = createClearcastingSection(u)
309 u.clearcasting = clearcasting
310
227 311 u:SetScript('OnEvent', unitButtonEventProcessor) u:SetScript('OnEvent', unitButtonEventProcessor)
228 312 u:RegisterEvent('PARTY_CONVERTED_TO_RAID') u:RegisterEvent('PARTY_CONVERTED_TO_RAID')
229 313 u:RegisterEvent('PARTY_MEMBERS_CHANGED') u:RegisterEvent('PARTY_MEMBERS_CHANGED')
 
... ... local function createGroup(rootFrame, groupNumber, unitTable)
344 428 assert (#u == groupSize) assert (#u == groupSize)
345 429
346 430 local spoiler = createSpoiler(rootFrame, 'ChoirSpoiler' .. tostring(groupNumber)) local spoiler = createSpoiler(rootFrame, 'ChoirSpoiler' .. tostring(groupNumber))
347 spoiler:SetSize(12 * 6, 12 * 4)
348 spoiler:SetPoint('CENTER', 12 * 6 * 6 / -2, 144)
349 431
350 432 local i = 0 local i = 0
351 433 local marginLeft = 0 local marginLeft = 0
 
... ... local function createGroup(rootFrame, groupNumber, unitTable)
375 457
376 458 _G['BINDING_NAME_CLICK ' .. b:GetName() .. ':LeftButton'] = 'Unit ' .. tostring(i) _G['BINDING_NAME_CLICK ' .. b:GetName() .. ':LeftButton'] = 'Unit ' .. tostring(i)
377 459 end end
460 spoiler:SetSize(marginLeft, 144)
461 spoiler:SetPoint('CENTER', 0, 12 * 6)
378 462
379 463 _G['BINDING_NAME_CLICK ' .. spoiler:GetName() .. ':LeftButton'] = 'Group ' .. tostring(groupNumber) _G['BINDING_NAME_CLICK ' .. spoiler:GetName() .. ':LeftButton'] = 'Group ' .. tostring(groupNumber)
380 464
File choir.toc changed (mode: 100644) (index 5719708..779ba5a)
1 ##Dependencies: Clearcasting
1 2 ##Interface: 30300 ##Interface: 30300
2 3 ##Notes: Raid targeting aid for healers ##Notes: Raid targeting aid for healers
4 ##SavedVariablesPerCharacter: ChoirRangeSpellName
3 5 ##Title: Choir ##Title: Choir
4 6 ##Version: 0 ##Version: 0
5 ##SavedVariablesPerCharacter: ChoirRangeSpellName
6 7 bindings.xml bindings.xml
7 8 choir.lua choir.lua
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/wowaddons

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

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

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