File clearcasting.lua changed (mode: 100644) (index 9682e8f..fa1d1dd) |
... |
... |
local function tooltipOverlayEventProcessor(tooltipOverlay) |
390 |
390 |
|
|
391 |
391 |
GameTooltip:SetOwner(tooltipOverlay, 'ANCHOR_BOTTOMRIGHT') |
GameTooltip:SetOwner(tooltipOverlay, 'ANCHOR_BOTTOMRIGHT') |
392 |
392 |
|
|
393 |
|
local indicator = tooltipOverlay:GetParent() |
|
394 |
|
assert (indicator ~= nil) |
|
395 |
|
|
|
396 |
|
local spell = indicator.spellId or indicator.spellName or indicator:GetAttribute('spell') |
|
397 |
|
local _, _, _, spellId = GetSpellInfo(spell) |
|
398 |
|
if spellId then |
|
399 |
|
assert ('number' == type(spellId)) |
|
400 |
|
local t = GetSpellLink(spell) |
|
|
393 |
|
local button = tooltipOverlay:GetParent() |
|
394 |
|
assert (button ~= nil) |
|
395 |
|
GameTooltip:SetText('spell description could not be found') |
|
396 |
|
if button.unit and button.index and button.filter then |
|
397 |
|
GameTooltip:SetUnitAura(button.unit, button.index, button.filter); |
|
398 |
|
elseif button.spellId then |
|
399 |
|
local t = GetSpellLink(button.spellId) |
401 |
400 |
GameTooltip:SetHyperlink(t) |
GameTooltip:SetHyperlink(t) |
402 |
|
else |
|
403 |
|
GameTooltip:SetText('spell description could not be found') |
|
404 |
401 |
end |
end |
405 |
402 |
end |
end |
406 |
403 |
|
|
|
... |
... |
local function requestUnitAuraTable(unitDesignation, filterDescriptor) |
661 |
658 |
if name then |
if name then |
662 |
659 |
local auraTable = {name, rank, pictureFile, stackQuantity, category, |
local auraTable = {name, rank, pictureFile, stackQuantity, category, |
663 |
660 |
duration, expirationInstance, |
duration, expirationInstance, |
664 |
|
caster, stealableFlag, consolidateFlag, id} |
|
|
661 |
|
caster, stealableFlag, consolidateFlag, id, j} |
665 |
662 |
q = q + 1 |
q = q + 1 |
666 |
663 |
e[q] = auraTable |
e[q] = auraTable |
667 |
664 |
else |
else |
|
... |
... |
local function subsetEventProcessor(subsetFrame) |
715 |
712 |
|
|
716 |
713 |
local spellName = auraTable[1] |
local spellName = auraTable[1] |
717 |
714 |
assert (spellName ~= nil) |
assert (spellName ~= nil) |
718 |
|
b:SetAttribute('unit', unitDesignation) |
|
719 |
|
b:SetAttribute('spell', spellName) |
|
|
715 |
|
b.spell = spellName |
720 |
716 |
|
|
|
717 |
|
local index = auraTable[12] |
|
718 |
|
assert (index ~= nil) |
|
719 |
|
b.index = index |
|
720 |
|
|
|
721 |
|
b.filter = filterDescriptor |
721 |
722 |
b.unit = unitDesignation |
b.unit = unitDesignation |
722 |
|
local spellId = auraTable[11] |
|
723 |
|
b.spellId = spellId |
|
724 |
|
b.spellName = spellName |
|
725 |
723 |
|
|
726 |
724 |
b:Show() |
b:Show() |
727 |
725 |
end |
end |
|
... |
... |
local function subsetEventProcessor(subsetFrame) |
736 |
734 |
assert (artwork ~= nil, b:GetName() .. ' requires artwork field') |
assert (artwork ~= nil, b:GetName() .. ' requires artwork field') |
737 |
735 |
artwork:SetTexture("Interface\\Icons\\spell_nature_wispsplode") |
artwork:SetTexture("Interface\\Icons\\spell_nature_wispsplode") |
738 |
736 |
|
|
739 |
|
b:SetAttribute('unit', unitDesignation) |
|
740 |
|
b:SetAttribute('spell', nil) |
|
|
737 |
|
b.spell = nil |
|
738 |
|
b.index = nil |
741 |
739 |
|
|
742 |
|
b.unit = nil |
|
743 |
|
b.spellId = nil |
|
744 |
|
b.spellName = nil |
|
|
740 |
|
b.filter = filterDescriptor |
|
741 |
|
b.unit = unitDesignation |
745 |
742 |
|
|
746 |
743 |
b:Hide() |
b:Hide() |
747 |
744 |
end |
end |
748 |
745 |
end |
end |
749 |
746 |
|
|
750 |
747 |
local function subsetButtonUpdateProcessor(subsetButton) |
local function subsetButtonUpdateProcessor(subsetButton) |
751 |
|
local unit = subsetButton.unit or subsetButton:GetAttribute('unit') |
|
|
748 |
|
local unit = subsetButton.unit |
752 |
749 |
if not unit then |
if not unit then |
753 |
750 |
return |
return |
754 |
751 |
end |
end |
755 |
752 |
|
|
756 |
|
local spell = subsetButton.spell or subsetButton.spellName or subsetButton:GetAttribute('spell') |
|
|
753 |
|
local spell = subsetButton.spell |
757 |
754 |
if not spell then |
if not spell then |
758 |
755 |
return |
return |
759 |
756 |
end |
end |
760 |
757 |
|
|
761 |
|
local filter = subsetButton.filter or subsetButton:GetAttribute('filter') |
|
|
758 |
|
local filter = subsetButton.filter |
762 |
759 |
|
|
763 |
760 |
local n, _, _, stackQuantity, _, durationSec, expirationInstance = UnitAura(unit, spell, nil, filter) |
local n, _, _, stackQuantity, _, durationSec, expirationInstance = UnitAura(unit, spell, nil, filter) |
764 |
761 |
if not n then |
if not n then |
|
... |
... |
local function createSubsetButton(subsetFrame, buttonDesignation, unitDesignatio |
853 |
850 |
|
|
854 |
851 |
assert (buttonWidth <= buttonHeight) |
assert (buttonWidth <= buttonHeight) |
855 |
852 |
|
|
856 |
|
local b = CreateFrame('BUTTON', buttonDesignation, subsetFrame, 'SecureActionButtonTemplate') |
|
|
853 |
|
local b = CreateFrame('FRAME', buttonDesignation, subsetFrame) |
857 |
854 |
b:SetSize(buttonWidth, buttonHeight) |
b:SetSize(buttonWidth, buttonHeight) |
858 |
855 |
|
|
859 |
856 |
b.artwork = createSubsetButtonArtwork(b) |
b.artwork = createSubsetButtonArtwork(b) |
860 |
857 |
b.text = createSubsetButtonText(b) |
b.text = createSubsetButtonText(b) |
861 |
858 |
|
|
862 |
|
b:SetAttribute('type2', 'cancelaura') |
|
863 |
|
b:SetAttribute('unit', unitDesignation) |
|
864 |
|
b:SetAttribute('spell', spellName) |
|
865 |
|
b:SetAttribute('filter', filterDescriptor) |
|
|
859 |
|
b.unit = unitDesignation |
|
860 |
|
b.spell = spellName or nil |
|
861 |
|
b.filter = filterDescriptor or nil |
|
862 |
|
b.index = nil |
866 |
863 |
|
|
867 |
864 |
--[[ TODO Add aura category (magic, disease, physical etc) border color indicator ]]-- |
--[[ TODO Add aura category (magic, disease, physical etc) border color indicator ]]-- |
868 |
865 |
b.tooltipOverlay = createTooltipOverlay(b) |
b.tooltipOverlay = createTooltipOverlay(b) |
|
... |
... |
local function createSubset(parentFrame, frameDesignation, unitDesignation, filt |
933 |
930 |
|
|
934 |
931 |
local padding = math.ceil(math.min(buttonWidth, buttonHeight) / 10) |
local padding = math.ceil(math.min(buttonWidth, buttonHeight) / 10) |
935 |
932 |
|
|
936 |
|
local subsetFrame = CreateFrame('FRAME', frameDesignation, parentFrame, 'SecureHandlerBaseTemplate') |
|
|
933 |
|
local subsetFrame = CreateFrame('FRAME', frameDesignation, parentFrame) |
937 |
934 |
subsetFrame:SetSize(buttonWidth * columnQuantity + padding * (columnQuantity + 1), |
subsetFrame:SetSize(buttonWidth * columnQuantity + padding * (columnQuantity + 1), |
938 |
935 |
buttonHeight * rowQuantity + padding * (rowQuantity + 1)) |
buttonHeight * rowQuantity + padding * (rowQuantity + 1)) |
939 |
936 |
|
|
|
... |
... |
local function createSubset(parentFrame, frameDesignation, unitDesignation, filt |
961 |
958 |
subsetFrame:RegisterEvent('PLAYER_FOCUS_CHANGED') |
subsetFrame:RegisterEvent('PLAYER_FOCUS_CHANGED') |
962 |
959 |
subsetFrame:RegisterEvent('PLAYER_LOGIN') |
subsetFrame:RegisterEvent('PLAYER_LOGIN') |
963 |
960 |
subsetFrame:RegisterEvent('PLAYER_TARGET_CHANGED') |
subsetFrame:RegisterEvent('PLAYER_TARGET_CHANGED') |
|
961 |
|
subsetFrame:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED') |
964 |
962 |
subsetFrame:RegisterEvent('RAID_ROSTER_UPDATE') |
subsetFrame:RegisterEvent('RAID_ROSTER_UPDATE') |
965 |
963 |
subsetFrame:RegisterEvent('UNIT_AURA') |
subsetFrame:RegisterEvent('UNIT_AURA') |
966 |
964 |
subsetFrame:RegisterEvent('UNIT_HEALTH') |
subsetFrame:RegisterEvent('UNIT_HEALTH') |