/
## Title: ShinyBuffs |
## Author: Seerah |
## Notes: Skin and move your buffs/debuffs! |
## Version: 1.0.5 |
## Version: 1.1 |
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets |
## SavedVariables: ShinyBuffsDB |
## SavedVariablesPerCharacter: ShinyBuffsPCDB |
border = "SB border", |
borColor = {r = .5, g = .5, b = .5}, |
classbor = false, |
debuffTypeBor = false, |
sbar = "Solid", |
sbarColor = {r = 0, g = 1, b = 0}, |
classbar = false, |
if bor then |
bor:SetParent(btn.bg) |
bor:SetDrawLayer("OVERLAY", 1) |
bor:ClearAllPoints() |
bor:SetAllPoints(icon) |
bor:SetTexture(1,1,1,1) |
end |
-- |
btn.bar = CreateFrame("StatusBar", nil, btn.bg) |
end |
if bor then |
bor:SetAlpha(db.borAlpha) |
bor:ClearAllPoints() |
if db.debuffTypeBor then |
bor:SetAllPoints(btn.bg) |
bor:SetTexture("Interface\\Buttons\\UI-Debuff-Overlays") |
bor:SetTexCoord(0.296875, 0.5703125, 0, 0.515625) |
bor:SetAlpha(1) |
else |
bor:SetAllPoints(icon) |
bor:SetColorTexture(1,1,1,1) |
end |
end |
dur:SetFont(LSM:Fetch("font", db.font), db[svtable].dfsize, db.fstyle) |
c:SetFont(LSM:Fetch("font", db.font), db[svtable].cfsize, db.fstyle) |
if dur == 0 then |
self:SetValue(1) |
else |
if dur and val then |
if exps then |
val = exps-GetTime() |
self:SetValue(val/dur) |
end |
end |
end |
--[[local function SkinConsolidated(firstTime) |
local cb = ConsolidatedBuffs |
local dur = cb.duration |
local c = cb.count |
local icon = ConsolidatedBuffsIcon |
SkinningMachine("buffs", cb, dur, c, icon, nil, firstTime) |
CONSOLIDATED_BUFF_ROW_HEIGHT = db.buffs.size*.8 |
if firstTime then |
icon:SetTexture("Interface\\ICONS\\ACHIEVEMENT_GUILDPERK_QUICK AND DEAD") |
c:ClearAllPoints() |
c:SetPoint("CENTER") |
cb.bar:SetValue(1) |
--fix the tooltip width |
local CBTipWidth = ConsolidatedBuffsTooltip.SetWidth |
hooksecurefunc(ConsolidatedBuffsTooltip, "SetWidth", function(self) |
CBTipWidth(self, max(BuffFrame.numConsolidated*db.buffs.size, 100)) |
end) |
end |
end]] |
local OLD_SetUnitAura, NEW_SetUnitAura, caster, casterName = GameTooltip.SetUnitAura |
local function WhoCast() |
if db.whoCast then |
end) |
end |
SBmover:SetAlpha(moverShown and 1 or 0) |
SBmover:EnableMouse(moverShown and 1 or 0) |
SBmover:EnableMouse(moverShown) |
end |
local options = { |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 2, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 3, |
}, |
BUFF_DURATION_WARNING_TIME = 60 |
end |
end, |
order = 3.5, |
order = 4, |
}, |
buffFonts = { |
name = "Buff Font Sizes", |
type = "group", |
inline = true, |
order = 4, |
order = 5, |
args = { |
durSize = { |
name = "Duration", |
SkinBuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 1, |
}, |
SkinBuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 2, |
}, |
name = "Debuff Font Sizes", |
type = "group", |
inline = true, |
order = 5, |
order = 6, |
args = { |
durSize = { |
name = "Duration", |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 1, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 2, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 3, |
}, |
debuffTypeBor = { |
name = "By Debuff Type", |
desc = "Display debuff dispel type as border instead of icon overlay.", |
type = "toggle", |
width = "half", |
get = function() return db.debuffTypeBor end, |
set = function() |
db.debuffTypeBor = not db.debuffTypeBor |
for i=1,numDebuffsSkinned do |
SkinDebuffs(i,false) |
end |
end, |
order = 4, |
}, |
}, |
}, |
sbar = { |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 1, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 2, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 3, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 1, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 2, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end, |
order = 3, |
}, |
SkinBuffs(i,false) |
end |
SkinTench(false) |
SkinConsolidated(false) |
end, |
order = 1, |
}, |
SkinDebuffs(i,false) |
end |
SkinTench(false) |
--SkinConsolidated(false) |
end |
end) |
end |
LibStub("AceConfig-3.0"):RegisterOptionsTable("ShinyBuffs", options) |
SB.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("ShinyBuffs", "ShinyBuffs") |
SlashCmdList["SHINYBUFFS"] = function() InterfaceOptionsFrame_OpenToCategory("ShinyBuffs") end |
SlashCmdList["SHINYBUFFS"] = function() |
InterfaceOptionsFrame_OpenToCategory("ShinyBuffs") |
InterfaceOptionsFrame_OpenToCategory("ShinyBuffs") |
end |
SLASH_SHINYBUFFS1 = "/shinybuffs" |
SLASH_SHINYBUFFS2 = "/sb" |
SkinDebuffs(i, true) |
end |
SkinTench(true) |
--SkinConsolidated(true) |
--keep other stuff (like ticket frame) from moving buffs |
BuffFrame.NewSetPoint = BuffFrame.SetPoint |
WhoCast() |
SB:UnregisterEvent("PLAYER_ENTERING_WORLD") |
SB:RegisterEvent("UNIT_AURA") |
SB:RegisterUnitEvent("UNIT_AURA", "player") |
SB:SetScript("OnEvent", function(s,e,unit) |
if unit == "player" then |
if BUFF_ACTUAL_DISPLAY > numBuffsSkinned then |
for i = numBuffsSkinned+1, BUFF_ACTUAL_DISPLAY do |
SkinBuffs(i, true) |
end |
if BUFF_ACTUAL_DISPLAY > numBuffsSkinned then |
for i = numBuffsSkinned+1, BUFF_ACTUAL_DISPLAY do |
SkinBuffs(i, true) |
end |
if DEBUFF_ACTUAL_DISPLAY > numDebuffsSkinned then |
for i = numDebuffsSkinned+1, DEBUFF_ACTUAL_DISPLAY do |
SkinDebuffs(i, true) |
end |
end |
if DEBUFF_ACTUAL_DISPLAY > numDebuffsSkinned then |
for i = numDebuffsSkinned+1, DEBUFF_ACTUAL_DISPLAY do |
SkinDebuffs(i, true) |
end |
--don't bother checking if they're all skinned |
if numBuffsSkinned == BUFF_MAX_DISPLAY and numDebuffsSkinned == DEBUFF_MAX_DISPLAY then |
SB:UnregisterEvent("UNIT_AURA") |
SB:SetScript("OnEvent", nil) |
end |
end |
--don't bother checking if they're all skinned |
if numBuffsSkinned == BUFF_MAX_DISPLAY and numDebuffsSkinned == DEBUFF_MAX_DISPLAY then |
SB:UnregisterEvent("UNIT_AURA") |
SB:SetScript("OnEvent", nil) |
end |
end) |
PEW = nil |
end |