WoWInterface SVN NightWatch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 9 to Rev 10
    Reverse comparison

Rev 9 → Rev 10

NightWatch.lua
29,13 → 29,14
local GetNumPartyMembers = GetNumPartyMembers
local InCombatLockdown = InCombatLockdown
 
local version = GetAddOnMetadata("NightWatch", "Version")
local addonVersion = GetAddOnMetadata("NightWatch", "Version")
local dbVers = 8
 
local playerName = UnitName("player")
local firstEnable = true
 
local db
local clipboard = {}
 
local sink = {}
local i
 
122,7 → 123,7
 
function addon:makeOptions()
local opts = {
name = "NightWatch " .. version,
name = "NightWatch " .. addonVersion,
type = "group",
handler = addon,
-- inline = false,
554,7 → 555,7
local whisperTarget
function addon:combatLogEvent(_, _, flag, _, source, _, _, target, _, _, spell, ...)
 
if not db.spells[spell] then return end -- Spell not in database, quit
if not db.spells[spell] then return end -- Spell not in database, quit
 
local ws = db.spells[spell]
 
604,35 → 605,30
end
 
function addon:upgrade()
-- Remove obsolete sink data from previous versions (=<0.7)
if db.sinkStorage1 then
db.sinkStorage1 = nil
 
-- Upgrade data format from previous addon versions (=<0.6)
-- (Renamed db.spell to db.spells just to torture myself.
-- Also moved away from AceDB's magic ['*'] feature since it was
-- auto-creating spells everty time I checked the spell was in the db.
-- Sigh.)
if db.spell then
Print("Upgrading database")
db.spells = addon:deepcopy(db.spell) -- Quick and dirty ...
db.spell = nil
db.selected = nil
Print("Upgrade complete")
end
if db.sinkStorage2 then
db.sinkStorage2 = nil
end
if db.sinkStorage3 then
db.sinkStorage3 = nil
end
if db.sinkStorage4 then
db.sinkStorage4 = nil
end
 
-- Upgrade data format from previous versions (=<0.6)
if not db.spell then return end
Print("Upgrading database")
local keys = { chat = true, chatTarget = true, whisper = true, whisperTarget = true }
db.spells = addon:deepcopy(db.spell)
for k,_ in pairs(db.spell) do
Print(" Importing: " .. k)
for key,_ in pairs(keys) do
if not db.spell[k].msgFormat[key] then
db.spells[k].msgFormat[key] = addon:deepcopy(db.customMsgFormat[key])
end
 
-- Remove obsolete sink data from previous addon versions (=<0.7)
for i = 1, 4 do
if db["sinkStorage" .. i] then
db.sinkStorage[i] = db["sinkStorage" .. i]
db["sinkStorage" .. i] = nil
end
end
db.spell = nil
db.selected = nil
 
db.dbVers = dbVers
 
end
 
function addon:resetSelected()