From 1a467da71ad08a0a165cf904c84f774afef10d86 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Wed, 11 Apr 2007 21:57:50 +0000 Subject: [PATCH] * Added a saved-variable conveersion script due to changes in Dongle. --- PerfectRaid.lua | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/PerfectRaid.lua b/PerfectRaid.lua index d3d59ff..2bebc85 100644 --- a/PerfectRaid.lua +++ b/PerfectRaid.lua @@ -55,6 +55,43 @@ function PerfectRaid:Initialize() end utils = self.utils + + -- This is a small procedure to update the saved variables + local sv = PerfectRaidDB + + if sv and not sv.global.sv_converted then + if sv.char then + local converted = {} + for key,entry in pairs(sv.char) do + local char,server = key:match("^(.+) of (.+)$") + if char then + local new_key = ("%s - %s"):format(char, server) + converted[new_key] = entry + else + converted[key] = entry + end + end + sv.char = converted + end + + if sv.profileKeys then + local converted = {} + for ukey,pkey in pairs(sv.profileKeys) do + -- Update each user key + local char,server = ukey:match("^(.+) of (.+)$") + if char then + local new_key = ("%s - %s"):format(char, server) + converted[new_key] = pkey + else + converted[key] = entry + end + end + sv.profileKeys = converted + end + + if not sv.global then sv.global = {} end + sv.global.sv_converted = true + end end function PerfectRaid:Enable() -- 1.7.9.5