WoWInterface SVN EventAnnouncer

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/Libs
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

LibStub/LibStub.toc File deleted
CallbackHandler-1.0/CallbackHandler-1.0.lua
1,4 → 1,4
--[[ $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)
 
AceTimer-3.0/AceTimer-3.0.lua
15,7 → 15,7
-- 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:
36,7 → 36,7
- 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
402,7 → 402,7
 
-- 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
 
411,7 → 411,9
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
 
468,6 → 470,6
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.
AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
2,7 → 2,7
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
 
42,6 → 42,7
local methods = {
["OnAcquire"] = function(self)
self:SetScroll(0)
self:FixScroll()
end,
 
["OnRelease"] = function(self)
AceGUI-3.0/widgets/AceGUIWidget-Button.lua
2,7 → 2,7
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
 
13,6 → 13,12
local _G = _G
local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent
 
local wowMoP
do
local _, _, _, interface = GetBuildInfo()
wowMoP = (interface >= 50000)
end
 
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
63,7 → 69,7
-------------------------------------------------------------------------------]]
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)
AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
2,14 → 2,14
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
385,7 → 385,7
end
end,
 
["RefreshTree"] = function(self)
["RefreshTree"] = function(self,scrollToSelection)
local buttons = self.buttons
local lines = self.lines
 
407,6 → 407,8
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)
 
416,6 → 418,9
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
431,11 → 436,33
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
467,6 → 494,7
button:Show()
buttonnum = buttonnum + 1
end
 
end,
 
["SetSelected"] = function(self, value)
481,11 → 509,12
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,
 
AceGUI-3.0/widgets/AceGUIWidget-Label.lua
2,7 → 2,7
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
 
43,7 → 43,11
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
AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
1,4 → 1,4
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
 
14,9 → 14,32
-- 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)
 
61,6 → 84,7
 
local function OnEditFocusLost(self) -- EditBox
self:HighlightText(0, 0)
self.obj:Fire("OnEditFocusLost")
end
 
local function OnEnter(self) -- EditBox / ScrollFrame
132,8 → 156,9
frame:SetScript("OnShow", nil)
end
 
local function OnFocusGained(frame)
local function OnEditFocusGained(frame)
AceGUI:SetFocus(frame.obj)
frame.obj:Fire("OnEditFocusGained")
end
 
--[[-----------------------------------------------------------------------------
225,7 → 250,17
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,
 
 
}
 
--[[-----------------------------------------------------------------------------
250,7 → 285,7
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)
289,7 → 324,7
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)
305,7 → 340,7
editBox:SetScript("OnReceiveDrag", OnReceiveDrag)
editBox:SetScript("OnTextChanged", OnTextChanged)
editBox:SetScript("OnTextSet", OnTextSet)
editBox:SetScript("OnEditFocusGained", OnFocusGained)
editBox:SetScript("OnEditFocusGained", OnEditFocusGained)
 
 
scrollFrame:SetScrollChild(editBox)
AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua
2,7 → 2,7
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
 
39,7 → 39,7
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)
256,7 → 256,7
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
AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
2,7 → 2,7
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
 
17,6 → 17,12
-- List them here for Mikk's FindGlobals script
-- GLOBALS: NOT_BOUND
 
local wowMoP
do
local _, _, _, interface = GetBuildInfo()
wowMoP = (interface >= 50000)
end
 
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
174,7 → 180,7
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")
204,6 → 210,7
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.")
AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
1,7 → 1,7
--[[-----------------------------------------------------------------------------
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
 
102,6 → 102,9
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)
110,6 → 113,9
else
SetDesaturation(self.check, false)
end
if self.desc then
self.desc:SetTextColor(1, 1, 1)
end
end
end,
 
AceGUI-3.0/widgets/AceGUIContainer-Frame.lua
1,7 → 1,7
--[[-----------------------------------------------------------------------------
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
 
83,6 → 83,7
self:SetStatusText()
self:ApplyStatus()
self:Show()
self:EnableResize(true)
end,
 
["OnRelease"] = function(self)
127,6 → 128,13
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")
285,6 → 293,9
titletext = titletext,
statustext = statustext,
titlebg = titlebg,
sizer_se = sizer_se,
sizer_s = sizer_s,
sizer_e = sizer_e,
content = content,
frame = frame,
type = Type
AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua
1,4 → 1,4
--[[ $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
356,7 → 356,7
 
do
local widgetType = "Dropdown"
local widgetVersion = 24
local widgetVersion = 25
 
--[[ Static data ]]--
 
460,6 → 460,7
 
self:SetHeight(44)
self:SetWidth(200)
self:SetLabel()
end
 
-- exported, AceGUI callback
471,7 → 472,6
self.pullout = nil
 
self:SetText("")
self:SetLabel("")
self:SetDisabled(false)
self:SetMultiselect(false)
 
516,12 → 516,14
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
 
665,10 → 667,8
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()
AceAddon-3.0/AceAddon-3.0.lua
28,9 → 28,9
-- 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.
619,7 → 619,8
 
-- 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)
AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua
1,7 → 1,7
--- 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
15,7 → 15,7
-- 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
642,7 → 642,14
 
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
AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua
8,8 → 8,8
-- :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
162,7 → 162,7
dropdownControl=optstring,
},
color={
hasAlpha=optbool,
hasAlpha=optmethodbool,
},
keybinding={
-- TODO
AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
1,10 → 1,10
--- 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
21,10 → 21,10
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
 
580,6 → 580,7
t.text = message
t.button1 = ACCEPT
t.button2 = CANCEL
t.preferredIndex = 3
local dialog, oldstrata
t.OnAccept = function()
safecall(func, unpack(t))
1184,8 → 1185,14
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)
1315,7 → 1322,7
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)
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 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
260,6 → 260,9
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
295,7 → 298,9
["race"] = raceKey,
["faction"] = factionKey,
["factionrealm"] = factionrealmKey,
["factionrealmregion"] = factionrealmregionKey,
["profile"] = profileKey,
["locale"] = localeKey,
["global"] = true,
["profiles"] = true,
}
352,7 → 357,7
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