File clearcasting.lua changed (mode: 100644) (index fa1d1dd..f192fdb) |
... |
... |
local function debug(...) |
14 |
14 |
end |
end |
15 |
15 |
end |
end |
16 |
16 |
|
|
17 |
|
local function getIndicatorArtworkSize() |
|
18 |
|
return 24 |
|
19 |
|
end |
|
20 |
|
|
|
21 |
|
local function getIndicatorFooterSize() |
|
22 |
|
return 16 |
|
23 |
|
end |
|
24 |
|
|
|
25 |
|
local function getIndicatorPadding() |
|
26 |
|
return 4 |
|
27 |
|
end |
|
28 |
|
|
|
29 |
17 |
local function findFirstFilterName(unitDesignation, filterDescriptor, eitherTargetNameOrId) |
local function findFirstFilterName(unitDesignation, filterDescriptor, eitherTargetNameOrId) |
30 |
18 |
assert (unitDesignation ~= nil) |
assert (unitDesignation ~= nil) |
31 |
19 |
assert ('string' == type(unitDesignation)) |
assert ('string' == type(unitDesignation)) |
|
... |
... |
local function applyBackground(f, pictureFile) |
206 |
194 |
--f:SetBackdropColor(0.5, 0.5, 0.5, 0.5) |
--f:SetBackdropColor(0.5, 0.5, 0.5, 0.5) |
207 |
195 |
end |
end |
208 |
196 |
|
|
209 |
|
local function applyBorder(f, category, caster) |
|
210 |
|
local r, g, b, a |
|
211 |
|
if 'Magic' == category then |
|
212 |
|
r = 0 / 255 |
|
213 |
|
g = 153 / 255 |
|
214 |
|
b = 255 / 255 |
|
215 |
|
a = 255 / 255 |
|
216 |
|
elseif 'Disease' == category then |
|
217 |
|
r = 204 / 255 |
|
218 |
|
g = 255 / 255 |
|
219 |
|
b = 0 / 255 |
|
220 |
|
a = 255 / 255 |
|
221 |
|
elseif 'Curse' == category then |
|
222 |
|
r = 255 / 255 |
|
223 |
|
g = 51 / 255 |
|
224 |
|
b = 255 / 255 |
|
225 |
|
a = 255 / 255 |
|
226 |
|
elseif 'Poison' == category then |
|
227 |
|
r = 0 / 255 |
|
228 |
|
g = 204 / 255 |
|
229 |
|
b = 51 / 255 |
|
230 |
|
a = 255 / 255 |
|
231 |
|
elseif 'player' == caster then |
|
232 |
|
r = 255 / 255 |
|
233 |
|
g = 255 / 255 |
|
234 |
|
b = 255 / 255 |
|
235 |
|
a = 255 / 255 |
|
236 |
|
else |
|
237 |
|
r = 255 / 255 |
|
238 |
|
g = 51 / 255 |
|
239 |
|
b = 0 / 255 |
|
240 |
|
a = 255 / 255 |
|
|
197 |
|
local function getAuraCategoryColor(categoryName) |
|
198 |
|
local categoryTable = DebuffTypeColor[categoryName] |
|
199 |
|
if not categoryTable then |
|
200 |
|
categoryTable = DebuffTypeColor['none'] |
241 |
201 |
end |
end |
|
202 |
|
return categoryTable.r, categoryTable.g, categoryTable.b |
|
203 |
|
end |
|
204 |
|
|
|
205 |
|
local function applyBorder(f, category) |
|
206 |
|
local r, g, b = getAuraCategoryColor(category) |
|
207 |
|
local a = 1 |
242 |
208 |
f:SetBackdropBorderColor(r, g, b, a) |
f:SetBackdropBorderColor(r, g, b, a) |
243 |
209 |
end |
end |
244 |
210 |
|
|
|
... |
... |
local function subsetEventProcessor(subsetFrame) |
710 |
676 |
local expirationInstance = auraTable[7] |
local expirationInstance = auraTable[7] |
711 |
677 |
applyDuration(b, durationSec, expirationInstance, stackQuantity) |
applyDuration(b, durationSec, expirationInstance, stackQuantity) |
712 |
678 |
|
|
|
679 |
|
local background = b.background |
|
680 |
|
assert (background ~= nil) |
|
681 |
|
local category = auraTable[5] or 'none' |
|
682 |
|
assert (category ~= nil) |
|
683 |
|
local red, green, blue = getAuraCategoryColor(category) |
|
684 |
|
local alpha = 0.6 |
|
685 |
|
background:SetTexture(red, green, blue, alpha) |
|
686 |
|
|
|
687 |
|
local casterDesignation = auraTable[8] |
|
688 |
|
if 'player' == casterDesignation then |
|
689 |
|
local label = b.text |
|
690 |
|
label:SetTextColor(1, 0.8, 0) |
|
691 |
|
else |
|
692 |
|
local label = b.text |
|
693 |
|
label:SetTextColor(1, 1, 1) |
|
694 |
|
end |
|
695 |
|
|
713 |
696 |
local spellName = auraTable[1] |
local spellName = auraTable[1] |
714 |
697 |
assert (spellName ~= nil) |
assert (spellName ~= nil) |
715 |
698 |
b.spell = spellName |
b.spell = spellName |
|
... |
... |
local function createSubsetButtonArtwork(subsetButton) |
782 |
765 |
return artwork |
return artwork |
783 |
766 |
end |
end |
784 |
767 |
|
|
785 |
|
local function createSubsetButtonText(subsetButton) |
|
|
768 |
|
local function createSubsetButtonBackground(subsetButton) |
786 |
769 |
assert (subsetButton ~= nil) |
assert (subsetButton ~= nil) |
787 |
770 |
|
|
788 |
|
local buttonHeight = subsetButton:GetHeight() |
|
|
771 |
|
local background = subsetButton:CreateTexture(subsetButton:GetName() .. 'Background', 'BACKGROUND') |
|
772 |
|
background:SetAllPoints() |
|
773 |
|
background:SetTexture(getAuraCategoryColor('none')) |
|
774 |
|
|
|
775 |
|
return background |
|
776 |
|
end |
|
777 |
|
|
|
778 |
|
|
|
779 |
|
local function createSubsetButtonText(subsetButton) |
|
780 |
|
assert (subsetButton ~= nil) |
789 |
781 |
|
|
790 |
782 |
local t = subsetButton:CreateFontString(subsetButton:GetName() .. 'Text', 'OVERLAY') |
local t = subsetButton:CreateFontString(subsetButton:GetName() .. 'Text', 'OVERLAY') |
791 |
783 |
local fontObject = NumberFont_OutlineThick_Mono_Small |
local fontObject = NumberFont_OutlineThick_Mono_Small |
|
... |
... |
local function createSubsetButtonText(subsetButton) |
793 |
785 |
t:SetFontObject(fontObject) |
t:SetFontObject(fontObject) |
794 |
786 |
t:SetPoint('BOTTOMLEFT', -4, 0) |
t:SetPoint('BOTTOMLEFT', -4, 0) |
795 |
787 |
t:SetPoint('BOTTOMRIGHT', 4, 0) |
t:SetPoint('BOTTOMRIGHT', 4, 0) |
796 |
|
t:SetPoint('TOPRIGHT', 4, buttonHeight / -2) |
|
797 |
|
t:SetPoint('TOPLEFT', -4, buttonHeight / -2) |
|
|
788 |
|
t:SetPoint('TOPLEFT', subsetButton, 'BOTTOMLEFT', -4, 16) |
|
789 |
|
t:SetPoint('TOPRIGHT', subsetButton, 'BOTTOMRIGHT', 4, 16) |
798 |
790 |
t:SetText('?') |
t:SetText('?') |
799 |
791 |
|
|
800 |
792 |
return t |
return t |
|
... |
... |
local function createSubsetButton(subsetFrame, buttonDesignation, unitDesignatio |
855 |
847 |
|
|
856 |
848 |
b.artwork = createSubsetButtonArtwork(b) |
b.artwork = createSubsetButtonArtwork(b) |
857 |
849 |
b.text = createSubsetButtonText(b) |
b.text = createSubsetButtonText(b) |
|
850 |
|
b.background = createSubsetButtonBackground(b) |
858 |
851 |
|
|
859 |
852 |
b.unit = unitDesignation |
b.unit = unitDesignation |
860 |
853 |
b.spell = spellName or nil |
b.spell = spellName or nil |
861 |
854 |
b.filter = filterDescriptor or nil |
b.filter = filterDescriptor or nil |
862 |
855 |
b.index = nil |
b.index = nil |
863 |
856 |
|
|
864 |
|
--[[ TODO Add aura category (magic, disease, physical etc) border color indicator ]]-- |
|
865 |
857 |
b.tooltipOverlay = createTooltipOverlay(b) |
b.tooltipOverlay = createTooltipOverlay(b) |
866 |
858 |
|
|
867 |
859 |
b:SetScript('OnUpdate', subsetButtonUpdateProcessor) |
b:SetScript('OnUpdate', subsetButtonUpdateProcessor) |
|
... |
... |
local function init(rootFrame) |
1309 |
1301 |
--rootFrame:RegisterEvent('UNIT_AURA') |
--rootFrame:RegisterEvent('UNIT_AURA') |
1310 |
1302 |
--rootFrame:RegisterEvent('SPELLS_CHANGED') |
--rootFrame:RegisterEvent('SPELLS_CHANGED') |
1311 |
1303 |
rootFrame.createIndicator = createIndicator |
rootFrame.createIndicator = createIndicator |
|
1304 |
|
rootFrame.createSubset = function(...) |
|
1305 |
|
createSubset(...) |
|
1306 |
|
end |
1312 |
1307 |
end |
end |
1313 |
1308 |
|
|
1314 |
1309 |
local function main() |
local function main() |