Verified Commit 15ed20dc authored by Merathilis's avatar Merathilis
Browse files

Update LibButtonGlow

parent 892738fa
--[[
Copyright (c) 2015-2017, Hendrik "nevcairiel" Leppkes <h.leppkes@gmail.com>
Copyright (c) 2015-2020, Hendrik "nevcairiel" Leppkes <h.leppkes@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the developer nor the names of its contributors
may be used to endorse or promote products derived from this software without
* Neither the name of the developer nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
......@@ -28,7 +28,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
local MAJOR_VERSION = "LibButtonGlow-1.0"
local MINOR_VERSION = 6
local MINOR_VERSION = 7
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
......@@ -56,6 +56,18 @@ local function OverlayGlow_OnHide(self)
end
end
local function OverlayGlow_OnUpdate(self, elapsed)
AnimateTexCoords(self.ants, 256, 256, 48, 48, 22, elapsed, 0.01)
local cooldown = self:GetParent().cooldown
-- we need some threshold to avoid dimming the glow during the gdc
-- (using 1500 exactly seems risky, what if casting speed is slowed or something?)
if cooldown and cooldown:IsShown() and cooldown:GetCooldownDuration() > 3000 then
self:SetAlpha(0.5)
else
self:SetAlpha(1.0)
end
end
local function CreateScaleAnim(group, target, order, duration, x, y, delay)
local scale = group:CreateAnimation("Scale")
scale:SetTarget(target:GetName())
......@@ -185,7 +197,7 @@ local function CreateOverlayGlow()
overlay.animOut:SetScript("OnFinished", OverlayGlowAnimOutFinished)
-- scripts
overlay:SetScript("OnUpdate", ActionButton_OverlayGlowOnUpdate)
overlay:SetScript("OnUpdate", OverlayGlow_OnUpdate)
overlay:SetScript("OnHide", OverlayGlow_OnHide)
overlay.__LBGVersion = MINOR_VERSION
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment