Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Jun 8, 2019
0 parents commit 7b61cbd
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Libs/
15 changes: 15 additions & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package-as: oUF_ClassicAuraDurations

enable-nolib-creation: no

manual-changelog:
filename: CHANGELOG
markup-type: markdown

externals:
Libs/LibStub: svn://svn.wowace.com/wow/libstub/mainline/tags/1.0
Libs/CallbackHandler-1.0: https://repos.wowace.com/wow/ace3/trunk/CallbackHandler-1.0
Libs/LibClassicDurations:
url: https://github.com/rgd87/LibClassicDurations.git
tag: master

12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: minimal

script: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash

branches:
only:
- /^\d+\.\d+(\.\d+)?(-\S*)?$/

notifications:
email:
on_success: never
on_failure: always
Empty file added CHANGELOG
Empty file.
50 changes: 50 additions & 0 deletions oUF_ClassicAuraDurations.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local addonName, ns = ...
local oUF = ns.oUF or oUF

local LibClassicDurations = LibStub("LibClassicDurations")
LibClassicDurations:RegisterFrame(addonName)

local LCDWrapper = function(element, unit, button, index, position, duration, expiration, debuffType, isStealable)
if duration == 0 then
-- PostUpdateIcon doesn't pass spellID, so have to call UnitAura again for it
local name, _, _, _, _, _, caster, _, _, spellID = UnitAura(unit, index, button.filter)
local durationNew, expirationTimeNew = LibClassicDurations:GetAuraDurationByUnit(unit, spellID, caster)
if durationNew and durationNew > 0 then
duration = durationNew
expiration = expirationTimeNew

if(button.cd and not element.disableCooldown) then
button.cd:SetCooldown(expiration - duration, duration)
button.cd:Show()
end
end
end

local originalPostUpdateIcon = element.PostUpdateIcon_cHcTXm3
if originalPostUpdateIcon then
originalPostUpdateIcon(element, unit, button, index, position, duration, expiration, debuffType, isStealable)
end
end

local function prehook_PostUpdateIcon(element)
element.PostUpdateIcon_cHcTXm3 = element.PostUpdateIcon
element.PostUpdateIcon = LCDWrapper
end

local function hook(frame)
frame.SmoothBar = SmoothBar
if frame.Buffs then
if frame.Buffs.PostUpdateIcon then
prehook_PostUpdateIcon(frame.Buffs)
end
end
if frame.Debuffs then
if frame.Debuffs.PostUpdateIcon then
prehook_PostUpdateIcon(frame.Debuffs)
end
end
end


for i, frame in ipairs(oUF.objects) do hook(frame) end
oUF:RegisterInitCallback(hook)
13 changes: 13 additions & 0 deletions oUF_ClassicAuraDurations.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Interface: 11302
## Title: oUF_ClassicAuraDurations
## Notes: LibClassicDurations hook for oUF
## X-Category: UnitFrame
## Dependencies: oUF
## DefaultState: enabled
## X-oUF: oUF

Libs\LibStub\LibStub.lua
Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
Libs\LibClassicDurations\LibClassicDurations.xml

oUF_ClassicAuraDurations.lua

0 comments on commit 7b61cbd

Please sign in to comment.