WoWInterface SVN DotIt

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 19 to Rev 18
    Reverse comparison

Rev 19 → Rev 18

trunk/DotIt/DotIT.toc
14,4 → 14,3
modules\modules.xml
config.lua
cooldowns.lua
bossmods.lua
trunk/DotIt/core.lua
1,4 → 1,4
DotIt = LibStub("AceAddon-3.0"):NewAddon("DotIT-0.1", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0")
DotIt = LibStub("AceAddon-3.0"):NewAddon("DotIT-0.1", "AceEvent-3.0")
 
local sb = LibStub:GetLibrary("SBar-0.1")
local cps = 0
49,49 → 49,39
if flag then return i end
end
end
 
local function getBarPos(uid, typ)
local init = 0
if DotIt.db.profile.eshortbuffs then
if typ == "Shortbuffs" then
return init
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
end
init = init + 1
end
if DotIt.db.profile.ecooldowns then
if typ == "Cooldowns" or typ == "ItemCooldowns" then
return init
else
local init = 0
if DotIt.db.profile.eshortbuffs then
init = init + 1
end
end
if DotIt.db.profile.einternalcooldowns then
if typ == "InternalCooldowns" then
return init
if DotIt.db.profile.ecooldowns or DotIt.db.profile.ein then
init = init + 1
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
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
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
119,7 → 109,7
 
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)
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)
end
end
 
150,9 → 140,9
 
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)
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)
else
sb:CreateBar(deepCopy(infocd), dur, 0, nil, select(3, GetSpellInfo(itemid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture)
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)
end
end
del(infocd)
213,9 → 203,9
 
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)
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)
else
sb:CreateBar(deepCopy(infocd), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(infocd.dguid, infocd.typ), color, colorzero, DotIt.db.profile.bartexture)
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)
end
end
del(infocd)
295,7 → 285,7
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)
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)
end
end
end
341,7 → 331,7
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)
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)
end
deepDel(info)
info = nil
358,7 → 348,7
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)
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)
end
-- ic end
elseif event == "SPELL_AURA_REMOVED" and (dguid == UnitGUID("player") or dguid == UnitGUID("pet")) then
403,7 → 393,7
 
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)
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)
if not self.db.profile.owndots then
sb:SetFixedText(dname, getBarPos(info.dguid, info.typ))
end
trunk/DotIt/libs.xml
11,7 → 11,6
<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>
\ No newline at end of file
trunk/DotIt/bossmods.lua
1,57 → 1,24
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 ctab = {
[1] = {r = 1, g = 0, b = 0, a = 0.25},
[2] = {r = 0, g = 1, b = 0, a = 0.25},
[3] = {r = 0, g = 0, b = 1, a = 0.25},
[4] = {r = 1, g = 1, b = 1, a = 0.25},
[5] = {r = 205/255, g = 127/255, b = 50/255, a = 0.25 },
[6] = {r = 0, g = 100/255, b = 0, a = 0.25 },
[7] = {r = 1, g = 20/255, b = 147/255, a = 0.25 },
[8] = {r = 1, g = 1, b = 0, a = 0.25},
}
 
local count = 0
local function getColor()
count = count + 1
if count > #ctab then count = 1 end
return ctab[count]
end
function DotIt:removeColor()
count = count - 1
end
local function dbmHook(self, timer, id, icon, huge, small, color)
if DotIt.db.profile.ebossmods then
local color = getColor()
if string.find(id, "dummy") then return end -- should prevent this strange behavior
DotIt.sb:CreateBar(id, timer, 0, id, icon, 1, deepCopy(color), deepCopy(color), DotIt.db.profile.bartexture, function() DotIt:removeColor() end)
end
end
local function bigwigs(self, id, dur, icon)
if DotIt.db.profile.ebossmods then
local color = getColor()
DotIt.sb:CreateBar(id, dur, 0, id, icon, 1, deepCopy(color), deepCopy(color), DotIt.db.profile.bartexture, function() DotIt:removeColor() end)
end
end
function DotIt:ADDON_LOADED(self, addon)
if addon == "BigWigs_Plugins" then
DotIt:ScheduleTimer(function() BigWigs:ToggleModuleActive("Bars", false) end, 2)
end
end
local function setupHooks()
-- dbm hook
if IsAddOnLoaded("DBM-Core") then
DotIt:Hook(DBM.Bars, "CreateBar", function(...) dbmHook(...) end)
elseif IsAddOnLoaded("BigWigs") then
AceLibrary("AceEvent-2.0"):RegisterEvent("BigWigs_StartBar", bigwigs)
end
end
 
function bossmods:OnInitialize()
if not DotIt.db.profile.ebossmods then return end
setupHooks()
end
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
\ No newline at end of file
trunk/DotIt/libs/sbar.lua
1,4 → 1,4
local major = "SBar-0.1"
local major = "SBar-0.1"
local minor = 1
local DEBUG = true
local tinsert = table.insert
668,7 → 668,7
maintexture:SetWidth(f:GetWidth())
return f
end
local function createVerticalBar(data, duration, start, barheight, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture, onhide)
local function createVerticalBar(data, duration, start, barheight, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture)
local tmptime
if not scaleinfo.frame:IsShown() then
scaleinfo.frame:Show()
708,20 → 708,11
for ch in string.gmatch(string.upper(text), ".") do
-- first element
local fobj = barf:CreateFontString()
setFont(fobj)
setFont(font)
barfon[count] = fobj
fobj:SetText(ch)
if count == 0 then
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
fobj:SetPoint("TOPLEFT", barf, "TOPLEFT", barf:GetWidth()/2 - fobj:GetStringWidth()/2 , -1*scaleinfo.height - 5)
else
fobj:SetPoint("TOPLEFT", barfon[count-1], "BOTTOMLEFT", 0, 0)
end
788,16 → 779,10
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, onhide)
local function createHorizontalBar(data, duration, start, barwidth, maxtime, text, icon, pos, color, colorzero, maxneg, loflag, texture)
--
local tmptime
if not scaleinfo.frame:IsShown() then
836,7 → 821,7
local barfon = barf:CreateFontString()
setFont(barfon)
barfon:SetText(text)
barfon:SetPoint("CENTER", barf, "CENTER")
barfon:SetPoint("BOTTOMRIGHT", barf, "BOTTOMRIGHT", -1 * scaleinfo.height - 5 , scaleinfo.height/2 - barfon:GetStringWidth()/2)
-- normal texture
local bart = barf:CreateTexture(nil, "BACKGROUND")
bart:SetTexture(texture or default.texture)
893,17 → 878,9
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
 
1014,7 → 991,7
-- @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, onhide)
function sbar:CreateBar(data, duration, start, text, icon, pos, color, colorzero, texture)
argcheck(duration, 2, "number")
argcheck(start, 3, "number")
argcheck(text, 4, "string", "nil")
1023,12 → 1000,11
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, onhide)
createHorizontalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture)
else
createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture, onhide)
createVerticalBar(data, duration, start, scaleinfo.size, scaleinfo.maxtime, text, icon, pos, color, colorzero, scaleinfo.maxneg, scaleinfo.loflag, texture)
end
self:UpdateFrameLevel()
end
trunk/DotIt/config.lua
245,10 → 245,6
desc = "Shared debuffs are things that can be refreshed from other people (eg Sunder Armor)",
type = "toggle",
},
bossmods = {
name = "Enable bossmods",
type = "toggle",
},
},
},
additionalscale = {
948,7 → 944,6
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,
trunk/DotIt Property changes : Modified: svn:externals - libs/AceAddon-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0 libs/AceTimer-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceTimer-3.0 libs/AceConfig-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0 libs/AceDB-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0 libs/AceDBOptions-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDBOptions-3.0 libs/AceEvent-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceEvent-3.0 libs/AceGUI-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0 libs/AceLocale-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceLocale-3.0 libs/AceHook-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceHook-3.0 libs/AceGUI-3.0-SharedMediaWidgets svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk libs/CallbackHandler-1.0 svn://svn.wowace.com/wow/callbackhandler/mainline/trunk/CallbackHandler-1.0 libs/LibSharedMedia-3.0 svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk/LibSharedMedia-3.0 libs/LibStub svn://svn.wowace.com/wow/libstub/mainline/trunk + libs/AceAddon-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0 libs/AceConfig-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfig-3.0 libs/AceDB-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0 libs/AceDBOptions-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDBOptions-3.0 libs/AceEvent-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceEvent-3.0 libs/AceGUI-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0 libs/AceLocale-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceLocale-3.0 libs/AceHook-3.0 svn://svn.wowace.com/wow/ace3/mainline/trunk/AceHook-3.0 libs/AceGUI-3.0-SharedMediaWidgets svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk libs/CallbackHandler-1.0 svn://svn.wowace.com/wow/callbackhandler/mainline/trunk/CallbackHandler-1.0 libs/LibSharedMedia-3.0 svn://svn.wowace.com/wow/libsharedmedia-3-0/mainline/trunk/LibSharedMedia-3.0 libs/LibStub svn://svn.wowace.com/wow/libstub/mainline/trunk