Give each character its own settings profile

AceDB:New was passed true as defaultProfile, which the library resolves to the
literal profile name "Default", so profile selection fell back to a single
shared profile for every character instead of to the character key. Changing a
setting on one character changed it everywhere.

Dropping the argument restores AceDB's per-character fallback. Characters
already sitting on the shared profile are moved to their own on next login,
with the shared settings copied across so nothing is lost.
This commit is contained in:
2026-08-17 17:20:26 +02:00
parent 0b9b0c5afa
commit 2736cc0065
+15 -1
View File
@@ -39,7 +39,21 @@ CoA:RegisterEvent("ADDON_LOADED", function(_, addon)
if addon ~= AddOnName then return end
CoA:UnregisterEvent("ADDON_LOADED")
CoA.db = AceDB:New("ElvUI_CoADB", defaults, true)
CoA.db = AceDB:New("ElvUI_CoADB", defaults)
-- One-time migration: earlier versions pinned every character to a single
-- shared "Default" profile. Move each character to its own name-based
-- profile (copying over the settings it already had) the first time it logs in.
if not CoA.db.char.migratedSharedProfile then
local charProfile = CoA.db.keys.char
if CoA.db:GetCurrentProfile() == "Default" and charProfile ~= "Default" then
CoA.db:SetProfile(charProfile)
CoA.db:CopyProfile("Default", true)
end
CoA.db.char.migratedSharedProfile = true
end
CoA.db.RegisterCallback(CoA, "OnProfileChanged", "RefreshConfig")
CoA.db.RegisterCallback(CoA, "OnProfileCopied", "RefreshConfig")