From 3798a72a38a4ad7c4348e3eebb83e9250cfed87e Mon Sep 17 00:00:00 2001 From: Eyal Shilony Date: Thu, 16 Oct 2014 13:05:05 +0300 Subject: [PATCH] Upgrade Ace3 libraries to the latest version. --- .gitignore | 2 ++ libs/AceDB-3.0/AceDB-3.0.lua | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47a521d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.buildpath +.project \ No newline at end of file diff --git a/libs/AceDB-3.0/AceDB-3.0.lua b/libs/AceDB-3.0/AceDB-3.0.lua index c2bb775..79f4b39 100644 --- a/libs/AceDB-3.0/AceDB-3.0.lua +++ b/libs/AceDB-3.0/AceDB-3.0.lua @@ -39,8 +39,8 @@ -- end -- @class file -- @name AceDB-3.0.lua --- @release $Id: AceDB-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $ -local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 22 +-- @release $Id: AceDB-3.0.lua 1115 2014-09-21 11:52:35Z kaelten $ +local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 25 local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) if not AceDB then return end -- No upgrade needed @@ -260,9 +260,12 @@ local _, classKey = UnitClass("player") local _, raceKey = UnitRace("player") local factionKey = UnitFactionGroup("player") local factionrealmKey = factionKey .. " - " .. realmKey -local factionrealmregionKey = factionrealmKey .. " - " .. string.sub(GetCVar("realmList"), 1, 2):upper() local localeKey = GetLocale():lower() +local regionTable = { "US", "KR", "EU", "TW", "CN" } +local regionKey = _G["GetCurrentRegion"] and regionTable[GetCurrentRegion()] or string.sub(GetCVar("realmList"), 1, 2):upper() +local factionrealmregionKey = factionrealmKey .. " - " .. regionKey + -- Actual database initialization function local function initdb(sv, defaults, defaultProfile, olddb, parent) -- Generate the database keys for each section @@ -525,6 +528,15 @@ function DBObjectLib:DeleteProfile(name, silent) end end + -- switch all characters that use this profile back to the default + if self.sv.profileKeys then + for key, profile in pairs(self.sv.profileKeys) do + if profile == name then + self.sv.profileKeys[key] = nil + end + end + end + -- Callback: OnProfileDeleted, database, profileKey self.callbacks:Fire("OnProfileDeleted", self, name) end -- 1.7.9.5