WoWInterface SVN NightWatch

Compare Revisions

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

Rev 15 → Rev 16

NightWatch.lua
1,7 → 1,7
--
-- NightWatch
--
-- A custom spell watcher/reporter.
-- A custom spell watcher/reporter by Nightyniight of Frostmourne-US.
--
-- Inspired by "tricks message" by Intermission.
--
499,22 → 499,17
addon.db = LibStub("AceDB-3.0"):New("NightWatchDB", Default_Profile, "Default")
db = addon.db.profile
 
addon.db.RegisterCallback( self, "OnNewProfile", "handleProfileChanges" )
addon.db.RegisterCallback( self, "OnProfileReset", "handleProfileChanges" )
addon.db.RegisterCallback( self, "OnProfileChanged", "handleProfileChanges" )
addon.db.RegisterCallback( self, "OnProfileCopied", "handleProfileChanges" )
-- 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" )
 
LibStub("AceConfig-3.0"):RegisterOptionsTable("NightWatch", addon:makeOptions())
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("NightWatch", "NightWatch")
addon:RegisterChatCommand("nw", "chatCommand")
addon:RegisterChatCommand("nightwatch", "chatCommand")
 
for i = 1, #sink do
sink[i]:SetSinkStorage(db.sinkStorage[i])
end
 
addon:dbUpgrade()
addon:resetSelected()
addon:profileChanged()
end
 
 
597,14 → 592,16
 
-------------------------------------------------------------------------------
 
function addon:handleProfileChanges()
function addon:profileChanged()
db = addon.db.profile
addon:dbUpgrade()
for i = 1, #sink do
sink[i]:SetSinkStorage(db.sinkStorage[i])
end addon:dbUpgrade()
addon:resetSelected()
end
 
function addon:dbUpgrade()
if db.dbVers > 7 then return end -- DB Already upgraded
if db.dbVers and 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.