This commit is contained in:
Bunny67
2018-06-03 18:29:49 +03:00
parent 82d0bad46b
commit 9b646f4d15
2 changed files with 3 additions and 28 deletions
+2 -20
View File
@@ -16,7 +16,6 @@ At least one of the above widgets must be present for the element to work.
## Options ## Options
.disableMouse - Disables mouse events (boolean) .disableMouse - Disables mouse events (boolean)
.disableCooldown - Disables the cooldown spiral (boolean)
.size - Aura icon size. Defaults to 16 (number) .size - Aura icon size. Defaults to 16 (number)
.spacing - Spacing between each icon. Defaults to 0 (number) .spacing - Spacing between each icon. Defaults to 0 (number)
.['spacing-x'] - Horizontal spacing between each icon. Takes priority over `spacing` (number) .['spacing-x'] - Horizontal spacing between each icon. Takes priority over `spacing` (number)
@@ -104,9 +103,6 @@ local function createAuraIcon(element, index)
local button = CreateFrame('Button', '$parentButton' .. index, element) local button = CreateFrame('Button', '$parentButton' .. index, element)
button:RegisterForClicks('RightButtonUp') button:RegisterForClicks('RightButtonUp')
local cd = CreateFrame('Frame', '$parentCooldown', button, 'oUF_CooldownFrameTemplate')
cd:SetAllPoints()
local icon = button:CreateTexture(nil, 'BORDER') local icon = button:CreateTexture(nil, 'BORDER')
icon:SetAllPoints() icon:SetAllPoints()
@@ -121,11 +117,10 @@ local function createAuraIcon(element, index)
button.UpdateTooltip = UpdateTooltip button.UpdateTooltip = UpdateTooltip
button:SetScript('OnEnter', function() onEnter(this) end) button:SetScript('OnEnter', function() onEnter(this) end)
button:SetScript('OnLeave', function() onLeave(this) end) button:SetScript('OnLeave', onLeave)
button.icon = icon button.icon = icon
button.count = count button.count = count
button.cd = cd
--[[ Callback: Auras:PostCreateIcon(button) --[[ Callback: Auras:PostCreateIcon(button)
Called after a new aura button has been created. Called after a new aura button has been created.
@@ -203,18 +198,6 @@ local function updateIcon(element, unit, index, offset, filter, isDebuff, visibl
end end
if show then if show then
-- We might want to consider delaying the creation of an actual cooldown
-- object to this point, but I think that will just make things needlessly
-- complicated.
if button.cd and not element.disableCooldown then
if duration and duration > 0 then
-- button.cd:SetCooldown(GetTime() - (duration - expiration), duration)
button.cd:Show()
else
button.cd:Hide()
end
end
if button.overlay then if button.overlay then
if (isDebuff and element.showDebuffType) or (not isDebuff and element.showBuffType) or element.showType then if (isDebuff and element.showDebuffType) or (not isDebuff and element.showBuffType) or element.showType then
local color = DebuffTypeColor[dispelType] or DebuffTypeColor.none local color = DebuffTypeColor[dispelType] or DebuffTypeColor.none
@@ -227,7 +210,7 @@ local function updateIcon(element, unit, index, offset, filter, isDebuff, visibl
end end
if button.icon then button.icon:SetTexture(texture) end if button.icon then button.icon:SetTexture(texture) end
-- if button.count then button.count:SetText(count > 1 and count) end if button.count then button.count:SetText(count > 1 and count) end
local size = element.size or 16 local size = element.size or 16
button:SetWidth(size) button:SetWidth(size)
@@ -339,7 +322,6 @@ local function UpdateAuras(self, event, unit)
end end
-- Prevent the button from displaying anything. -- Prevent the button from displaying anything.
if button.cd then button.cd:Hide() end
if button.icon then button.icon:SetTexture() end if button.icon then button.icon:SetTexture() end
if button.overlay then button.overlay:Hide() end if button.overlay then button.overlay:Hide() end
if button.stealable then button.stealable:Hide() end if button.stealable then button.stealable:Hide() end
+1 -8
View File
@@ -52,18 +52,12 @@ end
function UF:Construct_AuraIcon(button) function UF:Construct_AuraIcon(button)
local offset = UF.thinBorders and E.mult or E.Border local offset = UF.thinBorders and E.mult or E.Border
button.text = button.cd:CreateFontString(nil, "OVERLAY") button.text = button:CreateFontString(nil, "OVERLAY")
E:Point(button.text, "CENTER", 1, 1) E:Point(button.text, "CENTER", 1, 1)
button.text:SetJustifyH("CENTER") button.text:SetJustifyH("CENTER")
E:SetTemplate(button, "Default", nil, nil, UF.thinBorders, true) E:SetTemplate(button, "Default", nil, nil, UF.thinBorders, true)
button.cd.noOCC = true
button.cd.noCooldownCount = true
-- button.cd:SetReverse(true)
-- button.cd:SetDrawEdge(true)
E:SetInside(button.cd, button, offset, offset)
E:SetInside(button.icon, button, offset, offset) E:SetInside(button.icon, button, offset, offset)
button.icon:SetTexCoord(unpack(E.TexCoords)) button.icon:SetTexCoord(unpack(E.TexCoords))
button.icon:SetDrawLayer("ARTWORK") button.icon:SetDrawLayer("ARTWORK")
@@ -73,7 +67,6 @@ function UF:Construct_AuraIcon(button)
button.count:SetJustifyH("RIGHT") button.count:SetJustifyH("RIGHT")
button.overlay:SetTexture(nil) button.overlay:SetTexture(nil)
-- button.stealable:SetTexture(nil)
button:RegisterForClicks("RightButtonUp") button:RegisterForClicks("RightButtonUp")
button:SetScript("OnClick", function(self) button:SetScript("OnClick", function(self)