WoWInterface SVN NightWatch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 16 to Rev 15
    Reverse comparison

Rev 16 → Rev 15

NightWatch.lua
1,7 → 1,7
--
-- NightWatch
--
-- A custom spell watcher/reporter by Nightyniight of Frostmourne-US.
-- A custom spell watcher/reporter.
--
-- Inspired by "tricks message" by Intermission.
--
499,17 → 499,22
addon.db = LibStub("AceDB-3.0"):New("NightWatchDB", Default_Profile, "Default")
db = addon.db.profile
 
-- addon.db.RegisterCallback( self, "OnNewProfile", "profileChanged" ) -- OnProfileChanged seems to cover new profiles too.
addon.db.RegisterCallback( self, "OnProfileReset", "profileChanged" )
addon.db.RegisterCallback( self, "OnProfileChanged", "profileChanged" )
addon.db.RegisterCallback( self, "OnProfileCopied", "profileChanged" )
addon.db.RegisterCallback( self, "OnNewProfile", "handleProfileChanges" )
addon.db.RegisterCallback( self, "OnProfileReset", "handleProfileChanges" )
addon.db.RegisterCallback( self, "OnProfileChanged", "handleProfileChanges" )
addon.db.RegisterCallback( self, "OnProfileCopied", "handleProfileChanges" )
 
LibStub("AceConfig-3.0"):RegisterOptionsTable("NightWatch", addon:makeOptions())
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("NightWatch", "NightWatch")
addon:RegisterChatCommand("nw", "chatCommand")
addon:RegisterChatCommand("nightwatch", "chatCommand")
 
addon:profileChanged()
for i = 1, #sink do
sink[i]:SetSinkStorage(db.sinkStorage[i])
end
 
addon:dbUpgrade()
addon:resetSelected()
end
 
 
592,16 → 597,14
 
-------------------------------------------------------------------------------
 
function addon:profileChanged()
function addon:handleProfileChanges()
db = addon.db.profile
for i = 1, #sink do
sink[i]:SetSinkStorage(db.sinkStorage[i])
end addon:dbUpgrade()
addon:dbUpgrade()
addon:resetSelected()
end
 
function addon:dbUpgrade()
if db.dbVers and db.dbVers > 7 then return end -- DB Already upgraded
if db.dbVers > 7 then return end -- DB Already upgraded
 
-- Upgrade data format from previous addon versions (=<0.6)
-- (Renamed db.spell to db.spells just to torture myself.