File clearcasting.lua changed (mode: 100644) (index 7c3e186..40e7c1c) |
1 |
1 |
--[[-- |
--[[-- |
2 |
2 |
Clearcasting addon. |
Clearcasting addon. |
3 |
3 |
|
|
|
4 |
|
TODO Show tooltip hint on mouseover. |
|
5 |
|
TODO Separate profiles for different character classes. |
|
6 |
|
TODO Sort debuff by time remaining and importance instead of first any. |
|
7 |
|
|
4 |
8 |
@script clearcasting |
@script clearcasting |
5 |
9 |
]] |
]] |
6 |
10 |
|
|
7 |
11 |
local function debug(...) |
local function debug(...) |
8 |
|
if true == ClearcastingDebugFlag then |
|
9 |
|
print('[Clearcasting]: ', ...) |
|
10 |
|
end |
|
|
12 |
|
if true == ClearcastingDebugFlag then |
|
13 |
|
print('[Clearcasting]: ', ...) |
|
14 |
|
end |
11 |
15 |
end |
end |
12 |
16 |
|
|
13 |
|
local function getAuraId(spellName, spellCategory) |
|
14 |
|
local spellLink = GetSpellLink(spellName, spellCategory) |
|
15 |
|
if spellLink then |
|
16 |
|
return tonumber(spellLink:match("spell:(%d+)")) |
|
17 |
|
else |
|
18 |
|
return nil |
|
19 |
|
end |
|
|
17 |
|
local function getIndicatorArtworkSize() |
|
18 |
|
return 24 |
20 |
19 |
end |
end |
21 |
20 |
|
|
22 |
|
local function updateEveryIndicator(rootFrame) |
|
23 |
|
local t = rootFrame.indicatorTable |
|
24 |
|
local i = #t |
|
25 |
|
while (i > 0) do |
|
26 |
|
local f = t[i] |
|
27 |
|
assert (f ~= nil) |
|
28 |
|
local auraId = f.auraId |
|
29 |
|
local auraName = f.auraName |
|
30 |
|
if auraId ~= nil then |
|
31 |
|
assert (auraId >= 1) |
|
32 |
|
local unitDesignation = f.unitDesignation |
|
33 |
|
local remainingSecs, duration, stackQuantity = getUnitAuraRemainingSecs(unitDesignation, auraId) |
|
34 |
|
if remainingSecs > 0 then |
|
35 |
|
f:Show() |
|
36 |
|
local t = '' |
|
37 |
|
if stackQuantity > 1 then |
|
38 |
|
t = string.format("%.0f\r\n%d*", remainingSecs, stackQuantity) |
|
39 |
|
else |
|
40 |
|
t = string.format("%.0f", remainingSecs) |
|
41 |
|
end |
|
42 |
|
f.text:SetText(t) |
|
43 |
|
local r = remainingSecs / duration |
|
44 |
|
local bleed = math.min(1.5 * r, 1) |
|
45 |
|
f.background:SetVertexColor(1, bleed, bleed) |
|
46 |
|
else |
|
47 |
|
f:Hide() |
|
48 |
|
f.text:SetText(nil) |
|
49 |
|
end |
|
50 |
|
end |
|
51 |
|
i = i - 1 |
|
52 |
|
end |
|
|
21 |
|
local function getIndicatorFooterSize() |
|
22 |
|
return 16 |
53 |
23 |
end |
end |
54 |
24 |
|
|
55 |
|
--[[-- |
|
56 |
|
Use unique aura identifier when possible. |
|
57 |
|
Otherwise use aura name. Function may fail when given spell name. |
|
58 |
|
An aura is either a spell in character spell book or talent effect. |
|
59 |
|
Given unique identifier of a currently unavailable ability |
|
60 |
|
the function produces an error. |
|
61 |
|
]] |
|
62 |
|
local function isSpellAvailable(eitherSpellIdOrName) |
|
63 |
|
local n = GetSpellInfo(eitherSpellIdOrName) |
|
64 |
|
return n ~= nil |
|
|
25 |
|
local function getIndicatorPadding() |
|
26 |
|
return 4 |
65 |
27 |
end |
end |
66 |
28 |
|
|
67 |
29 |
local function findFirstFilterName(unitDesignation, filterDescriptor, eitherTargetNameOrId) |
local function findFirstFilterName(unitDesignation, filterDescriptor, eitherTargetNameOrId) |
|
... |
... |
local function findFirstFilterName(unitDesignation, filterDescriptor, eitherTarg |
80 |
42 |
local targetName = eitherTargetNameOrId |
local targetName = eitherTargetNameOrId |
81 |
43 |
assert (targetName ~= nil) |
assert (targetName ~= nil) |
82 |
44 |
assert ('string' == type(targetName)) |
assert ('string' == type(targetName)) |
83 |
|
assert (string.len(targetName) >= 4) |
|
|
45 |
|
--[[ The shortest spell name in English is "Hex" ]]-- |
|
46 |
|
assert (string.len(targetName) >= 2) |
84 |
47 |
assert (string.len(targetName) <= 256) |
assert (string.len(targetName) <= 256) |
85 |
48 |
elseif 'number' == type(eitherTargetNameOrId) then |
elseif 'number' == type(eitherTargetNameOrId) then |
86 |
49 |
local targetId = eitherTargetNameOrId |
local targetId = eitherTargetNameOrId |
87 |
50 |
assert (targetId ~= nil) |
assert (targetId ~= nil) |
88 |
|
assert ('string' == type(targetId)) |
|
89 |
51 |
assert (targetId > 0) |
assert (targetId > 0) |
90 |
52 |
else |
else |
91 |
53 |
return nil |
return nil |
|
... |
... |
local function findFirstFilterCategory(unitDesignation, filterDescriptor, target |
124 |
86 |
|
|
125 |
87 |
assert (targetCategory ~= nil) |
assert (targetCategory ~= nil) |
126 |
88 |
if 'string' == type(targetCategory) then |
if 'string' == type(targetCategory) then |
127 |
|
assert (string.len(targetCategory) >= 4) |
|
|
89 |
|
assert (string.len(targetCategory) >= 2) |
128 |
90 |
assert (string.len(targetCategory) <= 64) |
assert (string.len(targetCategory) <= 64) |
129 |
91 |
else |
else |
130 |
92 |
return nil |
return nil |
|
... |
... |
local function findAnyHarmful(unitDesignation, filterDescriptor, targetCategory) |
206 |
168 |
|
|
207 |
169 |
assert (targetCategory ~= nil) |
assert (targetCategory ~= nil) |
208 |
170 |
if 'string' == type(targetCategory) then |
if 'string' == type(targetCategory) then |
209 |
|
assert (string.len(targetCategory) >= 4) |
|
|
171 |
|
assert (string.len(targetCategory) >= 2) |
210 |
172 |
assert (string.len(targetCategory) <= 64) |
assert (string.len(targetCategory) <= 64) |
211 |
173 |
if 'HARMFUL' ~= targetCategory then |
if 'HARMFUL' ~= targetCategory then |
212 |
174 |
return nil |
return nil |
|
... |
... |
local function applyBackground(f, pictureFile) |
238 |
200 |
|
|
239 |
201 |
f:SetBackdrop({bgFile = pictureFile, |
f:SetBackdrop({bgFile = pictureFile, |
240 |
202 |
edgeFile = "Interface\\AddOns\\clearcasting\\share\\2px_tooltip_border", |
edgeFile = "Interface\\AddOns\\clearcasting\\share\\2px_tooltip_border", |
241 |
|
tile = false, tileSize = 24, edgeSize = 8, |
|
|
203 |
|
tile = false, tileSize = 24, edgeSize = 8, |
242 |
204 |
insets = { left = 2, right = 2, top = 2, bottom = 2 }}) |
insets = { left = 2, right = 2, top = 2, bottom = 2 }}) |
243 |
205 |
|
|
244 |
206 |
--f:SetBackdropColor(0.5, 0.5, 0.5, 0.5) |
--f:SetBackdropColor(0.5, 0.5, 0.5, 0.5) |
|
... |
... |
local function formatIndicatorText(duration, expirationInstance, stackQuantity) |
294 |
256 |
|
|
295 |
257 |
stackQuantity = stackQuantity or 0 |
stackQuantity = stackQuantity or 0 |
296 |
258 |
if stackQuantity >= 2 and stackQuantity <= 9 then |
if stackQuantity >= 2 and stackQuantity <= 9 then |
297 |
|
t = t .. ', ' .. tostring(math.ceil(stackQuantity)) |
|
|
259 |
|
t = tostring(math.ceil(stackQuantity)) .. '*' .. t |
298 |
260 |
end |
end |
299 |
261 |
end |
end |
300 |
262 |
|
|
|
... |
... |
local function createIndicator(parentFrame, target, unitDesignation, filterDescr |
415 |
377 |
assert (target ~= nil) |
assert (target ~= nil) |
416 |
378 |
|
|
417 |
379 |
local maxColumnQuantity = 4 |
local maxColumnQuantity = 4 |
418 |
|
local maxRowQuantity = 6 |
|
|
380 |
|
local maxRowQuantity = 8 |
419 |
381 |
|
|
420 |
382 |
local p = parentFrame:GetName() or 'Clearcasting' |
local p = parentFrame:GetName() or 'Clearcasting' |
421 |
383 |
local siblingSet = {parentFrame:GetChildren()} |
local siblingSet = {parentFrame:GetChildren()} |
422 |
384 |
local siblingQuantity = #siblingSet or 0 |
local siblingQuantity = #siblingSet or 0 |
423 |
385 |
assert (siblingQuantity >= 0) |
assert (siblingQuantity >= 0) |
424 |
|
assert (siblingQuantity <= maxRowQuantity * maxColumnQuantity) |
|
|
386 |
|
local maxIndicatorQuantity = math.min(64, maxRowQuantity * maxColumnQuantity) |
|
387 |
|
assert (siblingQuantity < maxIndicatorQuantity, 'too many indicators ' .. tostring(siblingQuantity)) |
425 |
388 |
local i = siblingQuantity + 1 |
local i = siblingQuantity + 1 |
426 |
389 |
local n = p .. 'SpellActivationOverlay' .. tostring(i) |
local n = p .. 'SpellActivationOverlay' .. tostring(i) |
427 |
390 |
|
|
|
... |
... |
local function createIndicator(parentFrame, target, unitDesignation, filterDescr |
432 |
395 |
local y = math.floor(siblingQuantity / maxColumnQuantity) |
local y = math.floor(siblingQuantity / maxColumnQuantity) |
433 |
396 |
local x = siblingQuantity - (maxColumnQuantity * y) |
local x = siblingQuantity - (maxColumnQuantity * y) |
434 |
397 |
f:SetSize(size, size) |
f:SetSize(size, size) |
435 |
|
f:SetPoint('BOTTOMLEFT', x * paddedSize, y * paddedSize) |
|
|
398 |
|
f:SetPoint('BOTTOMLEFT', x * paddedSize, y * (paddedSize + size * 2 / 3)) |
436 |
399 |
|
|
437 |
400 |
local t = f:CreateFontString(n .. 'Text', 'OVERLAY') |
local t = f:CreateFontString(n .. 'Text', 'OVERLAY') |
438 |
|
local fontObject = NumberFont_Outline_Large |
|
|
401 |
|
local fontObject = NumberFont_OutlineThick_Mono_Small |
439 |
402 |
assert (fontObject ~= nil) |
assert (fontObject ~= nil) |
440 |
403 |
t:SetFontObject(fontObject) |
t:SetFontObject(fontObject) |
441 |
|
t:SetAllPoints() |
|
|
404 |
|
t:SetPoint('TOPRIGHT', f, 'TOPRIGHT', 6, -f:GetHeight()) |
|
405 |
|
t:SetPoint('TOPLEFT', f, 'TOPLEFT', -6, -f:GetHeight()) |
|
406 |
|
t:SetPoint('BOTTOMLEFT', f, 'BOTTOMLEFT', 0, -f:GetHeight() * 2 / 3) |
|
407 |
|
t:SetPoint('BOTTOMRIGHT', f, 'BOTTOMRIGHT', 0, -f:GetHeight() * 2 / 3) |
442 |
408 |
t:SetText('?') |
t:SetText('?') |
443 |
409 |
f.text = t |
f.text = t |
444 |
410 |
|
|
|
... |
... |
local function createIndicator(parentFrame, target, unitDesignation, filterDescr |
446 |
412 |
a:SetAllPoints() |
a:SetAllPoints() |
447 |
413 |
f.background = a |
f.background = a |
448 |
414 |
|
|
|
415 |
|
f.unit = unitDesignation |
449 |
416 |
f.filter = string.upper(filterDescriptor or 'HELPFUL') |
f.filter = string.upper(filterDescriptor or 'HELPFUL') |
450 |
417 |
f.spell = target |
f.spell = target |
451 |
418 |
f:SetScript('OnEvent', indicatorEventProcessor) |
f:SetScript('OnEvent', indicatorEventProcessor) |
452 |
419 |
f:SetScript('OnUpdate', indicatorUpdateProcessor) |
f:SetScript('OnUpdate', indicatorUpdateProcessor) |
453 |
|
f:RegisterEvent('UNIT_AURA') |
|
454 |
420 |
f:RegisterEvent('PLAYER_ENTERING_WORLD') |
f:RegisterEvent('PLAYER_ENTERING_WORLD') |
|
421 |
|
f:RegisterEvent('PLAYER_FOCUS_CHANGED') |
|
422 |
|
f:RegisterEvent('PLAYER_TARGET_CHANGED') |
|
423 |
|
f:RegisterEvent('UNIT_AURA') |
455 |
424 |
|
|
456 |
425 |
return f |
return f |
457 |
426 |
end |
end |
458 |
427 |
|
|
459 |
|
local function initSpellActivationOverlay(rootFrame) |
|
|
428 |
|
local function sectionEventProcessor(section) |
|
429 |
|
assert (section ~= nil) |
|
430 |
|
|
|
431 |
|
local t = {section:GetChildren()} |
|
432 |
|
if #t < 1 then |
|
433 |
|
return |
|
434 |
|
end |
|
435 |
|
|
|
436 |
|
local width = section:GetWidth() |
|
437 |
|
|
|
438 |
|
local rowHeight = 44 |
|
439 |
|
local columnWidth = 28 |
|
440 |
|
local columnQuantitiy = math.floor(width / columnWidth) |
|
441 |
|
|
|
442 |
|
local x = 0 |
|
443 |
|
local y = 0 |
|
444 |
|
|
|
445 |
|
|
|
446 |
|
local i = 0 |
|
447 |
|
local j = math.min(math.max(0, #t), 64) |
|
448 |
|
while (i < j) do |
|
449 |
|
i = i + 1 |
|
450 |
|
local f = t[i] |
|
451 |
|
assert (f ~= nil) |
|
452 |
|
indicatorEventProcessor(f) |
|
453 |
|
if 1 == f:IsShown() then |
|
454 |
|
f:SetPoint('BOTTOMLEFT', x * columnWidth, y * rowHeight) |
|
455 |
|
x = x + 1 |
|
456 |
|
if x >= columnQuantitiy then |
|
457 |
|
x = 0 |
|
458 |
|
y = y + 1 |
|
459 |
|
end |
|
460 |
|
end |
|
461 |
|
end |
|
462 |
|
end |
|
463 |
|
|
|
464 |
|
local function createSection(name, parent, width, height) |
|
465 |
|
assert (name ~= nil) |
|
466 |
|
name = strtrim(name) |
|
467 |
|
assert ('string' == type(name)) |
|
468 |
|
assert (string.len(name) >= 4) |
|
469 |
|
assert (string.len(name) <= 128) |
|
470 |
|
|
|
471 |
|
assert (parent ~= nil) |
|
472 |
|
|
|
473 |
|
assert (width ~= nil) |
|
474 |
|
assert ('number' == type(width)) |
|
475 |
|
assert (width >= 12) |
|
476 |
|
assert (width <= 1024) |
|
477 |
|
|
|
478 |
|
assert (height ~= nil) |
|
479 |
|
assert ('number' == type(height)) |
|
480 |
|
assert (height >= 12) |
|
481 |
|
assert (height <= 1024) |
|
482 |
|
|
|
483 |
|
local section = CreateFrame('FRAME', name, parent) |
|
484 |
|
section:SetSize(width, height) |
|
485 |
|
|
|
486 |
|
local b = section:CreateTexture(name .. 'Background', 'BACKGROUND') |
|
487 |
|
b:SetAllPoints() |
|
488 |
|
b:SetTexture(0.02, 0.02, 0.02, 0.12) |
|
489 |
|
section.background = b |
|
490 |
|
|
|
491 |
|
section:SetScript('OnEvent', sectionEventProcessor) |
|
492 |
|
section:RegisterEvent('PLAYER_FOCUS_CHANGED') |
|
493 |
|
section:RegisterEvent('PLAYER_TARGET_CHANGED') |
|
494 |
|
section:RegisterEvent('UNIT_AURA') |
|
495 |
|
section:RegisterEvent('UNIT_DEATH') |
|
496 |
|
|
|
497 |
|
assert (section ~= nil) |
|
498 |
|
return section |
|
499 |
|
end |
|
500 |
|
|
|
501 |
|
local function initSpellActivationOverlayAny(rootFrame) |
|
502 |
|
local margin = rootFrame:GetWidth() / 2 - 28 * 5 / 2 |
|
503 |
|
local d0 = createIndicator(rootFrame, 'Magic', 'player', 'HARMFUL') |
|
504 |
|
d0:SetPoint('BOTTOMLEFT', margin + 28 * 0, 64) |
|
505 |
|
local d1 = createIndicator(rootFrame, 'Poison', 'player', 'HARMFUL') |
|
506 |
|
d1:SetPoint('BOTTOMLEFT', margin + 28 * 1, 64) |
|
507 |
|
local d2 = createIndicator(rootFrame, 'Disease', 'player', 'HARMFUL') |
|
508 |
|
d2:SetPoint('BOTTOMLEFT', margin + 28 * 2, 64) |
|
509 |
|
local d3 = createIndicator(rootFrame, 'Curse', 'player', 'HARMFUL') |
|
510 |
|
d3:SetPoint('BOTTOMLEFT', margin + 28 * 3, 64) |
|
511 |
|
local d4 = createIndicator(rootFrame, 'HARMFUL', 'player', 'HARMFUL') |
|
512 |
|
d4:SetPoint('BOTTOMLEFT', margin + 28 * 4, 64) |
|
513 |
|
end |
|
514 |
|
|
|
515 |
|
local function initSpellActivationOverlayPaladin(rootFrame) |
|
516 |
|
local _, classDesignation = UnitClass('player') |
|
517 |
|
if 'PALADIN' ~= classDesignation then |
|
518 |
|
return |
|
519 |
|
end |
|
520 |
|
|
|
521 |
|
--[[ row 1 ]]-- |
460 |
522 |
local presenceSet = { |
local presenceSet = { |
461 |
523 |
'Concentration Aura', |
'Concentration Aura', |
462 |
524 |
'Crusader Aura', |
'Crusader Aura', |
|
... |
... |
local function initSpellActivationOverlay(rootFrame) |
472 |
534 |
'Seal of Command', |
'Seal of Command', |
473 |
535 |
'Seal of Corruption', |
'Seal of Corruption', |
474 |
536 |
'Seal of Light', |
'Seal of Light', |
475 |
|
'Seal of Righetousness', |
|
|
537 |
|
'Seal of Righteousness', |
476 |
538 |
'Seal of Vengeance', |
'Seal of Vengeance', |
477 |
539 |
'Seal of Wisdom', |
'Seal of Wisdom', |
478 |
540 |
} |
} |
|
... |
... |
local function initSpellActivationOverlay(rootFrame) |
490 |
552 |
} |
} |
491 |
553 |
createIndicator(rootFrame, blessingSet, 'player', 'PLAYER HELPFUL') |
createIndicator(rootFrame, blessingSet, 'player', 'PLAYER HELPFUL') |
492 |
554 |
|
|
|
555 |
|
createIndicator(rootFrame, 'Righteous Fury') |
|
556 |
|
|
|
557 |
|
--[[ row 2 ]]-- |
493 |
558 |
createIndicator(rootFrame, 'Divine Shield') |
createIndicator(rootFrame, 'Divine Shield') |
494 |
559 |
createIndicator(rootFrame, 'Divine Protection') |
createIndicator(rootFrame, 'Divine Protection') |
495 |
560 |
createIndicator(rootFrame, 'Hand of Protection') |
createIndicator(rootFrame, 'Hand of Protection') |
496 |
561 |
createIndicator(rootFrame, 'Avenging Wrath') |
createIndicator(rootFrame, 'Avenging Wrath') |
|
562 |
|
--[[ row 3 ]]-- |
497 |
563 |
createIndicator(rootFrame, 'Divine Favor') |
createIndicator(rootFrame, 'Divine Favor') |
498 |
564 |
createIndicator(rootFrame, 'Divine Plea') |
createIndicator(rootFrame, 'Divine Plea') |
499 |
565 |
createIndicator(rootFrame, 'Divine Illumination') |
createIndicator(rootFrame, 'Divine Illumination') |
|
566 |
|
createIndicator(rootFrame, 'Hand of Sacrifice') |
|
567 |
|
--[[ row 4 ]]-- |
|
568 |
|
createIndicator(rootFrame, 'Judgements of the Pure') |
500 |
569 |
createIndicator(rootFrame, 'Light\'s Grace') |
createIndicator(rootFrame, 'Light\'s Grace') |
501 |
|
createIndicator(rootFrame, 'Hand of Freedom') |
|
|
570 |
|
createIndicator(rootFrame, 'Infusion of Light') |
|
571 |
|
createIndicator(rootFrame, 'Holy Shield') |
|
572 |
|
--[[ row 5 ]]-- |
|
573 |
|
createIndicator(rootFrame, 53601, 'player', 'PLAYER HELPFUL') |
|
574 |
|
createIndicator(rootFrame, 58597, 'player', 'PLAYER HELPFUL') |
|
575 |
|
createIndicator(rootFrame, 'Flash of Light', 'player', 'PLAYER HELPFUL') |
|
576 |
|
|
|
577 |
|
createIndicator(rootFrame, 58597, 'focus', 'HELPFUL') |
|
578 |
|
end |
502 |
579 |
|
|
503 |
|
local margin = rootFrame:GetWidth() / 2 - 28 * 5 / 2 |
|
504 |
|
local d0 = createIndicator(rootFrame, 'Magic', 'player', 'HARMFUL') |
|
505 |
|
d0:SetPoint('BOTTOMLEFT', margin + 28 * 0, 64) |
|
506 |
|
local d1 = createIndicator(rootFrame, 'Poison', 'player', 'HARMFUL') |
|
507 |
|
d1:SetPoint('BOTTOMLEFT', margin + 28 * 1, 64) |
|
508 |
|
local d2 = createIndicator(rootFrame, 'Disease', 'player', 'HARMFUL') |
|
509 |
|
d2:SetPoint('BOTTOMLEFT', margin + 28 * 2, 64) |
|
510 |
|
local d3 = createIndicator(rootFrame, 'Curse', 'player', 'HARMFUL') |
|
511 |
|
d3:SetPoint('BOTTOMLEFT', margin + 28 * 3, 64) |
|
512 |
|
local d4 = createIndicator(rootFrame, 'HARMFUL', 'player', 'HARMFUL') |
|
513 |
|
d4:SetPoint('BOTTOMLEFT', margin + 28 * 4, 64) |
|
|
580 |
|
local function initSpellActivationOverlayWarlock(rootFrame) |
|
581 |
|
assert (rootFrame ~= nil) |
|
582 |
|
|
|
583 |
|
local _, classDesignation = UnitClass('player') |
|
584 |
|
if 'WARLOCK' ~= classDesignation then |
|
585 |
|
return |
|
586 |
|
end |
|
587 |
|
|
|
588 |
|
local sectionWidth = 128 |
|
589 |
|
local sectionHeight = 64 |
|
590 |
|
|
|
591 |
|
local wf = createSection('ClearcastingWarlockFrame', rootFrame, sectionWidth, sectionHeight) |
|
592 |
|
wf:SetPoint('BOTTOMLEFT', rootFrame:GetWidth() / 2 - sectionWidth / 2, 0) |
|
593 |
|
|
|
594 |
|
createIndicator(wf, 'Blood Fury') |
|
595 |
|
createIndicator(wf, 'Sacrifice') |
|
596 |
|
createIndicator(wf, 'Backlash') |
|
597 |
|
createIndicator(wf, 'Decimation') |
|
598 |
|
createIndicator(wf, 'Eradication') |
|
599 |
|
createIndicator(wf, 'Shadow Trance') |
|
600 |
|
createIndicator(wf, 'Nether Protection') |
|
601 |
|
createIndicator(wf, 'Shadow Ward') |
|
602 |
|
|
|
603 |
|
--[[ Cumulative effects. Show effects that belong to user only. ]]-- |
|
604 |
|
local t = { |
|
605 |
|
'Drain Soul', |
|
606 |
|
'Drain Life', |
|
607 |
|
'Corruption', |
|
608 |
|
'Haunt', |
|
609 |
|
'Immolate', |
|
610 |
|
'Seed of Corruption', |
|
611 |
|
'Unstable Affliction', |
|
612 |
|
'Shadow Embrace', |
|
613 |
|
} |
|
614 |
|
|
|
615 |
|
--[[ Conflicting or overlapping effects. Show effects that belong to any player. ]]-- |
|
616 |
|
local u = { |
|
617 |
|
--[[ Curse ]]-- |
|
618 |
|
'Curse of Agony', |
|
619 |
|
'Curse of Exhaustion', |
|
620 |
|
'Curse of Weakness', |
|
621 |
|
'Curse of the Elements', |
|
622 |
|
'Curse of Tongues', |
|
623 |
|
'Hex', |
|
624 |
|
--[[ Magic ]]-- |
|
625 |
|
'Shadow Mastery', |
|
626 |
|
'Entangling Roots', |
|
627 |
|
'Fear', |
|
628 |
|
'Polymorph', |
|
629 |
|
'Psychic Scream', |
|
630 |
|
'Spell Lock', |
|
631 |
|
'Counterspell', |
|
632 |
|
'Death Coil', |
|
633 |
|
'Howl of Terror', |
|
634 |
|
'Psychic Scream', |
|
635 |
|
--[[ Other ]]-- |
|
636 |
|
'Concussion Blow', |
|
637 |
|
'Cyclone', |
|
638 |
|
} |
|
639 |
|
|
|
640 |
|
local sft = createSection('ClearcastingWarlockFocusPlayerHarmful', rootFrame, sectionWidth, sectionHeight) |
|
641 |
|
local sfu = createSection('ClearcastingWarlockFocusHarmful', rootFrame, sectionWidth, sectionHeight) |
|
642 |
|
local spt = createSection('ClearcastingWarlockPetTargetPlayerHarmful', rootFrame, sectionWidth, sectionHeight) |
|
643 |
|
local spu = createSection('ClearcastingWarlockPetTargetHarmful', rootFrame, sectionWidth, sectionHeight) |
|
644 |
|
local stt = createSection('ClearcastingWarlockTargetPlayerHarmful', rootFrame, sectionWidth, sectionHeight) |
|
645 |
|
local stu = createSection('ClearcastingWarlockTargetHarmful', rootFrame, sectionWidth, sectionHeight) |
|
646 |
|
|
|
647 |
|
local marginBottom = rootFrame:GetHeight() * 2 / 3 |
|
648 |
|
local marginLeft = rootFrame:GetWidth() |
|
649 |
|
sft:SetPoint('BOTTOMLEFT', marginLeft - sectionWidth * 2, marginBottom + sectionHeight * 0) |
|
650 |
|
sfu:SetPoint('BOTTOMLEFT', marginLeft - sectionWidth * 2, marginBottom + sectionHeight * 1) |
|
651 |
|
spt:SetPoint('BOTTOMLEFT', marginLeft - sectionWidth * 1, marginBottom + sectionHeight * 0) |
|
652 |
|
spu:SetPoint('BOTTOMLEFT', marginLeft - sectionWidth * 1, marginBottom + sectionHeight * 1) |
|
653 |
|
stt:SetPoint('BOTTOMLEFT', sectionWidth, marginBottom + sectionHeight * 0) |
|
654 |
|
stu:SetPoint('BOTTOMLEFT', sectionWidth, marginBottom + sectionHeight * 1) |
|
655 |
|
|
|
656 |
|
local p = 0 |
|
657 |
|
while (p < #t) do |
|
658 |
|
p = p + 1 |
|
659 |
|
local spellName = t[p] |
|
660 |
|
createIndicator(stt, spellName, 'target', 'PLAYER HARMFUL') |
|
661 |
|
createIndicator(sft, spellName, 'focus', 'PLAYER HARMFUL') |
|
662 |
|
createIndicator(spt, spellName, 'pettarget', 'PLAYER HARMFUL') |
|
663 |
|
end |
|
664 |
|
|
|
665 |
|
local q = 0 |
|
666 |
|
while (q < #u) do |
|
667 |
|
q = q + 1 |
|
668 |
|
local spellName = u[q] |
|
669 |
|
createIndicator(stu, spellName, 'target', 'HARMFUL') |
|
670 |
|
createIndicator(sfu, spellName, 'focus', 'HARMFUL') |
|
671 |
|
createIndicator(spu, spellName, 'pettarget', 'HARMFUL') |
|
672 |
|
end |
|
673 |
|
end |
|
674 |
|
|
|
675 |
|
local function initSpellActivationOverlayWarrior(rootFrame) |
|
676 |
|
local _, classDesignation = UnitClass('player') |
|
677 |
|
if 'WARRIOR' ~= classDesignation then |
|
678 |
|
return |
|
679 |
|
end |
|
680 |
|
|
|
681 |
|
createIndicator(rootFrame, 'Shield Wall') |
|
682 |
|
createIndicator(rootFrame, 'Last Stand') |
|
683 |
|
createIndicator(rootFrame, 'Enraged Regeneration') |
|
684 |
|
createIndicator(rootFrame, 'Shield Block') |
|
685 |
|
|
|
686 |
|
createIndicator(rootFrame, 'Recklessness') |
|
687 |
|
createIndicator(rootFrame, 'Retaliation') |
|
688 |
|
createIndicator(rootFrame, 'Berserker Rage') |
|
689 |
|
createIndicator(rootFrame, 'Bloodrage') |
|
690 |
|
|
|
691 |
|
createIndicator(rootFrame, 'Blood Fury') |
|
692 |
|
createIndicator(rootFrame, 'Enrage') |
|
693 |
|
createIndicator(rootFrame, 'Glyph of Blocking') |
|
694 |
|
createIndicator(rootFrame, 'Sword and Board') |
|
695 |
|
|
|
696 |
|
local x = UIParent:GetWidth() / 2 - 28 * 10 / 2 |
|
697 |
|
local y = 640 |
|
698 |
|
|
|
699 |
|
local f0 = createIndicator(rootFrame, 'Concussion Blow', 'target', 'PLAYER HARMFUL') |
|
700 |
|
f0:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 0, y) |
|
701 |
|
|
|
702 |
|
local f1 = createIndicator(rootFrame, 'Shockwave', 'target', 'PLAYER HARMFUL') |
|
703 |
|
f1:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 1, y) |
|
704 |
|
|
|
705 |
|
local f2 = createIndicator(rootFrame, 'Hamstring', 'target', 'PLAYER HARMFUL') |
|
706 |
|
f2:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 2, y) |
|
707 |
|
|
|
708 |
|
local f3 = createIndicator(rootFrame, 'Piercing Howl', 'target', 'PLAYER HARMFUL') |
|
709 |
|
f3:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 3, y) |
|
710 |
|
|
|
711 |
|
local f4 = createIndicator(rootFrame, 'Gag Order', 'target', 'PLAYER HARMFUL') |
|
712 |
|
f4:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 4, y) |
|
713 |
|
|
|
714 |
|
local f5 = createIndicator(rootFrame, 'Disarm', 'target', 'PLAYER HARMFUL') |
|
715 |
|
f5:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 5, y) |
|
716 |
|
|
|
717 |
|
local f6 = createIndicator(rootFrame, 'Intimidating Shout', 'target', 'PLAYER HARMFUL') |
|
718 |
|
f6:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 6, y) |
|
719 |
|
|
|
720 |
|
local f7 = createIndicator(rootFrame, 'Sunder Armor', 'target', 'PLAYER HARMFUL') |
|
721 |
|
f7:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 7, y) |
|
722 |
|
|
|
723 |
|
local f8 = createIndicator(rootFrame, 'Taunt', 'target', 'PLAYER HARMFUL') |
|
724 |
|
f8:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 8, y) |
|
725 |
|
|
|
726 |
|
local f9 = createIndicator(rootFrame, 'Mocking Blow', 'target', 'PLAYER HARMFUL') |
|
727 |
|
f9:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 9, y) |
|
728 |
|
|
|
729 |
|
local f10 = createIndicator(rootFrame, 'Challenging Shout', 'target', 'PLAYER HARMFUL') |
|
730 |
|
f10:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 10, y) |
|
731 |
|
end |
|
732 |
|
|
|
733 |
|
local function initSpellActivationOverlayPriest(rootFrame) |
|
734 |
|
local x = UIParent:GetWidth() / 2 - 28 * 10 / 2 |
|
735 |
|
local y = 640 |
|
736 |
|
|
|
737 |
|
local f0 = createIndicator(rootFrame, 'Surge of Light', 'player', 'PLAYER HELPFUL') |
|
738 |
|
f0:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 0, y) |
|
739 |
|
|
|
740 |
|
local f1 = createIndicator(rootFrame, 'Serendipity', 'player', 'PLAYER HELPFUL') |
|
741 |
|
f1:SetPoint('BOTTOMLEFT', UIParent, 'BOTTOMLEFT', x + 28 * 1, y) |
|
742 |
|
end |
|
743 |
|
|
|
744 |
|
local function initSpellActivationOverlay(rootFrame) |
|
745 |
|
initSpellActivationOverlayPaladin(rootFrame) |
|
746 |
|
initSpellActivationOverlayPriest(rootFrame) |
|
747 |
|
initSpellActivationOverlayWarlock(rootFrame) |
|
748 |
|
initSpellActivationOverlayWarrior(rootFrame) |
|
749 |
|
initSpellActivationOverlayAny(rootFrame) |
514 |
750 |
|
|
515 |
751 |
return {rootFrame:GetChildren()} |
return {rootFrame:GetChildren()} |
516 |
752 |
end |
end |
|
... |
... |
end |
535 |
771 |
local function main() |
local function main() |
536 |
772 |
assert ('enGB' == GetLocale() or 'enUS' == GetLocale()) |
assert ('enGB' == GetLocale() or 'enUS' == GetLocale()) |
537 |
773 |
local rootFrame = CreateFrame('FRAME', 'ClearcastingFrame', UIParent) |
local rootFrame = CreateFrame('FRAME', 'ClearcastingFrame', UIParent) |
538 |
|
rootFrame:SetSize(384, 288) |
|
|
774 |
|
rootFrame:SetSize(1024, 768) |
539 |
775 |
rootFrame:SetPoint('CENTER', UIParent, 'CENTER', 0, 0) |
rootFrame:SetPoint('CENTER', UIParent, 'CENTER', 0, 0) |
540 |
776 |
|
|
541 |
777 |
rootFrame:SetScript('OnEvent', init) |
rootFrame:SetScript('OnEvent', init) |