diff --git a/MythicPlusDrop/Libs/AceDB-3.0/AceDB-3.0.lua b/MythicPlusDrop/Libs/AceDB-3.0/AceDB-3.0.lua index e9c98c1..a0a8936 100644 --- a/MythicPlusDrop/Libs/AceDB-3.0/AceDB-3.0.lua +++ b/MythicPlusDrop/Libs/AceDB-3.0/AceDB-3.0.lua @@ -41,7 +41,7 @@ -- @class file -- @name AceDB-3.0.lua -- @release $Id$ -local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 29 +local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 30 local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) if not AceDB then return end -- No upgrade needed @@ -525,6 +525,17 @@ function DBObjectLib:DeleteProfile(name, silent) end end + -- remove from unloaded namespaces + if self.sv.namespaces then + for nsname, data in pairs(self.sv.namespaces) do + if self.children and self.children[nsname] then + -- already a mapped namespace + elseif data.profiles then + data.profiles[name] = nil + end + 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 @@ -570,6 +581,20 @@ function DBObjectLib:CopyProfile(name, silent) end end + -- copy unloaded namespaces + if self.sv.namespaces then + for nsname, data in pairs(self.sv.namespaces) do + if self.children and self.children[nsname] then + -- already a mapped namespace + elseif data.profiles then + -- reset the current profile + data.profiles[self.keys.profile] = {} + -- copy data + copyTable(data.profiles[name], data.profiles[self.keys.profile]) + end + end + end + -- Callback: OnProfileCopied, database, sourceProfileKey self.callbacks:Fire("OnProfileCopied", self, name) end @@ -596,6 +621,18 @@ function DBObjectLib:ResetProfile(noChildren, noCallbacks) end end + -- reset unloaded namespaces + if self.sv.namespaces and not noChildren then + for nsname, data in pairs(self.sv.namespaces) do + if self.children and self.children[nsname] then + -- already a mapped namespace + elseif data.profiles then + -- reset the current profile + data.profiles[self.keys.profile] = nil + end + end + end + -- Callback: OnProfileReset, database if not noCallbacks then self.callbacks:Fire("OnProfileReset", self) diff --git a/MythicPlusDrop/MythicPlusDrop.toc b/MythicPlusDrop/MythicPlusDrop.toc index 2ad2eb8..73c9e2d 100644 --- a/MythicPlusDrop/MythicPlusDrop.toc +++ b/MythicPlusDrop/MythicPlusDrop.toc @@ -1,6 +1,6 @@ ## Interface: 110002 ## Title: |cffd6266cMythicPlusDrop|r -## Version: 8.8 +## Version: 8.9 ## Notes: Info for Mythic Dungeons ## Author: BloodDragon2580 ## SavedVariables: MythicPlusDrop_Config, MythicPlusDrop_Data @@ -14,9 +14,9 @@ Core.lua Locale.lua Config.lua -ObjectiveTracker.lua -ProgressTracker.lua -Keystone.lua -Gossip.lua -Splits.lua -Schedule.lua +module\ObjectiveTracker.lua +module\ProgressTracker.lua +module\Keystone.lua +module\Gossip.lua +module\Splits.lua +module\Schedule.lua diff --git a/MythicPlusDrop/Gossip.lua b/MythicPlusDrop/module/Gossip.lua similarity index 100% rename from MythicPlusDrop/Gossip.lua rename to MythicPlusDrop/module/Gossip.lua diff --git a/MythicPlusDrop/Keystone.lua b/MythicPlusDrop/module/Keystone.lua similarity index 100% rename from MythicPlusDrop/Keystone.lua rename to MythicPlusDrop/module/Keystone.lua diff --git a/MythicPlusDrop/ObjectiveTracker.lua b/MythicPlusDrop/module/ObjectiveTracker.lua similarity index 100% rename from MythicPlusDrop/ObjectiveTracker.lua rename to MythicPlusDrop/module/ObjectiveTracker.lua diff --git a/MythicPlusDrop/ProgressTracker.lua b/MythicPlusDrop/module/ProgressTracker.lua similarity index 100% rename from MythicPlusDrop/ProgressTracker.lua rename to MythicPlusDrop/module/ProgressTracker.lua diff --git a/MythicPlusDrop/Schedule.lua b/MythicPlusDrop/module/Schedule.lua similarity index 100% rename from MythicPlusDrop/Schedule.lua rename to MythicPlusDrop/module/Schedule.lua diff --git a/MythicPlusDrop/Splits.lua b/MythicPlusDrop/module/Splits.lua similarity index 100% rename from MythicPlusDrop/Splits.lua rename to MythicPlusDrop/module/Splits.lua