/
desc = "Shared debuffs are things that can be refreshed from other people (eg Sunder Armor)", |
type = "toggle", |
}, |
bossmods = { |
name = "Enable bossmods", |
type = "toggle", |
}, |
}, |
}, |
additionalscale = { |
local db = newList() |
db.defaults = newList() |
db.defaults.profile = { |
ebossmods = true, |
amaxtimes = {}, eiconpos = false, ehidescale = false, |
owndots = false, scaletext = true, edots = true, edebuffs = true, |
eccs = true, eshortbuffs = true, |
modules\modules.xml |
config.lua |
cooldowns.lua |
bossmods.lua |
DotIt = LibStub("AceAddon-3.0"):NewAddon("DotIT-0.1", "AceEvent-3.0") |
DotIt = LibStub("AceAddon-3.0"):NewAddon("DotIT-0.1", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0") |
local sb = LibStub:GetLibrary("SBar-0.1") |
local cps = 0 |
if flag then return i end |
end |
end |
local function getBarPos(uid, typ) |
if typ == "Shortbuffs" then |
return 0 |
elseif typ == "Cooldowns" or typ == "ItemCooldowns" or typ == "InternalCooldowns" then |
if DotIt.db.profile.ecooldowns then |
return 1 |
elseif DotIt.db.profile.eitemcooldowns then |
return 1 |
else |
return 0 |
local init = 0 |
if DotIt.db.profile.eshortbuffs then |
if typ == "Shortbuffs" then |
return init |
end |
else |
local init = 0 |
if DotIt.db.profile.eshortbuffs then |
init = init + 1 |
init = init + 1 |
end |
if DotIt.db.profile.ecooldowns then |
if typ == "Cooldowns" or typ == "ItemCooldowns" then |
return init |
end |
if DotIt.db.profile.ecooldowns or DotIt.db.profile.ein then |
init = init + 1 |
end |
if DotIt.db.profile.einternalcooldowns then |
if typ == "InternalCooldowns" then |
return init |
end |
local bars = sb:GetBars() |
if not bars then return init end |
local maxpos = init |
local prv = init |
for _, bar in pairs(bars) do |
if bar.data then |
if bar.data.dguid == uid then |
return bar.pos |
end |
end |
if DotIt.db.profile.ecooldowns or DotIt.db.profile.einternalcooldowns or DotIt.db.profile.eitemcooldowns then |
init = init + 1 |
end |
if DotIt.db.profile.ebossmods then |
if typ == "Bossmods" then return init end |
init = init + 1 |
end |
local bars = sb:GetBars() |
if not bars then return init end |
local maxpos = init |
local prv = init |
for _, bar in pairs(bars) do |
if bar.data then |
if bar.data.dguid == uid then |
return bar.pos |
end |
end |
return findFirstEmptyBar(init) |
end |
return findFirstEmptyBar(init) |
end |
function DotIt:GetBarPos(uid, typ) |
getBarPos(uid, typ) |
end |
local function isBarActive(info) |
local bars = sb:GetBars() |
if not bars then return end |
if not dur then return end |
if info and info.typ and not isBarActive(info) then |
sb:CreateBar(info, dur, 0, nil, select(3, GetSpellInfo(info.spellid)), getBarPos(info.dguid, info.typ), color, colorzero, DotIt.db.profile.bartexture, DotIt.db.profile.scale, DotIt.db.profile.fonts) |
sb:CreateBar(info, dur, 0, nil, select(3, GetSpellInfo(info.spellid)), getBarPos(info.dguid, info.typ), color, colorzero, DotIt.db.profile.bartexture) |
end |
end |
if not isBarActive(infocd) and getBarPos(infocd.dguid, infocd.typ) then |
if dur == 0 then |
sb:CreateBar(deepCopy(infocd), duration, 0, nil, select(3, GetSpellInfo(itemid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture, DotIt.db.profile.scale, DotIt.db.profile.fonts) |
sb:CreateBar(deepCopy(infocd), duration, 0, nil, select(3, GetSpellInfo(itemid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture) |
else |
sb:CreateBar(deepCopy(infocd), dur, 0, nil, select(3, GetSpellInfo(itemid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture, DotIt.db.profile.scale, DotIt.db.profile.fonts) |
sb:CreateBar(deepCopy(infocd), dur, 0, nil, select(3, GetSpellInfo(itemid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture) |
end |
end |
del(infocd) |
if not isBarActive(infocd) and getBarPos(infocd.dguid, infocd.typ) then |
if dur == 0 then |
sb:CreateBar(deepCopy(infocd), duration, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture, DotIt.db.profile.scale, DotIt.db.profile.fonts) |
sb:CreateBar(deepCopy(infocd), duration, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture) |
else |
sb:CreateBar(deepCopy(infocd), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture, DotIt.db.profile.scale, DotIt.db.profile.fonts) |
sb:CreateBar(deepCopy(infocd), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture) |
end |
end |
del(infocd) |
color.a = (application / appl) * (color.a or 1) |
if (not isBarActive(info)) and getBarPos(info.dguid, info.typ) then |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, DotIt.db.profile.bartexture, DotIt.db.profile.scale, DotIt.db.profile.fonts) |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, DotIt.db.profile.bartexture) |
end |
end |
end |
end |
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then |
sb:CreateBar(deepCopy(info), tonumber(dur), 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture, self.db.profile.scale, self.db.profile.fonts) |
sb:CreateBar(deepCopy(info), tonumber(dur), 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture) |
end |
deepDel(info) |
info = nil |
color.a = (1/appl) * (color.a or 1) |
end |
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture, self.db.profile.scale, self.db.profile.fonts) |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture) |
end |
-- ic end |
elseif event == "SPELL_AURA_REMOVED" and (dguid == UnitGUID("player") or dguid == UnitGUID("pet")) then |
if not colorzero then colorzero = deepCopy(color); colorzero.a = 0.1 end |
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture, self.db.profile.scale, self.db.profile.fonts) |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture) |
if not self.db.profile.owndots then |
sb:SetFixedText(dname, getBarPos(info.dguid, info.typ)) |
end |
<Include file="libs\AceLocale-3.0\AceLocale-3.0.xml"/> |
<Include file="libs\LibSharedMedia-3.0\LibSharedMedia-3.0.lua"/> |
<Include file="libs\AceHook-3.0\AceHook-3.0.xml"/> |
<Include file="libs\AceTimer-3.0\AceTimer-3.0.xml"/> |
<Include file="libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/> |
<script file="libs\sbar.lua"/> |
</Ui> |
if not DotIt then |
error("DotIt has to be loaded first") |
end |
local newList, del, deepDel, deepCopy = DotIt.sb:GetRecyclingFunctions() |
local bossmods = DotIt:NewModule("bossmods") |
local function DotIt:BigWigs_StartBar(msg, self, text, length, icon) |
end |
local function dbmhook(timer, id, icon, huge, small, color) |
DEFAULT_CHAT_FRAME:AddMessage(timer) |
DEFAULT_CHAT_FRAME:AddMessage(id) |
end |
local function setupHooks() |
-- dbm hook |
if IsAddonLoaded("Deadly Bossmods") then |
DotIt:Hook(DBT, "CreateBar", function(...) dbmHook(...) end) |
elseif IsAddonLoaded("BigWigs") then |
DotIt:RegisterEvent("BigWigs_StartBar") |
end |
end |
function bossmods:OnInitialize() |
setupHooks() |
end |
local major = "SBar-0.1" |
local major = "SBar-0.1" |
local minor = 1 |
local DEBUG = true |
local tinsert = table.insert |
maintexture:SetWidth(f:GetWidth()) |
return f |
end |
local function createVerticalBar(data, duration, start, barheight, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture) |
local function createVerticalBar(data, duration, start, barheight, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture, onhide) |
local tmptime |
if not scaleinfo.frame:IsShown() then |
scaleinfo.frame:Show() |
for ch in string.gmatch(string.upper(text), ".") do |
-- first element |
local fobj = barf:CreateFontString() |
setFont(font) |
setFont(fobj) |
barfon[count] = fobj |
fobj:SetText(ch) |
if count == 0 then |
fobj:SetPoint("TOPLEFT", barf, "TOPLEFT", barf:GetWidth()/2 - fobj:GetStringWidth()/2 , -1*scaleinfo.height - 5) |
fobj:SetPoint("CENTER", barf, "CENTER") |
if not icon then |
fobj:SetPoint("TOP", barf, "TOP", 0, -1) |
else |
if scaleinfo.iconpos then |
fobj:SetPoint("TOP", barf, "TOP", 0, -1 - scaleinfo.height) |
else |
fobj:SetPoint("TOP", barf, "TOP", 0, -1) |
end |
end |
else |
fobj:SetPoint("TOPLEFT", barfon[count-1], "BOTTOMLEFT", 0, 0) |
end |
else |
baric:SetPoint("TOPRIGHT", barf, "TOPRIGHT", 0, 0) |
end |
if not icon then |
end |
if onhide then |
barf:SetScript("OnHide", onhide) |
end |
tinsert(bars, { data = data, frame = barf, tex = bart, texg = bartg, dur = duration, start = start, pos = pos, text = barfon, icon = baric } ) |
end |
-- |
local function createHorizontalBar(data, duration, start, barwidth, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture) |
local function createHorizontalBar(data, duration, start, barwidth, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture, onhide) |
-- |
local tmptime |
if not scaleinfo.frame:IsShown() then |
local barfon = barf:CreateFontString() |
setFont(barfon) |
barfon:SetText(text) |
barfon:SetPoint("BOTTOMRIGHT", barf, "BOTTOMRIGHT", -1 * scaleinfo.height - 5 , scaleinfo.height/2 - barfon:GetStringWidth()/2) |
barfon:SetPoint("CENTER", barf, "CENTER") |
-- normal texture |
local bart = barf:CreateTexture(nil, "BACKGROUND") |
bart:SetTexture(texture or default.texture) |
baric:SetWidth(scaleinfo.height) |
if scaleinfo.iconpos then |
baric:SetPoint("TOPRIGHT", barf, "TOPRIGHT", baric:GetWidth(), 0) |
barfon:SetPoint("RIGHT", barf, "RIGHT", -1) |
else |
baric:SetPoint("TOPRIGHT", barf, "TOPRIGHT", 0, 0) |
barfon:SetPoint("RIGHT", barf, "RIGHT", -1*scaleinfo.height, 0 ) |
end |
if not icon then |
barfon:SetPoint("RIGHT", barf, "RIGHT", -1) |
end |
if onhide then |
barf:SetScript("OnHide", onhide) |
end |
tinsert(bars, { data = data, frame = barf, tex = bart, texg = bartg, dur = duration, start = start, pos = pos, text = barfon, icon = baric } ) |
end |
-- @param color The color for the positive side of the bar (color_def). |
-- @param colorzero The color for the negative side of the bar (color_def). |
-- @see color_def |
function sbar:CreateBar(data, duration, start, text, icon, pos, color, colorzero, texture) |
function sbar:CreateBar(data, duration, start, text, icon, pos, color, colorzero, texture, onhide) |
argcheck(duration, 2, "number") |
argcheck(start, 3, "number") |
argcheck(text, 4, "string", "nil") |
argcheck(color, 7, "table") |
argcheck(colorzero, 8, "table") |
argcheck(texture, 9, "string", "nil") |
argcheck(onhide, 10, "function", "nil") |
local scale |
if scaleinfo.horizontal then |
createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture) |
createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide) |
else |
createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture) |
createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide) |
end |
self:UpdateFrameLevel() |
end |