List of commits:
Subject Hash Author Date (UTC)
feat: Track additional auras 958e52f9808d64ebb816663d2aa22a4eb39a2068 Vladyslav Bondarenko 2021-01-22 20:28:13
fix!: No longer crash on unknown spell 65061085f0f55b75910c9ed4d8249b1e8e30f9ee Vladyslav Bondarenko 2020-12-11 17:31:16
fix: Render indicators properly on first login bf102cc749cc23d3769a82f10fe93a05afc5277f Vladyslav Bondarenko 2020-12-11 14:25:11
feat: Add Serendipity and Surge of Light indicators ba1d0f32a4b8f4f5d4e2730f0a4e409e23b52974 Vladyslav Bondarenko 2020-12-10 16:19:55
Initial commit 9b3df418e373218125fec12271084afebb11cfc2 Vladyslav Bondarenko 2020-12-04 10:27:24
Commit 958e52f9808d64ebb816663d2aa22a4eb39a2068 - feat: Track additional auras
Author: Vladyslav Bondarenko
Author date (UTC): 2021-01-22 20:28
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2021-01-22 20:28
Parent(s): 65061085f0f55b75910c9ed4d8249b1e8e30f9ee
Signing key:
Tree: ed5fb7c4b0a851d337624893367d2359460cc56a
File Lines added Lines deleted
clearcasting.toc 1 0
src/ClearcastingFrame.lua 29 17
File clearcasting.toc changed (mode: 100644) (index babc5a7..6d4f9fb)
2 2 ##Notes: Add separate indicators for specific buffs. ##Notes: Add separate indicators for specific buffs.
3 3 ##Title: Clearcasting ##Title: Clearcasting
4 4 ##Version: 0.0.1-SNAPSHOT ##Version: 0.0.1-SNAPSHOT
5 ##SavedVariablesPerCharacter: ClearcastingDebugFlag
5 6 clearcasting.xml clearcasting.xml
6 7 src\ClearcastingFrame.lua src\ClearcastingFrame.lua
File src/ClearcastingFrame.lua changed (mode: 100644) (index 103353d..235a400)
... ... Clearcasting addon.
4 4 @script clearcasting @script clearcasting
5 5 ]] ]]
6 6
7 local function debug(msg)
8 if true == ClearcastingDebugFlag then
9 print('[Clearcasting]: ' .. tostring(msg) .. '.')
10 end
11 end
12
7 13 --[[-- --[[--
8 14 Attempt to find a file that contains picture appropriate for given effect. Attempt to find a file that contains picture appropriate for given effect.
9 15 @function findPictureFile @function findPictureFile
 
... ... local function findPictureFile(auraName)
42 48 ["Judgements of the Pure"] = "Interface\\Icons\\Ability_Paladin_JudgementofthePure", ["Judgements of the Pure"] = "Interface\\Icons\\Ability_Paladin_JudgementofthePure",
43 49 ["Light's Grace"] = "Interface\\Icons\\Spell_Holy_LightsGrace", ["Light's Grace"] = "Interface\\Icons\\Spell_Holy_LightsGrace",
44 50 ["Serendipity"] = "Interface\\Icons\\Spell_Holy_Serendipity", ["Serendipity"] = "Interface\\Icons\\Spell_Holy_Serendipity",
51 ["Borrowed Time"] = "Interface\\Icons\\Spell_Holy_BorrowedTime",
45 52 ["Surge of Light"] = "Interface\\Icons\\Spell_Holy_SurgeofLight", ["Surge of Light"] = "Interface\\Icons\\Spell_Holy_SurgeofLight",
46 53 ["Enrage"] = "Interface\\Icons\\Spell_Shadow_UnholyFrenzy", ["Enrage"] = "Interface\\Icons\\Spell_Shadow_UnholyFrenzy",
47 54 } }
 
... ... local function createIndicator(frameName, parentFrame, unitDesignation, auraName
95 102 f.text = t f.text = t
96 103 f.unitDesignation = unitDesignation f.unitDesignation = unitDesignation
97 104
98 print('[Clearcasting]: create indicator ' .. auraName .. ' ' .. tostring(auraId) ..
105 debug('create indicator ' .. auraName .. ' ' .. tostring(auraId) ..
99 106 ' ' .. icon ) ' ' .. icon )
100 107
101 108 f:Hide() f:Hide()
 
... ... local function acceptUnitAura(rootFrame, unitDesignation)
124 131 j = j + 1 j = j + 1
125 132 local _, _, icon, _, _, _, _, local _, _, icon, _, _, _, _,
126 133 _, _, _, _, _, _,
127 spellId = UnitAura('player', j)
134 spellId = UnitAura(unitDesignation, j)
128 135 if nil == spellId then if nil == spellId then
129 136 break break
130 137 end end
 
... ... local function getAuraId(spellName, spellCategory)
165 172 end end
166 173
167 174 local function reload(rootFrame) local function reload(rootFrame)
168 print('[Clearcasting]: enter reload')
175 debug('enter reload')
169 176 assert (rootFrame ~= nil) assert (rootFrame ~= nil)
170 177
171 178 local t = rootFrame.indicatorTable local t = rootFrame.indicatorTable
 
... ... local function reload(rootFrame)
191 198 if not f.auraId then if not f.auraId then
192 199 f.auraId = getAuraId(auraName) f.auraId = getAuraId(auraName)
193 200 if not f.auraId then if not f.auraId then
194 print('[Clearcasting]: spell "' .. tostring(auraName) .. '" is unavailable (188).')
201 debug('spell "' .. tostring(auraName) .. '" is unavailable (188).')
195 202 end end
196 203 end end
197 204
 
... ... local function reload(rootFrame)
207 214
208 215 i = i - 1 i = i - 1
209 216 end end
210 print('[Clearcasting]: exit reload')
217 debug('exit reload')
211 218 end end
212 219
213 220 function ClearcastingReload() function ClearcastingReload()
 
... ... local function updateEveryIndicator(rootFrame)
261 268 f:Show() f:Show()
262 269 local t = '' local t = ''
263 270 if stackQuantity > 1 then if stackQuantity > 1 then
264 t = string.format("%.0f\r\n(%d)", remainingSecs, stackQuantity)
271 t = string.format("%.0f\r\n%d*", remainingSecs, stackQuantity)
265 272 else else
266 273 t = string.format("%.0f", remainingSecs) t = string.format("%.0f", remainingSecs)
267 274 end end
 
... ... local function initIndicator(rootFrame, auraName, column, row, auraId)
334 341 end end
335 342
336 343 if not isSpellAvailable(auraName) then if not isSpellAvailable(auraName) then
337 print('[Clearcasting]: cannot initialise spell "' .. tostring(auraName) .. '" ' ..
344 debug('cannot initialise spell "' .. tostring(auraName) .. '" ' ..
338 345 'aura identifier ' .. tostring(auraId) .. ' (line 343)') 'aura identifier ' .. tostring(auraId) .. ' (line 343)')
339 346 end end
340 347
 
... ... local function initPaladinIndicator(rootFrame)
376 383 initIndicator(rootFrame, "Hand of Protection", 0, 3) initIndicator(rootFrame, "Hand of Protection", 0, 3)
377 384 initIndicator(rootFrame, "Hand of Sacrifice", 2, 1) initIndicator(rootFrame, "Hand of Sacrifice", 2, 1)
378 385 initIndicator(rootFrame, "Hand of Salvation", 2, 3) initIndicator(rootFrame, "Hand of Salvation", 2, 3)
379 initIndicator(rootFrame, "Holy Shield", 1, 0)
386 initIndicator(rootFrame, "Holy Shield", 1, 3)
380 387 initIndicator(rootFrame, "Infusion of Light", 1, 3, 54149) initIndicator(rootFrame, "Infusion of Light", 1, 3, 54149)
381 388 initIndicator(rootFrame, "Judgements of the Pure", 1, 1, 54153) initIndicator(rootFrame, "Judgements of the Pure", 1, 1, 54153)
382 389 initIndicator(rootFrame, "Light's Grace", 1, 2, 31834) initIndicator(rootFrame, "Light's Grace", 1, 2, 31834)
 
... ... local function initWarriorIndicator(rootFrame)
395 402 initIndicator(rootFrame, "Shield Block", 0, 1) initIndicator(rootFrame, "Shield Block", 0, 1)
396 403 initIndicator(rootFrame, "Shield Wall", 0, 0) initIndicator(rootFrame, "Shield Wall", 0, 0)
397 404 initIndicator(rootFrame, "Spell Reflection", 2, 2) initIndicator(rootFrame, "Spell Reflection", 2, 2)
398 initIndicator(rootFrame, "Sudden Death", 1, 3)
405 initIndicator(rootFrame, "Sudden Death", 1, 2, 29723)
399 406 initIndicator(rootFrame, "Sword and Board", 1, 3, 50227) initIndicator(rootFrame, "Sword and Board", 1, 3, 50227)
400 initIndicator(rootFrame, "Taste for Blood", 1, 3)
407 initIndicator(rootFrame, "Taste for Blood", 1, 3, 60503)
401 408 end end
402 409
403 410 local function initEveryIndicator(rootFrame) local function initEveryIndicator(rootFrame)
404 411 local _, playerClassDesignation = UnitClass('player') local _, playerClassDesignation = UnitClass('player')
405 if 'PALADIN' == playerClassDesignation then
412 if 'DEATHKNIGHT' == playerClassDesignation then
413 initIndicator(rootFrame, 'Anti-Magic Shell', 0, 2)
414 initIndicator(rootFrame, 'Icebound Fortitude', 0, 3)
415 initIndicator(rootFrame, 'Anti-Magic Zone', 0, 0)
416 elseif 'PALADIN' == playerClassDesignation then
406 417 initPaladinIndicator(rootFrame) initPaladinIndicator(rootFrame)
407 418 elseif 'PRIEST' == playerClassDesignation then elseif 'PRIEST' == playerClassDesignation then
408 419 initIndicator(rootFrame, 'Surge of Light', 0, 2, 33151) initIndicator(rootFrame, 'Surge of Light', 0, 2, 33151)
409 420 initIndicator(rootFrame, 'Serendipity', 0, 3, 63731) initIndicator(rootFrame, 'Serendipity', 0, 3, 63731)
421 initIndicator(rootFrame, 'Borrowed Time', 0, 3, 59891)
410 422 elseif 'DRUID' == playerClassDesignation then elseif 'DRUID' == playerClassDesignation then
411 423 initIndicator(rootFrame, 'Clearcasting', 0, 0) initIndicator(rootFrame, 'Clearcasting', 0, 0)
412 424 elseif 'WARRIOR' == playerClassDesignation then elseif 'WARRIOR' == playerClassDesignation then
413 425 initWarriorIndicator(rootFrame) initWarriorIndicator(rootFrame)
414 426 elseif 'WARLOCK' == playerClassDesignation then elseif 'WARLOCK' == playerClassDesignation then
415 initIndicator(rootFrame, 'Backdraft', 0, 1)
416 initIndicator(rootFrame, 'Backlash', 0, 2)
417 initIndicator(rootFrame, 'Decimation', 0, 1)
427 initIndicator(rootFrame, 'Backdraft', 0, 1, 47260)
428 initIndicator(rootFrame, 'Backlash', 0, 2, 34939)
429 initIndicator(rootFrame, 'Decimation', 0, 1, 63158)
418 430 initIndicator(rootFrame, 'Eradication', 0, 1, 64371) initIndicator(rootFrame, 'Eradication', 0, 1, 64371)
419 initIndicator(rootFrame, 'Molten Core', 0, 1)
431 initIndicator(rootFrame, 'Molten Core', 0, 1, 71165)
420 432 initIndicator(rootFrame, 'Shadow Trance', 0, 2, 17941) initIndicator(rootFrame, 'Shadow Trance', 0, 2, 17941)
421 433 initIndicator(rootFrame, 'Life Tap', 0, 0, 63321) initIndicator(rootFrame, 'Life Tap', 0, 0, 63321)
422 434 else else
 
... ... local function initEveryIndicator(rootFrame)
426 438 end end
427 439
428 440 local function init(rootFrame) local function init(rootFrame)
429 print('[Clearcasting]: enter init')
441 debug('enter init')
430 442 local t = initEveryIndicator(rootFrame) local t = initEveryIndicator(rootFrame)
431 443 assert (t ~= nil) assert (t ~= nil)
432 444 assert (#t >= 1) assert (#t >= 1)
 
... ... local function init(rootFrame)
440 452
441 453 rootFrame:RegisterEvent('UNIT_AURA') rootFrame:RegisterEvent('UNIT_AURA')
442 454 rootFrame:RegisterEvent('SPELLS_CHANGED') rootFrame:RegisterEvent('SPELLS_CHANGED')
443 print('[Clearcasting]: exit init')
455 debug('exit init')
444 456 end end
445 457
446 458 local function main() local function main()
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/clearcasting

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

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

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