Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 4dd62c269fe196c4534baa74cc828117c2201b7a
- Author: Infus <infus@squorn.de>
- Date: Wed Jul 27 02:33:35 2016 +0200
- Fix
- diff --git a/WeakAuras/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/WeakAuras/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
- index 3612fe8..f35d8d9 100644
- --- a/WeakAuras/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
- +++ b/WeakAuras/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
- @@ -4,7 +4,7 @@
- -- @release $Id: AceConfigDialog-3.0.lua 1139 2016-07-03 07:43:51Z nevcairiel $
- local LibStub = LibStub
- -local MAJOR, MINOR = "AceConfigDialog-3.0", 61
- +local MAJOR, MINOR = "AceConfigDialog-3.0", 62
- local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
- if not AceConfigDialog then return end
- @@ -50,17 +50,17 @@ local function CreateDispatcher(argCount)
- local xpcall, eh = ...
- local method, ARGS
- local function call() return method(ARGS) end
- -
- +
- local function dispatch(func, ...)
- method = func
- if not method then return end
- ARGS = ...
- return xpcall(call, eh)
- end
- -
- +
- return dispatch
- ]]
- -
- +
- local ARGS = {}
- for i = 1, argCount do ARGS[i] = "arg"..i end
- code = code:gsub("ARGS", tconcat(ARGS, ", "))
- @@ -75,7 +75,7 @@ end})
- Dispatchers[0] = function(func)
- return xpcall(func, errorhandler)
- end
- -
- +
- local function safecall(func, ...)
- return Dispatchers[select("#", ...)](func, ...)
- end
- @@ -197,11 +197,11 @@ local allIsLiteral = {
- local function GetOptionsMemberValue(membername, option, options, path, appName, ...)
- --get definition for the member
- local inherits = isInherited[membername]
- -
- +
- --get the member of the option, traversing the tree if it can be inherited
- local member
- -
- +
- if inherits then
- local group = options
- if group[membername] ~= nil then
- @@ -216,7 +216,7 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
- else
- member = option[membername]
- end
- -
- +
- --check if we need to call a functon, or if we have a literal value
- if ( not allIsLiteral[membername] ) and ( type(member) == "function" or ((not stringIsLiteral[membername]) and type(member) == "string") ) then
- --We have a function to call
- @@ -225,13 +225,13 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
- local handler
- local group = options
- handler = group.handler or handler
- -
- +
- for i = 1, #path do
- group = GetSubOption(group, path[i])
- info[i] = path[i]
- handler = group.handler or handler
- end
- -
- +
- info.options = options
- info.appName = appName
- info[0] = appName
- @@ -241,8 +241,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
- info.type = option.type
- info.uiType = "dialog"
- info.uiName = MAJOR
- -
- - local a, b, c ,d
- +
- + local a, b, c ,d
- --using 4 returns for the get of a color type, increase if a type needs more
- if type(member) == "function" then
- --Call the function
- @@ -259,8 +259,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
- return a,b,c,d
- else
- --The value isnt a function to call, return it
- - return member
- - end
- + return member
- + end
- end
- --[[calls an options function that could be inherited, method name or function ref
- @@ -344,7 +344,7 @@ end
- local function BuildSortedOptionsTable(group, keySort, opts, options, path, appName)
- tempOrders = new()
- tempNames = new()
- -
- +
- if group.plugins then
- for plugin, t in pairs(group.plugins) do
- for k, v in pairs(t) do
- @@ -360,7 +360,7 @@ local function BuildSortedOptionsTable(group, keySort, opts, options, path, appN
- end
- end
- end
- -
- +
- for k, v in pairs(group.args) do
- if not opts[k] then
- tinsert(keySort, k)
- @@ -391,7 +391,7 @@ local function DelTree(tree)
- end
- local function CleanUserData(widget, event)
- -
- +
- local user = widget:GetUserDataTable()
- if user.path then
- @@ -431,7 +431,7 @@ end
- -- - Gets a status table for the given appname and options path.
- -- @param appName The application name as given to `:RegisterOptionsTable()`
- -- @param path The path to the options (a table with all group keys)
- --- @return
- +-- @return
- function AceConfigDialog:GetStatusTable(appName, path)
- local status = self.Status
- @@ -465,7 +465,7 @@ end
- function AceConfigDialog:SelectGroup(appName, ...)
- local path = new()
- -
- +
- local app = reg:GetOptionsTable(appName)
- if not app then
- error(("%s isn't registed with AceConfigRegistry, unable to open config"):format(appName), 2)
- @@ -477,9 +477,9 @@ function AceConfigDialog:SelectGroup(appName, ...)
- status.groups = {}
- end
- status = status.groups
- - local treevalue
- - local treestatus
- -
- + local treevalue
- + local treestatus
- +
- for n = 1, select("#",...) do
- local key = select(n, ...)
- @@ -506,12 +506,12 @@ function AceConfigDialog:SelectGroup(appName, ...)
- --the selected group will be overwritten if a child is the final target but still needs to be open
- treestatus.selected = treevalue
- treestatus.groups[treevalue] = true
- -
- +
- end
- -
- +
- --move to the next group in the path
- group = GetSubOption(group, key)
- - if not group then
- + if not group then
- break
- end
- tinsert(path, key)
- @@ -521,10 +521,10 @@ function AceConfigDialog:SelectGroup(appName, ...)
- end
- status = status.groups
- end
- -
- +
- del(path)
- reg:NotifyChange(appName)
- -end
- +end
- local function OptionOnMouseOver(widget, event)
- --show a tooltip/set the status bar to the desc text
- @@ -539,14 +539,14 @@ local function OptionOnMouseOver(widget, event)
- local desc = GetOptionsMemberValue("desc", opt, options, path, appName)
- local usage = GetOptionsMemberValue("usage", opt, options, path, appName)
- local descStyle = opt.descStyle
- -
- +
- if descStyle and descStyle ~= "tooltip" then return end
- -
- +
- GameTooltip:SetText(name, 1, .82, 0, true)
- -
- +
- if opt.type == "multiselect" then
- GameTooltip:AddLine(user.text, 0.5, 0.5, 0.8, true)
- - end
- + end
- if type(desc) == "string" then
- GameTooltip:AddLine(desc, 1, 1, 1, true)
- end
- @@ -679,7 +679,7 @@ local function ActivateControl(widget, event, ...)
- end
- end
- end
- -
- +
- local success
- if validated and option.type ~= "execute" then
- if type(validate) == "string" then
- @@ -694,7 +694,7 @@ local function ActivateControl(widget, event, ...)
- if not success then validated = false end
- end
- end
- -
- +
- local rootframe = user.rootframe
- if type(validated) == "string" then
- --validate function returned a message to display
- @@ -707,7 +707,7 @@ local function ActivateControl(widget, event, ...)
- del(info)
- return true
- elseif not validated then
- - --validate returned false
- + --validate returned false
- if rootframe.SetStatusText then
- if usage then
- rootframe:SetStatusText(name..": "..usage)
- @@ -725,7 +725,7 @@ local function ActivateControl(widget, event, ...)
- del(info)
- return true
- else
- -
- +
- local confirmText = option.confirmText
- --call confirm func/method
- if type(confirm) == "string" then
- @@ -766,10 +766,10 @@ local function ActivateControl(widget, event, ...)
- confirmText = confirmText.." - "..desc
- end
- end
- -
- +
- local iscustom = user.rootframe:GetUserData("iscustom")
- local rootframe
- -
- +
- if iscustom then
- rootframe = user.rootframe
- end
- @@ -806,7 +806,7 @@ local function ActivateControl(widget, event, ...)
- --full refresh of the frame, some controls dont cause this on all events
- if option.type == "color" then
- if event == "OnValueConfirmed" then
- -
- +
- if iscustom then
- AceConfigDialog:Open(user.appName, user.rootframe, unpack(basepath))
- else
- @@ -1075,7 +1075,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- else
- GroupContainer = gui:Create("SimpleGroup")
- end
- -
- +
- GroupContainer.width = "fill"
- GroupContainer:SetLayout("flow")
- container:AddChild(GroupContainer)
- @@ -1084,14 +1084,14 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- else
- --Control to feed
- local control
- -
- +
- local name = GetOptionsMemberValue("name", v, options, path, appName)
- -
- +
- if v.type == "execute" then
- -
- +
- local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
- local image, width, height = GetOptionsMemberValue("image",v, options, path, appName)
- -
- +
- if type(image) == "string" or type(image) == "number" then
- control = gui:Create("Icon")
- if not width then
- @@ -1126,7 +1126,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- geterrorhandler()(("Invalid Custom Control Type - %s"):format(tostring(controlType)))
- control = gui:Create(v.multiline and "MultiLineEditBox" or "EditBox")
- end
- -
- +
- if v.multiline and control.SetNumLines then
- control:SetNumLines(tonumber(v.multiline) or 4)
- end
- @@ -1145,15 +1145,15 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- local value = GetOptionsMemberValue("get",v, options, path, appName)
- control:SetValue(value)
- control:SetCallback("OnValueChanged",ActivateControl)
- -
- +
- if v.descStyle == "inline" then
- local desc = GetOptionsMemberValue("desc", v, options, path, appName)
- control:SetDescription(desc)
- end
- -
- +
- local image = GetOptionsMemberValue("image", v, options, path, appName)
- local imageCoords = GetOptionsMemberValue("imageCoords", v, options, path, appName)
- -
- +
- if type(image) == "string" or type(image) == "number" then
- if type(imageCoords) == "table" then
- control:SetImage(image, unpack(imageCoords))
- @@ -1240,9 +1240,9 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- elseif v.type == "multiselect" then
- local values = GetOptionsMemberValue("values", v, options, path, appName)
- local disabled = CheckOptionDisabled(v, options, path, appName)
- -
- +
- local controlType = v.dialogControl or v.control
- -
- +
- local valuesort = new()
- if values then
- for value, text in pairs(values) do
- @@ -1250,7 +1250,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- end
- end
- tsort(valuesort)
- -
- +
- if controlType then
- control = gui:Create(controlType)
- if not control then
- @@ -1314,9 +1314,9 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- control:ResumeLayout()
- control:DoLayout()
- -
- +
- end
- -
- +
- del(valuesort)
- elseif v.type == "color" then
- @@ -1341,7 +1341,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- elseif v.type == "description" then
- control = gui:Create("Label")
- control:SetText(name)
- -
- +
- local fontSize = GetOptionsMemberValue("fontSize",v, options, path, appName)
- if fontSize == "medium" then
- control:SetFontObject(GameFontHighlight)
- @@ -1350,10 +1350,10 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- else -- small or invalid
- control:SetFontObject(GameFontHighlightSmall)
- end
- -
- +
- local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
- local image, width, height = GetOptionsMemberValue("image",v, options, path, appName)
- -
- +
- if type(image) == "string" or type(image) == "number" then
- if not width then
- width = GetOptionsMemberValue("imageWidth",v, options, path, appName)
- @@ -1398,9 +1398,10 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
- end
- InjectInfo(control, options, v, path, rootframe, appName)
- + control.rowStart = GetOptionsMemberValue("rowStart", v, options, path, appName);
- container:AddChild(control)
- end
- -
- +
- end
- end
- tremove(path)
- @@ -1425,7 +1426,7 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
- local option = user.option
- local path = user.path
- local appName = user.appName
- -
- +
- local feedpath = new()
- for i = 1, #path do
- feedpath[i] = path[i]
- @@ -1440,7 +1441,7 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
- local name = GetOptionsMemberValue("name", group, options, feedpath, appName)
- local desc = GetOptionsMemberValue("desc", group, options, feedpath, appName)
- -
- +
- GameTooltip:SetOwner(button, "ANCHOR_NONE")
- if widget.type == "TabGroup" then
- GameTooltip:SetPoint("BOTTOM",button,"TOP")
- @@ -1449,11 +1450,11 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
- end
- GameTooltip:SetText(name, 1, .82, 0, true)
- -
- +
- if type(desc) == "string" then
- GameTooltip:AddLine(desc, 1, 1, 1, true)
- end
- -
- +
- GameTooltip:Show()
- end
- @@ -1464,25 +1465,25 @@ end
- local function GroupExists(appName, options, path, uniquevalue)
- if not uniquevalue then return false end
- -
- +
- local feedpath = new()
- local temppath = new()
- for i = 1, #path do
- feedpath[i] = path[i]
- end
- -
- +
- BuildPath(feedpath, ("\001"):split(uniquevalue))
- -
- +
- local group = options
- for i = 1, #feedpath do
- local v = feedpath[i]
- temppath[i] = v
- group = GetSubOption(group, v)
- -
- - if not group or group.type ~= "group" or CheckOptionHidden(group, options, temppath, appName) then
- +
- + if not group or group.type ~= "group" or CheckOptionHidden(group, options, temppath, appName) then
- del(feedpath)
- del(temppath)
- - return false
- + return false
- end
- end
- del(feedpath)
- @@ -1605,7 +1606,7 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
- tab:SetCallback("OnGroupSelected", GroupSelected)
- tab:SetCallback("OnTabEnter", TreeOnButtonEnter)
- tab:SetCallback("OnTabLeave", TreeOnButtonLeave)
- -
- +
- local status = AceConfigDialog:GetStatusTable(appName, path)
- if not status.groups then
- status.groups = {}
- @@ -1625,7 +1626,7 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
- break
- end
- end
- -
- +
- container:AddChild(tab)
- elseif grouptype == "select" then
- @@ -1648,7 +1649,7 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
- if firstgroup then
- select:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
- end
- -
- +
- select.width = "fill"
- select.height = "fill"
- @@ -1660,14 +1661,14 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
- local tree = gui:Create("TreeGroup")
- InjectInfo(tree, options, group, path, rootframe, appName)
- tree:EnableButtonTooltips(false)
- -
- +
- tree.width = "fill"
- tree.height = "fill"
- tree:SetCallback("OnGroupSelected", GroupSelected)
- tree:SetCallback("OnButtonEnter", TreeOnButtonEnter)
- tree:SetCallback("OnButtonLeave", TreeOnButtonLeave)
- -
- +
- local status = AceConfigDialog:GetStatusTable(appName, path)
- if not status.groups then
- status.groups = {}
- @@ -1708,7 +1709,7 @@ local function RefreshOnUpdate(this)
- end
- this.closing[appName] = nil
- end
- -
- +
- if this.closeAll then
- for k, v in pairs(AceConfigDialog.OpenFrames) do
- if not this.closeAllOverride[k] then
- @@ -1718,7 +1719,7 @@ local function RefreshOnUpdate(this)
- this.closeAll = nil
- wipe(this.closeAllOverride)
- end
- -
- +
- for appName in pairs(this.apps) do
- if AceConfigDialog.OpenFrames[appName] then
- local user = AceConfigDialog.OpenFrames[appName]:GetUserDataTable()
- @@ -1803,10 +1804,10 @@ function AceConfigDialog:Open(appName, container, ...)
- local options = app("dialog", MAJOR)
- local f
- -
- +
- local path = new()
- local name = GetOptionsMemberValue("name", options, options, path, appName)
- -
- +
- --If an optional path is specified add it to the path table before feeding the options
- --as container is optional as well it may contain the first element of the path
- if type(container) == "string" then
- @@ -1816,7 +1817,7 @@ function AceConfigDialog:Open(appName, container, ...)
- for n = 1, select("#",...) do
- tinsert(path, (select(n, ...)))
- end
- -
- +
- local option = options
- if type(container) == "table" and container.type == "BlizOptionsGroup" and #path > 0 then
- for i = 1, #path do
- @@ -1824,7 +1825,7 @@ function AceConfigDialog:Open(appName, container, ...)
- end
- name = format("%s - %s", name, GetOptionsMemberValue("name", option, options, path, appName))
- end
- -
- +
- --if a container is given feed into that
- if container then
- f = container
- @@ -1918,19 +1919,19 @@ end
- -- @param name A descriptive name to display in the options tree (defaults to appName)
- -- @param parent The parent to use in the interface options tree.
- -- @param ... The path in the options table to feed into the interface options panel.
- --- @return The reference to the frame registered into the Interface Options.
- +-- @return The reference to the frame registered into the Interface Options.
- function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
- local BlizOptions = AceConfigDialog.BlizOptions
- -
- +
- local key = appName
- for n = 1, select("#", ...) do
- key = key.."\001"..select(n, ...)
- end
- -
- +
- if not BlizOptions[appName] then
- BlizOptions[appName] = {}
- end
- -
- +
- if not BlizOptions[appName][key] then
- local group = gui:Create("BlizOptionsGroup")
- BlizOptions[appName][key] = group
- diff --git a/WeakAuras/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua b/WeakAuras/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua
- index cf81973..a3301fc 100644
- --- a/WeakAuras/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua
- +++ b/WeakAuras/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua
- @@ -4,12 +4,12 @@
- -- * Valid **uiTypes**: "cmd", "dropdown", "dialog". This is verified by the library at call time. \\
- -- * The **uiName** field is expected to contain the full name of the calling addon, including version, e.g. "FooBar-1.0". This is verified by the library at call time.\\
- -- * The **appName** field is the options table name as given at registration time \\
- ---
- +--
- -- :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 1139 2016-07-03 07:43:51Z nevcairiel $
- -local MAJOR, MINOR = "AceConfigRegistry-3.0", 16
- +local MAJOR, MINOR = "AceConfigRegistry-3.0", 17
- local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
- if not AceConfigRegistry then return end
- @@ -33,7 +33,7 @@ local error, assert = error, assert
- AceConfigRegistry.validated = {
- - -- list of options table names ran through :ValidateOptionsTable automatically.
- + -- list of options table names ran through :ValidateOptionsTable automatically.
- -- CLEARED ON PURPOSE, since newer versions may have newer validators
- cmd = {},
- dropdown = {},
- @@ -91,6 +91,7 @@ local basekeys={
- func=optmethodfalse,
- arg={["*"]=true},
- width=optstring,
- + rowStart=optbool
- }
- local typedkeys={
- @@ -145,8 +146,8 @@ local typedkeys={
- select={
- values=ismethodtable,
- style={
- - ["nil"]=true,
- - ["string"]={dropdown=true,radio=true},
- + ["nil"]=true,
- + ["string"]={dropdown=true,radio=true},
- _="string: 'dropdown' or 'radio'"
- },
- control=optstring,
- @@ -203,13 +204,13 @@ local function validate(options,errlvl,...)
- if type(options.type)~="string" then
- err(".type: expected a string, got a "..type(options.type), errlvl,...)
- end
- -
- +
- -- get type and 'typedkeys' member
- local tk = typedkeys[options.type]
- if not tk then
- err(".type: unknown type '"..options.type.."'", errlvl,...)
- end
- -
- +
- -- make sure that all options[] are known parameters
- for k,v in pairs(options) do
- if not (tk[k] or basekeys[k]) then
- @@ -302,7 +303,7 @@ function AceConfigRegistry:RegisterOptionsTable(appName, options, skipValidation
- AceConfigRegistry:ValidateOptionsTable(options, appName, errlvl) -- upgradable
- AceConfigRegistry.validated[uiType][appName] = true
- end
- - return options
- + return options
- end
- elseif type(options)=="function" then
- AceConfigRegistry.tables[appName] = function(uiType, uiName, errlvl)
- @@ -340,7 +341,7 @@ function AceConfigRegistry:GetOptionsTable(appName, uiType, uiName)
- if not f then
- return nil
- end
- -
- +
- if uiType then
- return f(uiType,uiName,1) -- get the table for us
- else
- diff --git a/WeakAuras/libs/AceGUI-3.0/AceGUI-3.0.lua b/WeakAuras/libs/AceGUI-3.0/AceGUI-3.0.lua
- index 9853644..5daad7b 100644
- --- a/WeakAuras/libs/AceGUI-3.0/AceGUI-3.0.lua
- +++ b/WeakAuras/libs/AceGUI-3.0/AceGUI-3.0.lua
- @@ -1,6 +1,6 @@
- --- **AceGUI-3.0** provides access to numerous widgets which can be used to create GUIs.
- -- AceGUI is used by AceConfigDialog to create the option GUIs, but you can use it by itself
- --- to create any custom GUI. There are more extensive examples in the test suite in the Ace3
- +-- to create any custom GUI. There are more extensive examples in the test suite in the Ace3
- -- stand-alone distribution.
- --
- -- **Note**: When using AceGUI-3.0 directly, please do not modify the frames of the widgets directly,
- @@ -25,7 +25,7 @@
- -- @class file
- -- @name AceGUI-3.0
- -- @release $Id: AceGUI-3.0.lua 1102 2013-10-25 14:15:23Z nevcairiel $
- -local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 34
- +local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 35
- local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
- if not AceGUI then return end -- No upgrade needed
- @@ -51,7 +51,7 @@ AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
- AceGUI.WidgetBase = AceGUI.WidgetBase or {}
- AceGUI.WidgetContainerBase = AceGUI.WidgetContainerBase or {}
- AceGUI.WidgetVersions = AceGUI.WidgetVersions or {}
- -
- +
- -- local upvalues
- local WidgetRegistry = AceGUI.WidgetRegistry
- local LayoutRegistry = AceGUI.LayoutRegistry
- @@ -71,17 +71,17 @@ local function CreateDispatcher(argCount)
- local xpcall, eh = ...
- local method, ARGS
- local function call() return method(ARGS) end
- -
- +
- local function dispatch(func, ...)
- method = func
- if not method then return end
- ARGS = ...
- return xpcall(call, eh)
- end
- -
- +
- return dispatch
- ]]
- -
- +
- local ARGS = {}
- for i = 1, argCount do ARGS[i] = "arg"..i end
- code = code:gsub("ARGS", tconcat(ARGS, ", "))
- @@ -96,7 +96,7 @@ end})
- Dispatchers[0] = function(func)
- return xpcall(func, errorhandler)
- end
- -
- +
- local function safecall(func, ...)
- return Dispatchers[select("#", ...)](func, ...)
- end
- @@ -108,7 +108,7 @@ do
- -- Internal Storage of the objects changed, from an array table
- -- to a hash table, and additionally we introduced versioning on
- -- the widgets which would discard all widgets from a pre-29 version
- - -- anyway, so we just clear the storage now, and don't try to
- + -- anyway, so we just clear the storage now, and don't try to
- -- convert the storage tables to the new format.
- -- This should generally not cause *many* widgets to end up in trash,
- -- since once dialogs are opened, all addons should be loaded already
- @@ -118,7 +118,7 @@ do
- if oldminor and oldminor < 29 and AceGUI.objPools then
- AceGUI.objPools = nil
- end
- -
- +
- AceGUI.objPools = AceGUI.objPools or {}
- local objPools = AceGUI.objPools
- --Returns a new instance, if none are available either returns a new table or calls the given contructor
- @@ -126,11 +126,11 @@ do
- if not WidgetRegistry[type] then
- error("Attempt to instantiate unknown widget type", 2)
- end
- -
- +
- if not objPools[type] then
- objPools[type] = {}
- end
- -
- +
- local newObj = next(objPools[type])
- if not newObj then
- newObj = WidgetRegistry[type]()
- @@ -180,12 +180,12 @@ function AceGUI:Create(type)
- widget.OnAcquire = widget.Aquire
- widget.Aquire = nil
- end
- -
- +
- if rawget(widget, "Release") then
- - widget.OnRelease = rawget(widget, "Release")
- + widget.OnRelease = rawget(widget, "Release")
- widget.Release = nil
- end
- -
- +
- if widget.OnAcquire then
- widget:OnAcquire()
- else
- @@ -267,18 +267,18 @@ end
- --[[
- Widgets must provide the following functions
- OnAcquire() - Called when the object is acquired, should set everything to a default hidden state
- -
- +
- And the following members
- frame - the frame or derivitive object that will be treated as the widget for size and anchoring purposes
- type - the type of the object, same as the name given to :RegisterWidget()
- -
- +
- Widgets contain a table called userdata, this is a safe place to store data associated with the wigdet
- It will be cleared automatically when a widget is released
- Placing values directly into a widget object should be avoided
- -
- +
- If the Widget can act as a container for other Widgets the following
- content - frame or derivitive that children will be anchored to
- -
- +
- The Widget can supply the following Optional Members
- :OnRelease() - Called when the object is Released, should remove any additional anchors and clear any data
- :OnWidthSet(width) - Called when the width of the widget is changed
- @@ -294,21 +294,21 @@ end
- -- Widget Base Template --
- --------------------------
- do
- - local WidgetBase = AceGUI.WidgetBase
- -
- + local WidgetBase = AceGUI.WidgetBase
- +
- WidgetBase.SetParent = function(self, parent)
- local frame = self.frame
- frame:SetParent(nil)
- frame:SetParent(parent.content)
- self.parent = parent
- end
- -
- +
- WidgetBase.SetCallback = function(self, name, func)
- if type(func) == "function" then
- self.events[name] = func
- end
- end
- -
- +
- WidgetBase.Fire = function(self, name, ...)
- if self.events[name] then
- local success, ret = safecall(self.events[name], self, name, ...)
- @@ -317,7 +317,7 @@ do
- end
- end
- end
- -
- +
- WidgetBase.SetWidth = function(self, width)
- self.frame:SetWidth(width)
- self.frame.width = width
- @@ -325,7 +325,7 @@ do
- self:OnWidthSet(width)
- end
- end
- -
- +
- WidgetBase.SetRelativeWidth = function(self, width)
- if width <= 0 or width > 1 then
- error(":SetRelativeWidth(width): Invalid relative width.", 2)
- @@ -333,7 +333,7 @@ do
- self.relWidth = width
- self.width = "relative"
- end
- -
- +
- WidgetBase.SetHeight = function(self, height)
- self.frame:SetHeight(height)
- self.frame.height = height
- @@ -341,7 +341,7 @@ do
- self:OnHeightSet(height)
- end
- end
- -
- +
- --[[ WidgetBase.SetRelativeHeight = function(self, height)
- if height <= 0 or height > 1 then
- error(":SetRelativeHeight(height): Invalid relative height.", 2)
- @@ -353,47 +353,47 @@ do
- WidgetBase.IsVisible = function(self)
- return self.frame:IsVisible()
- end
- -
- +
- WidgetBase.IsShown= function(self)
- return self.frame:IsShown()
- end
- -
- +
- WidgetBase.Release = function(self)
- AceGUI:Release(self)
- end
- -
- +
- WidgetBase.SetPoint = function(self, ...)
- return self.frame:SetPoint(...)
- end
- -
- +
- WidgetBase.ClearAllPoints = function(self)
- return self.frame:ClearAllPoints()
- end
- -
- +
- WidgetBase.GetNumPoints = function(self)
- return self.frame:GetNumPoints()
- end
- -
- +
- WidgetBase.GetPoint = function(self, ...)
- return self.frame:GetPoint(...)
- - end
- -
- + end
- +
- WidgetBase.GetUserDataTable = function(self)
- return self.userdata
- end
- -
- +
- WidgetBase.SetUserData = function(self, key, value)
- self.userdata[key] = value
- end
- -
- +
- WidgetBase.GetUserData = function(self, key)
- return self.userdata[key]
- end
- -
- +
- WidgetBase.IsFullHeight = function(self)
- return self.height == "fill"
- end
- -
- +
- WidgetBase.SetFullHeight = function(self, isFull)
- if isFull then
- self.height = "fill"
- @@ -401,11 +401,11 @@ do
- self.height = nil
- end
- end
- -
- +
- WidgetBase.IsFullWidth = function(self)
- return self.width == "fill"
- end
- -
- +
- WidgetBase.SetFullWidth = function(self, isFull)
- if isFull then
- self.width = "fill"
- @@ -413,29 +413,29 @@ do
- self.width = nil
- end
- end
- -
- +
- -- local function LayoutOnUpdate(this)
- -- this:SetScript("OnUpdate",nil)
- -- this.obj:PerformLayout()
- -- end
- -
- +
- local WidgetContainerBase = AceGUI.WidgetContainerBase
- -
- +
- WidgetContainerBase.PauseLayout = function(self)
- self.LayoutPaused = true
- end
- -
- +
- WidgetContainerBase.ResumeLayout = function(self)
- self.LayoutPaused = nil
- end
- -
- +
- WidgetContainerBase.PerformLayout = function(self)
- if self.LayoutPaused then
- return
- end
- safecall(self.LayoutFunc, self.content, self.children)
- end
- -
- +
- --call this function to layout, makes sure layed out objects get a frame to get sizes etc
- WidgetContainerBase.DoLayout = function(self)
- self:PerformLayout()
- @@ -443,7 +443,7 @@ do
- -- self.frame:SetScript("OnUpdate", LayoutOnUpdate)
- -- end
- end
- -
- +
- WidgetContainerBase.AddChild = function(self, child, beforeWidget)
- if beforeWidget then
- local siblingIndex = 1
- @@ -451,7 +451,7 @@ do
- if widget == beforeWidget then
- break
- end
- - siblingIndex = siblingIndex + 1
- + siblingIndex = siblingIndex + 1
- end
- tinsert(self.children, siblingIndex, child)
- else
- @@ -461,7 +461,7 @@ do
- child.frame:Show()
- self:DoLayout()
- end
- -
- +
- WidgetContainerBase.AddChildren = function(self, ...)
- for i = 1, select("#", ...) do
- local child = select(i, ...)
- @@ -471,7 +471,7 @@ do
- end
- self:DoLayout()
- end
- -
- +
- WidgetContainerBase.ReleaseChildren = function(self)
- local children = self.children
- for i = 1,#children do
- @@ -479,7 +479,7 @@ do
- children[i] = nil
- end
- end
- -
- +
- WidgetContainerBase.SetLayout = function(self, Layout)
- self.LayoutFunc = AceGUI:GetLayout(Layout)
- end
- @@ -503,7 +503,7 @@ do
- end
- end
- end
- -
- +
- local function ContentResize(this)
- if this:GetWidth() and this:GetHeight() then
- this.width = this:GetWidth()
- @@ -515,7 +515,7 @@ do
- setmetatable(WidgetContainerBase, {__index=WidgetBase})
- --One of these function should be called on each Widget Instance as part of its creation process
- -
- +
- --- Register a widget-class as a container for newly created widgets.
- -- @param widget The widget class
- function AceGUI:RegisterAsContainer(widget)
- @@ -531,7 +531,7 @@ do
- widget:SetLayout("List")
- return widget
- end
- -
- +
- --- Register a widget-class as a widget.
- -- @param widget The widget class
- function AceGUI:RegisterAsWidget(widget)
- @@ -558,11 +558,11 @@ end
- -- @param Version The version of the widget
- function AceGUI:RegisterWidgetType(Name, Constructor, Version)
- assert(type(Constructor) == "function")
- - assert(type(Version) == "number")
- -
- + assert(type(Version) == "number")
- +
- local oldVersion = WidgetVersions[Name]
- if oldVersion and oldVersion >= Version then return end
- -
- +
- WidgetVersions[Name] = Version
- WidgetRegistry[Name] = Constructor
- end
- @@ -631,7 +631,7 @@ AceGUI:RegisterLayout("List",
- local width = content.width or content:GetWidth() or 0
- for i = 1, #children do
- local child = children[i]
- -
- +
- local frame = child.frame
- frame:ClearAllPoints()
- frame:Show()
- @@ -640,22 +640,22 @@ AceGUI:RegisterLayout("List",
- else
- frame:SetPoint("TOPLEFT", children[i-1].frame, "BOTTOMLEFT")
- end
- -
- +
- if child.width == "fill" then
- child:SetWidth(width)
- frame:SetPoint("RIGHT", content)
- -
- +
- if child.DoLayout then
- child:DoLayout()
- end
- elseif child.width == "relative" then
- child:SetWidth(width * child.relWidth)
- -
- +
- if child.DoLayout then
- child:DoLayout()
- end
- end
- -
- +
- height = height + (frame.height or frame:GetHeight() or 0)
- end
- safecall(content.obj.LayoutFinished, content.obj, nil, height)
- @@ -691,18 +691,18 @@ AceGUI:RegisterLayout("Flow",
- local rowheight = 0
- local rowoffset = 0
- local lastrowoffset
- -
- +
- local width = content.width or content:GetWidth() or 0
- -
- +
- --control at the start of the row
- local rowstart
- local rowstartoffset
- local lastrowstart
- local isfullheight
- -
- +
- local frameoffset
- local lastframeoffset
- - local oversize
- + local oversize
- for i = 1, #children do
- local child = children[i]
- oversize = nil
- @@ -710,17 +710,17 @@ AceGUI:RegisterLayout("Flow",
- local frameheight = frame.height or frame:GetHeight() or 0
- local framewidth = frame.width or frame:GetWidth() or 0
- lastframeoffset = frameoffset
- - -- HACK: Why did we set a frameoffset of (frameheight / 2) ?
- + -- HACK: Why did we set a frameoffset of (frameheight / 2) ?
- -- That was moving all widgets half the widgets size down, is that intended?
- -- Actually, it seems to be neccessary for many cases, we'll leave it in for now.
- -- If widgets seem to anchor weirdly with this, provide a valid alignoffset for them.
- -- TODO: Investigate moar!
- frameoffset = child.alignoffset or (frameheight / 2)
- -
- +
- if child.width == "relative" then
- framewidth = width * child.relWidth
- end
- -
- +
- frame:Show()
- frame:ClearAllPoints()
- if i == 1 then
- @@ -737,7 +737,7 @@ AceGUI:RegisterLayout("Flow",
- else
- -- if there isn't available width for the control start a new row
- -- if a control is "fill" it will be on a row of its own full width
- - if usedwidth == 0 or ((framewidth) + usedwidth > width) or child.width == "fill" then
- + if usedwidth == 0 or ((framewidth) + usedwidth > width) or child.width == "fill" or child.rowStart then
- if isfullheight then
- -- a previous row has already filled the entire height, there's nothing we can usefully do anymore
- -- (maybe error/warn about this?)
- @@ -759,11 +759,11 @@ AceGUI:RegisterLayout("Flow",
- else
- --handles cases where the new height is higher than either control because of the offsets
- --math.max(rowheight-rowoffset+frameoffset, frameheight-frameoffset+rowoffset)
- -
- +
- --offset is always the larger of the two offsets
- rowoffset = math_max(rowoffset, frameoffset)
- rowheight = math_max(rowheight, rowoffset + (frameheight / 2))
- -
- +
- frame:SetPoint("TOPLEFT", children[i-1].frame, "TOPRIGHT", 0, frameoffset - lastframeoffset)
- usedwidth = framewidth + usedwidth
- end
- @@ -772,11 +772,11 @@ AceGUI:RegisterLayout("Flow",
- if child.width == "fill" then
- safelayoutcall(child, "SetWidth", width)
- frame:SetPoint("RIGHT", content)
- -
- +
- usedwidth = 0
- rowstart = frame
- rowstartoffset = frameoffset
- -
- +
- if child.DoLayout then
- child:DoLayout()
- end
- @@ -785,7 +785,7 @@ AceGUI:RegisterLayout("Flow",
- rowstartoffset = rowoffset
- elseif child.width == "relative" then
- safelayoutcall(child, "SetWidth", width * child.relWidth)
- -
- +
- if child.DoLayout then
- child:DoLayout()
- end
- @@ -794,20 +794,20 @@ AceGUI:RegisterLayout("Flow",
- frame:SetPoint("RIGHT", content)
- end
- end
- -
- +
- if child.height == "fill" then
- frame:SetPoint("BOTTOM", content)
- isfullheight = true
- end
- end
- -
- +
- --anchor the last row, if its full height needs a special case since its height has just been changed by the anchor
- if isfullheight then
- rowstart:SetPoint("TOPLEFT", content, "TOPLEFT", 0, -height)
- elseif rowstart then
- rowstart:SetPoint("TOPLEFT", content, "TOPLEFT", 0, -(height + (rowoffset - rowstartoffset) + 3))
- end
- -
- +
- height = height + rowheight + 3
- safecall(content.obj.LayoutFinished, content.obj, nil, height)
- end)
- diff --git a/WeakAurasOptions/WeakAurasOptions.lua b/WeakAurasOptions/WeakAurasOptions.lua
- index 45ff269..df61836 100644
- --- a/WeakAurasOptions/WeakAurasOptions.lua
- +++ b/WeakAurasOptions/WeakAurasOptions.lua
- @@ -526,6 +526,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, subPrefix, subS
- options["use_"..name] = {
- type = "toggle",
- name = arg.display,
- + rowStart = true,
- desc = function()
- local v = trigger["use_"..realname];
- if(v == true) then
- @@ -572,6 +573,7 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, subPrefix, subS
- order = order,
- hidden = hidden,
- desc = arg.desc,
- + rowStart = true,
- get = function() return trigger["use_"..realname]; end,
- set = function(info, v)
- trigger["use_"..realname] = v;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement