/trunk/Libs
--[[ $Id: CallbackHandler-1.0.lua 14 2010-08-09 00:43:38Z mikk $ ]] |
--[[ $Id: CallbackHandler-1.0.lua 965 2010-08-09 00:47:52Z mikk $ ]] |
local MAJOR, MINOR = "CallbackHandler-1.0", 6 |
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) |
-- make into AceTimer. |
-- @class file |
-- @name AceTimer-3.0 |
-- @release $Id: AceTimer-3.0.lua 895 2009-12-06 16:28:55Z nevcairiel $ |
-- @release $Id: AceTimer-3.0.lua 1037 2011-09-02 16:24:08Z mikk $ |
--[[ |
Basic assumptions: |
- ALLOWS unscheduling ANY timer (including the current running one) at any time, including during OnUpdate processing |
]] |
local MAJOR, MINOR = "AceTimer-3.0", 5 |
local MAJOR, MINOR = "AceTimer-3.0", 6 |
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceTimer then return end -- No upgrade needed |
-- Time to clean it out? |
local list = selfs[self] |
if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (max!). For one 'self'. |
if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (worst case!). For one 'self'. |
return |
end |
local n=0 |
for k,v in pairs(list) do |
newlist[k] = v |
n=n+1 |
if type(v)=="table" and v.callback then -- if the timer is actually live: count it |
n=n+1 |
end |
end |
newlist.__ops = 0 -- Reset operation count |
AceTimer.frame:SetScript("OnEvent", OnEvent) |
AceTimer.frame:RegisterEvent("PLAYER_REGEN_ENABLED") |
-- In theory, we should hide&show the frame based on there being timers or not. |
-- In theory, we could hide&show the frame based on there being timers or not. |
-- However, this job is fairly expensive, and the chance that there will |
-- actually be zero timers running is diminuitive to say the lest. |
-- actually be zero timers running is diminuitive to say the least. |
ScrollFrame Container |
Plain container that scrolls its content and doesn't grow in height. |
-------------------------------------------------------------------------------]] |
local Type, Version = "ScrollFrame", 21 |
local Type, Version = "ScrollFrame", 22 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local methods = { |
["OnAcquire"] = function(self) |
self:SetScroll(0) |
self:FixScroll() |
end, |
["OnRelease"] = function(self) |
Button Widget |
Graphical Button. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Button", 21 |
local Type, Version = "Button", 22 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local _G = _G |
local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent |
local wowMoP |
do |
local _, _, _, interface = GetBuildInfo() |
wowMoP = (interface >= 50000) |
end |
--[[----------------------------------------------------------------------------- |
Scripts |
-------------------------------------------------------------------------------]] |
-------------------------------------------------------------------------------]] |
local function Constructor() |
local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type) |
local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate2") |
local frame = CreateFrame("Button", name, UIParent, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2") |
frame:Hide() |
frame:EnableMouse(true) |
TreeGroup Container |
Container that uses a tree control to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TreeGroup", 33 |
local Type, Version = "TreeGroup", 34 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-- Lua APIs |
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type |
local math_min, math_max, floor = math.min, math.max, floor |
local select, tremove, unpack = select, table.remove, unpack |
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat |
-- WoW APIs |
local CreateFrame, UIParent = CreateFrame, UIParent |
end |
end, |
["RefreshTree"] = function(self) |
["RefreshTree"] = function(self,scrollToSelection) |
local buttons = self.buttons |
local lines = self.lines |
local tree = self.tree |
local treeframe = self.treeframe |
status.scrollToSelection = status.scrollToSelection or scrollToSelection -- needs to be cached in case the control hasn't been drawn yet (code bails out below) |
self:BuildLevel(tree, 1) |
if maxlines <= 0 then return end |
local first, last |
scrollToSelection = status.scrollToSelection |
status.scrollToSelection = nil |
if numlines <= maxlines then |
--the whole tree fits in the frame |
if numlines - status.scrollvalue < maxlines then |
status.scrollvalue = numlines - maxlines |
end |
self.noupdate = nil |
first, last = status.scrollvalue+1, status.scrollvalue + maxlines |
--show selection? |
if scrollToSelection and status.selected then |
local show |
for i,line in ipairs(lines) do -- find the line number |
if line.uniquevalue==status.selected then |
show=i |
end |
end |
if not show then |
-- selection was deleted or something? |
elseif show>=first and show<=last then |
-- all good |
else |
-- scrolling needed! |
if show<first then |
status.scrollvalue = show-1 |
else |
status.scrollvalue = show-maxlines |
end |
first, last = status.scrollvalue+1, status.scrollvalue + maxlines |
end |
end |
if self.scrollbar:GetValue() ~= status.scrollvalue then |
self.scrollbar:SetValue(status.scrollvalue) |
end |
self.noupdate = nil |
first, last = status.scrollvalue+1, status.scrollvalue + maxlines |
end |
local buttonnum = 1 |
button:Show() |
buttonnum = buttonnum + 1 |
end |
end, |
["SetSelected"] = function(self, value) |
self.filter = false |
local status = self.status or self.localstatus |
local groups = status.groups |
for i = 1, select('#', ...) do |
groups[BuildUniqueValue(select(i, ...))] = true |
local path = {...} |
for i = 1, #path do |
groups[tconcat(path, "\001", 1, i)] = true |
end |
status.selected = uniquevalue |
self:RefreshTree() |
self:RefreshTree(true) |
self:Fire("OnGroupSelected", uniquevalue) |
end, |
Label Widget |
Displays text and optionally an icon. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Label", 21 |
local Type, Version = "Label", 23 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
else |
-- image on the left |
image:SetPoint("TOPLEFT") |
label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0) |
if image:GetHeight() > label:GetHeight() then |
label:SetPoint("LEFT", image, "RIGHT", 4, 0) |
else |
label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0) |
end |
label:SetWidth(width - imagewidth - 4) |
height = max(image:GetHeight(), label:GetHeight()) |
end |
local Type, Version = "MultiLineEditBox", 25 |
local Type, Version = "MultiLineEditBox", 27 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-- List them here for Mikk's FindGlobals script |
-- GLOBALS: ACCEPT, ChatFontNormal |
local wowMoP |
do |
local _, _, _, interface = GetBuildInfo() |
wowMoP = (interface >= 50000) |
end |
--[[----------------------------------------------------------------------------- |
Support functions |
-------------------------------------------------------------------------------]] |
if not AceGUIMultiLineEditBoxInsertLink then |
-- upgradeable hook |
hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIMultiLineEditBoxInsertLink(...) end) |
end |
function _G.AceGUIMultiLineEditBoxInsertLink(text) |
for i = 1, AceGUI:GetWidgetCount(Type) do |
local editbox = _G[("MultiLineEditBox%uEdit"):format(i)] |
if editbox and editbox:IsVisible() and editbox:HasFocus() then |
editbox:Insert(text) |
return true |
end |
end |
end |
local function Layout(self) |
self:SetHeight(self.numlines * 14 + (self.disablebutton and 19 or 41) + self.labelHeight) |
local function OnEditFocusLost(self) -- EditBox |
self:HighlightText(0, 0) |
self.obj:Fire("OnEditFocusLost") |
end |
local function OnEnter(self) -- EditBox / ScrollFrame |
frame:SetScript("OnShow", nil) |
end |
local function OnFocusGained(frame) |
local function OnEditFocusGained(frame) |
AceGUI:SetFocus(frame.obj) |
frame.obj:Fire("OnEditFocusGained") |
end |
--[[----------------------------------------------------------------------------- |
if not self.frame:IsShown() then |
self.frame:SetScript("OnShow", OnShowFocus) |
end |
end |
end, |
["GetCursorPosition"] = function(self) |
return self.editBox:GetCursorPosition() |
end, |
["SetCursorPosition"] = function(self, ...) |
return self.editBox:SetCursorPosition(...) |
end, |
} |
--[[----------------------------------------------------------------------------- |
label:SetText(ACCEPT) |
label:SetHeight(10) |
local button = CreateFrame("Button", ("%s%dButton"):format(Type, widgetNum), frame, "UIPanelButtonTemplate2") |
local button = CreateFrame("Button", ("%s%dButton"):format(Type, widgetNum), frame, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2") |
button:SetPoint("BOTTOMLEFT", 0, 4) |
button:SetHeight(22) |
button:SetWidth(label:GetStringWidth() + 24) |
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged) |
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll) |
local editBox = CreateFrame("EditBox", nil, scrollFrame) |
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame) |
editBox:SetAllPoints() |
editBox:SetFontObject(ChatFontNormal) |
editBox:SetMultiLine(true) |
editBox:SetScript("OnReceiveDrag", OnReceiveDrag) |
editBox:SetScript("OnTextChanged", OnTextChanged) |
editBox:SetScript("OnTextSet", OnTextSet) |
editBox:SetScript("OnEditFocusGained", OnFocusGained) |
editBox:SetScript("OnEditFocusGained", OnEditFocusGained) |
scrollFrame:SetScrollChild(editBox) |
TabGroup Container |
Container that uses tabs on top to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TabGroup", 31 |
local Type, Version = "TabGroup", 35 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local function Tab_SetText(frame, text) |
frame:_SetText(text) |
local width = frame.obj.frame.width or frame.obj.frame:GetWidth() or 0 |
PanelTemplates_TabResize(frame, 0, nil, width) |
PanelTemplates_TabResize(frame, 0, nil, nil, width, frame:GetFontString():GetStringWidth()) |
end |
local function Tab_SetSelected(frame, selected) |
end |
for i = starttab, endtab do |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, width) |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, nil, width, tabs[i]:GetFontString():GetStringWidth()) |
end |
starttab = endtab + 1 |
end |
Keybinding Widget |
Set Keybindings in the Config UI. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Keybinding", 22 |
local Type, Version = "Keybinding", 24 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-- List them here for Mikk's FindGlobals script |
-- GLOBALS: NOT_BOUND |
local wowMoP |
do |
local _, _, _, interface = GetBuildInfo() |
wowMoP = (interface >= 50000) |
end |
--[[----------------------------------------------------------------------------- |
Scripts |
-------------------------------------------------------------------------------]] |
local name = "AceGUI30KeybindingButton" .. AceGUI:GetNextWidgetNum(Type) |
local frame = CreateFrame("Frame", nil, UIParent) |
local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate2") |
local button = CreateFrame("Button", name, frame, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2") |
button:EnableMouse(true) |
button:RegisterForClicks("AnyDown") |
msgframe:SetBackdropColor(0,0,0) |
msgframe:SetFrameStrata("FULLSCREEN_DIALOG") |
msgframe:SetFrameLevel(1000) |
msgframe:SetToplevel(true) |
local msg = msgframe:CreateFontString(nil, "OVERLAY", "GameFontNormal") |
msg:SetText("Press a key to bind, ESC to clear the binding or click the button again to cancel.") |
--[[----------------------------------------------------------------------------- |
Checkbox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "CheckBox", 21 |
local Type, Version = "CheckBox", 22 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
self.frame:Disable() |
self.text:SetTextColor(0.5, 0.5, 0.5) |
SetDesaturation(self.check, true) |
if self.desc then |
self.desc:SetTextColor(0.5, 0.5, 0.5) |
end |
else |
self.frame:Enable() |
self.text:SetTextColor(1, 1, 1) |
else |
SetDesaturation(self.check, false) |
end |
if self.desc then |
self.desc:SetTextColor(1, 1, 1) |
end |
end |
end, |
--[[----------------------------------------------------------------------------- |
Frame Container |
-------------------------------------------------------------------------------]] |
local Type, Version = "Frame", 22 |
local Type, Version = "Frame", 24 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
self:SetStatusText() |
self:ApplyStatus() |
self:Show() |
self:EnableResize(true) |
end, |
["OnRelease"] = function(self) |
self.frame:Show() |
end, |
["EnableResize"] = function(self, state) |
local func = state and "Show" or "Hide" |
self.sizer_se[func](self.sizer_se) |
self.sizer_s[func](self.sizer_s) |
self.sizer_e[func](self.sizer_e) |
end, |
-- called to set an external table to store status in |
["SetStatusTable"] = function(self, status) |
assert(type(status) == "table") |
titletext = titletext, |
statustext = statustext, |
titlebg = titlebg, |
sizer_se = sizer_se, |
sizer_s = sizer_s, |
sizer_e = sizer_e, |
content = content, |
frame = frame, |
type = Type |
--[[ $Id: AceGUIWidget-DropDown.lua 997 2010-12-01 18:36:28Z nevcairiel $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 1029 2011-06-10 23:10:58Z nevcairiel $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Lua APIs |
do |
local widgetType = "Dropdown" |
local widgetVersion = 24 |
local widgetVersion = 25 |
--[[ Static data ]]-- |
self:SetHeight(44) |
self:SetWidth(200) |
self:SetLabel() |
end |
-- exported, AceGUI callback |
self.pullout = nil |
self:SetText("") |
self:SetLabel("") |
self:SetDisabled(false) |
self:SetMultiselect(false) |
self.label:SetText(text) |
self.label:Show() |
self.dropdown:SetPoint("TOPLEFT",self.frame,"TOPLEFT",-15,-18) |
self.frame:SetHeight(44) |
self:SetHeight(44) |
self.alignoffset = 30 |
else |
self.label:SetText("") |
self.label:Hide() |
self.dropdown:SetPoint("TOPLEFT",self.frame,"TOPLEFT",-15,0) |
self.frame:SetHeight(26) |
self:SetHeight(26) |
self.alignoffset = 12 |
end |
end |
self.SetItemValue = SetItemValue |
self.SetItemDisabled = SetItemDisabled |
self.alignoffset = 31 |
self.alignoffset = 30 |
frame:SetHeight(44) |
frame:SetWidth(200) |
frame:SetScript("OnHide",Dropdown_OnHide) |
dropdown:ClearAllPoints() |
-- end |
-- @class file |
-- @name AceAddon-3.0.lua |
-- @release $Id: AceAddon-3.0.lua 980 2010-10-27 14:20:11Z nevcairiel $ |
-- @release $Id: AceAddon-3.0.lua 1036 2011-08-16 22:45:05Z nevcairiel $ |
local MAJOR, MINOR = "AceAddon-3.0", 10 |
local MAJOR, MINOR = "AceAddon-3.0", 11 |
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceAddon then return end -- No Upgrade needed. |
-- Event Handling |
local function onEvent(this, event, arg1) |
if event == "ADDON_LOADED" or event == "PLAYER_LOGIN" then |
-- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up |
if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then |
-- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration |
while(#AceAddon.initializequeue > 0) do |
local addon = tremove(AceAddon.initializequeue, 1) |
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames. |
-- @class file |
-- @name AceConfigCmd-3.0 |
-- @release $Id: AceConfigCmd-3.0.lua 904 2009-12-13 11:56:37Z nevcairiel $ |
-- @release $Id: AceConfigCmd-3.0.lua 1045 2011-12-09 17:58:40Z nevcairiel $ |
--[[ |
AceConfigCmd-3.0 |
-- TODO: plugin args |
local MAJOR, MINOR = "AceConfigCmd-3.0", 12 |
local MAJOR, MINOR = "AceConfigCmd-3.0", 13 |
local AceConfigCmd = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigCmd then return end |
local r, g, b, a |
if tab.hasAlpha then |
local hasAlpha = tab.hasAlpha |
if type(hasAlpha) == "function" or type(hasAlpha) == "string" then |
info.hasAlpha = hasAlpha |
hasAlpha = callmethod(info, inputpos, tab, 'hasAlpha') |
info.hasAlpha = nil |
end |
if hasAlpha then |
if str:len() == 8 and str:find("^%x*$") then |
--parse a hex string |
r,g,b,a = tonumber(str:sub(1, 2), 16) / 255, tonumber(str:sub(3, 4), 16) / 255, tonumber(str:sub(5, 6), 16) / 255, tonumber(str:sub(7, 8), 16) / 255 |
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName". |
-- @class file |
-- @name AceConfigRegistry-3.0 |
-- @release $Id: AceConfigRegistry-3.0.lua 998 2010-12-01 18:39:53Z nevcairiel $ |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 13 |
-- @release $Id: AceConfigRegistry-3.0.lua 1045 2011-12-09 17:58:40Z nevcairiel $ |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 14 |
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigRegistry then return end |
dropdownControl=optstring, |
}, |
color={ |
hasAlpha=optbool, |
hasAlpha=optmethodbool, |
}, |
keybinding={ |
-- TODO |
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. |
-- @class file |
-- @name AceConfigDialog-3.0 |
-- @release $Id: AceConfigDialog-3.0.lua 998 2010-12-01 18:39:53Z nevcairiel $ |
-- @release $Id: AceConfigDialog-3.0.lua 1049 2012-04-02 13:22:10Z mikk $ |
local LibStub = LibStub |
local MAJOR, MINOR = "AceConfigDialog-3.0", 54 |
local MAJOR, MINOR = "AceConfigDialog-3.0", 57 |
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigDialog then return end |
local reg = LibStub("AceConfigRegistry-3.0") |
-- Lua APIs |
local tconcat, tinsert, tsort, tremove = table.concat, table.insert, table.sort, table.remove |
local tconcat, tinsert, tsort, tremove, tsort = table.concat, table.insert, table.sort, table.remove, table.sort |
local strmatch, format = string.match, string.format |
local assert, loadstring, error = assert, loadstring, error |
local pairs, next, select, type, unpack, wipe = pairs, next, select, type, unpack, wipe |
local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs |
local rawset, tostring, tonumber = rawset, tostring, tonumber |
local math_min, math_max, math_floor = math.min, math.max, math.floor |
t.text = message |
t.button1 = ACCEPT |
t.button2 = CANCEL |
t.preferredIndex = 3 |
local dialog, oldstrata |
t.OnAccept = function() |
safecall(func, unpack(t)) |
control.width = "fill" |
control:PauseLayout() |
local optionValue = GetOptionsMemberValue("get",v, options, path, appName, value) |
local optionValue = GetOptionsMemberValue("get",v, options, path, appName) |
local t = {} |
for value, text in pairs(values) do |
t[#t+1]=value |
end |
tsort(t) |
for k, value in ipairs(t) do |
local text = values[value] |
local radio = gui:Create("CheckBox") |
radio:SetLabel(text) |
radio:SetUserData("value", value) |
elseif v.type == "color" then |
control = gui:Create("ColorPicker") |
control:SetLabel(name) |
control:SetHasAlpha(v.hasAlpha) |
control:SetHasAlpha(GetOptionsMemberValue("hasAlpha",v, options, path, appName)) |
control:SetColor(GetOptionsMemberValue("get",v, options, path, appName)) |
control:SetCallback("OnValueChanged",ActivateControl) |
control:SetCallback("OnValueConfirmed",ActivateControl) |
-- end |
-- @class file |
-- @name AceDB-3.0.lua |
-- @release $Id: AceDB-3.0.lua 940 2010-06-19 08:01:47Z nevcairiel $ |
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 21 |
-- @release $Id: AceDB-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $ |
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 22 |
local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) |
if not AceDB then return end -- No upgrade needed |
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() |
-- Actual database initialization function |
local function initdb(sv, defaults, defaultProfile, olddb, parent) |
-- Generate the database keys for each section |
["race"] = raceKey, |
["faction"] = factionKey, |
["factionrealm"] = factionrealmKey, |
["factionrealmregion"] = factionrealmregionKey, |
["profile"] = profileKey, |
["locale"] = localeKey, |
["global"] = true, |
["profiles"] = true, |
} |
for db in pairs(AceDB.db_registry) do |
db.callbacks:Fire("OnDatabaseShutdown", db) |
db:RegisterDefaults(nil) |
-- cleanup sections that are empty without defaults |
local sv = rawget(db, "sv") |
for section in pairs(db.keys) do |