mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 16:34:45 +00:00
getn(arg) -> arg.n
This commit is contained in:
@@ -98,7 +98,7 @@ local function safecall(func, ...)
|
|||||||
-- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not
|
-- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not
|
||||||
-- present execution should continue without hinderance
|
-- present execution should continue without hinderance
|
||||||
if type(func) == "function" then
|
if type(func) == "function" then
|
||||||
return Dispatchers[getn(arg)](func, unpack(arg))
|
return Dispatchers[arg.n](func, unpack(arg))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ end
|
|||||||
-- @param addon addon object to embed the libs in
|
-- @param addon addon object to embed the libs in
|
||||||
-- @param lib List of libraries to embed into the addon
|
-- @param lib List of libraries to embed into the addon
|
||||||
function AceAddon:EmbedLibraries(addon, ...)
|
function AceAddon:EmbedLibraries(addon, ...)
|
||||||
for i=1,getn(arg) do
|
for i=1,arg.n do
|
||||||
local libname = arg[i]
|
local libname = arg[i]
|
||||||
self:EmbedLibrary(addon, libname, false, 4)
|
self:EmbedLibrary(addon, libname, false, 4)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ AceConsole.commands = AceConsole.commands or {} -- table containing commands reg
|
|||||||
AceConsole.weakcommands = AceConsole.weakcommands or {} -- table containing self, command => func references for weak commands that don't persist through enable/disable
|
AceConsole.weakcommands = AceConsole.weakcommands or {} -- table containing self, command => func references for weak commands that don't persist through enable/disable
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local tconcat, getn, tostring = table.concat, table.getn, tostring
|
local tconcat, tostring = table.concat, tostring
|
||||||
local type, pairs, error = type, pairs, error
|
local type, pairs, error = type, pairs, error
|
||||||
local format, strfind, strsub, upper, lower = string.format, string.find, string.sub, string.upper, string.lower
|
local format, strfind, strsub, upper, lower = string.format, string.find, string.sub, string.upper, string.lower
|
||||||
local max = math.max
|
local max = math.max
|
||||||
@@ -40,7 +40,7 @@ local function Print(self,frame,...)
|
|||||||
n=n+1
|
n=n+1
|
||||||
tmp[n] = "|cff33ff99"..tostring( self ).."|r:"
|
tmp[n] = "|cff33ff99"..tostring( self ).."|r:"
|
||||||
end
|
end
|
||||||
for i=1, getn(arg) do
|
for i=1, arg.n do
|
||||||
n=n+1
|
n=n+1
|
||||||
tmp[n] = tostring(arg[i])
|
tmp[n] = tostring(arg[i])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ local strbyte, strchar, gsub, gmatch, format = string.byte, string.char, string.
|
|||||||
local assert, error, pcall = assert, error, pcall
|
local assert, error, pcall = assert, error, pcall
|
||||||
local type, tostring, tonumber = type, tostring, tonumber
|
local type, tostring, tonumber = type, tostring, tonumber
|
||||||
local pairs, frexp = pairs, math.frexp
|
local pairs, frexp = pairs, math.frexp
|
||||||
local tconcat, getn = table.concat, table.getn
|
local tconcat = table.concat
|
||||||
|
|
||||||
-- quick copies of string representations of wonky numbers
|
-- quick copies of string representations of wonky numbers
|
||||||
local serNaN = tostring(0/0)
|
local serNaN = tostring(0/0)
|
||||||
@@ -116,7 +116,7 @@ local serializeTbl = { "^1" } -- "^1" = Hi, I'm data serialized by AceSerializer
|
|||||||
function AceSerializer:Serialize(...)
|
function AceSerializer:Serialize(...)
|
||||||
local nres = 1
|
local nres = 1
|
||||||
|
|
||||||
for i=1,getn(arg) do
|
for i=1,arg.n do
|
||||||
local v = arg[i]
|
local v = arg[i]
|
||||||
nres = SerializeValue(v, serializeTbl, nres)
|
nres = SerializeValue(v, serializeTbl, nres)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ local setmetatable, rawset, rawget = setmetatable, rawset, rawget
|
|||||||
local pairs, type, next, tostring, unpack = pairs, type, next, tostring, unpack
|
local pairs, type, next, tostring, unpack = pairs, type, next, tostring, unpack
|
||||||
local gsub = string.gsub
|
local gsub = string.gsub
|
||||||
local floor, max, min, fmod = math.floor, math.max, math.min, math.fmod
|
local floor, max, min, fmod = math.floor, math.max, math.min, math.fmod
|
||||||
local tconcat, getn = table.concat, table.getn
|
local tconcat = table.concat
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local GetTime = GetTime
|
local GetTime = GetTime
|
||||||
@@ -126,7 +126,7 @@ Dispatchers[0] = function(func)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function safecall(func, ...)
|
local function safecall(func, ...)
|
||||||
return Dispatchers[getn(arg)](func, unpack(arg))
|
return Dispatchers[arg.n](func, unpack(arg))
|
||||||
end
|
end
|
||||||
|
|
||||||
local lastint = floor(GetTime() * HZ)
|
local lastint = floor(GetTime() * HZ)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ local funcmsg = "expected function or member name"
|
|||||||
-- pickfirstset() - picks the first non-nil value and returns it
|
-- pickfirstset() - picks the first non-nil value and returns it
|
||||||
|
|
||||||
local function pickfirstset(...)
|
local function pickfirstset(...)
|
||||||
for i=1,getn(arg) do
|
for i=1,arg.n do
|
||||||
if arg[i]~=nil then
|
if arg[i]~=nil then
|
||||||
return arg[i]
|
return arg[i]
|
||||||
end
|
end
|
||||||
@@ -124,7 +124,7 @@ local function callfunction(info, tab, methodtype, ...)
|
|||||||
info.type = tab.type
|
info.type = tab.type
|
||||||
|
|
||||||
if type(method)=="function" then
|
if type(method)=="function" then
|
||||||
if getn(arg) > 0 then
|
if arg.n > 0 then
|
||||||
return method(info, unpack(arg))
|
return method(info, unpack(arg))
|
||||||
else
|
else
|
||||||
return method(info)
|
return method(info)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ Dispatchers[0] = function(func)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function safecall(func, ...)
|
local function safecall(func, ...)
|
||||||
return Dispatchers[getn(arg)](func, unpack(arg))
|
return Dispatchers[arg.n](func, unpack(arg))
|
||||||
end
|
end
|
||||||
|
|
||||||
local width_multiplier = 170
|
local width_multiplier = 170
|
||||||
@@ -140,7 +140,7 @@ end
|
|||||||
|
|
||||||
-- picks the first non-nil value and returns it
|
-- picks the first non-nil value and returns it
|
||||||
local function pickfirstset(...)
|
local function pickfirstset(...)
|
||||||
for i=1,getn(arg) do
|
for i=1,arg.n do
|
||||||
if arg[i]~=nil then
|
if arg[i]~=nil then
|
||||||
return arg[i]
|
return arg[i]
|
||||||
end
|
end
|
||||||
@@ -483,7 +483,7 @@ function AceConfigDialog:SelectGroup(appName, ...)
|
|||||||
local treevalue
|
local treevalue
|
||||||
local treestatus
|
local treestatus
|
||||||
|
|
||||||
for n = 1, getn(arg) do
|
for n = 1, arg.n do
|
||||||
local key = arg[n]
|
local key = arg[n]
|
||||||
|
|
||||||
if group.childGroups == "tab" or group.childGroups == "select" then
|
if group.childGroups == "tab" or group.childGroups == "select" then
|
||||||
@@ -600,7 +600,7 @@ local function confirmPopup(appName, rootframe, basepath, info, message, func, .
|
|||||||
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
|
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
|
||||||
del(info)
|
del(info)
|
||||||
end
|
end
|
||||||
local x = getn(arg)
|
local x = arg.n
|
||||||
for i = 1, x do
|
for i = 1, x do
|
||||||
t[i] = arg[i] or false
|
t[i] = arg[i] or false
|
||||||
end
|
end
|
||||||
@@ -1442,7 +1442,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function BuildPath(path, ...)
|
local function BuildPath(path, ...)
|
||||||
for i = 1, getn(arg) do
|
for i = 1, arg.n do
|
||||||
tinsert(path, arg[i])
|
tinsert(path, arg[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1849,7 +1849,7 @@ function AceConfigDialog:Open(appName, container, ...)
|
|||||||
tinsert(path, container)
|
tinsert(path, container)
|
||||||
container = nil
|
container = nil
|
||||||
end
|
end
|
||||||
for n = 1, getn(arg) do
|
for n = 1, arg.n do
|
||||||
tinsert(path, arg[n])
|
tinsert(path, arg[n])
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1959,7 +1959,7 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
|||||||
local BlizOptions = AceConfigDialog.BlizOptions
|
local BlizOptions = AceConfigDialog.BlizOptions
|
||||||
|
|
||||||
local key = appName
|
local key = appName
|
||||||
for n = 1, getn(arg) do
|
for n = 1, arg.n do
|
||||||
key = key.."\001"..arg[n]
|
key = key.."\001"..arg[n]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1974,9 +1974,9 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
|||||||
|
|
||||||
group:SetTitle(name or appName)
|
group:SetTitle(name or appName)
|
||||||
group:SetUserData("appName", appName)
|
group:SetUserData("appName", appName)
|
||||||
if getn(arg) > 0 then
|
if arg.n > 0 then
|
||||||
local path = {}
|
local path = {}
|
||||||
for n = 1, getn(arg) do
|
for n = 1, arg.n do
|
||||||
tinsert(path, arg[n])
|
tinsert(path, arg[n])
|
||||||
end
|
end
|
||||||
group:SetUserData("path", path)
|
group:SetUserData("path", path)
|
||||||
|
|||||||
+2
-2
@@ -23,7 +23,7 @@ if not AceConfigRegistry.callbacks then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local tinsert, tconcat, getn = table.insert, table.concat, table.getn
|
local tinsert, tconcat = table.insert, table.concat
|
||||||
local strfind, strmatch = string.find, string.match
|
local strfind, strmatch = string.find, string.match
|
||||||
local type, tostring, pairs, unpack = type, tostring, pairs, unpack
|
local type, tostring, pairs, unpack = type, tostring, pairs, unpack
|
||||||
local error, assert = error, assert
|
local error, assert = error, assert
|
||||||
@@ -44,7 +44,7 @@ AceConfigRegistry.validated = {
|
|||||||
|
|
||||||
local function err(msg, errlvl, ...)
|
local function err(msg, errlvl, ...)
|
||||||
local t = {}
|
local t = {}
|
||||||
for i=getn(arg),1,-1 do
|
for i=arg.n,1,-1 do
|
||||||
tinsert(t, arg[i])
|
tinsert(t, arg[i])
|
||||||
end
|
end
|
||||||
error(MAJOR..":ValidateOptionsTable(): "..tconcat(t,".")..msg, errlvl+2)
|
error(MAJOR..":ValidateOptionsTable(): "..tconcat(t,".")..msg, errlvl+2)
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ Dispatchers[0] = function(func)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function safecall(func, ...)
|
local function safecall(func, ...)
|
||||||
return Dispatchers[getn(arg)](func, unpack(arg))
|
return Dispatchers[arg.n](func, unpack(arg))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Recycling functions
|
-- Recycling functions
|
||||||
@@ -477,7 +477,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
WidgetContainerBase.AddChildren = function(self, ...)
|
WidgetContainerBase.AddChildren = function(self, ...)
|
||||||
for i = 1, getn(arg) do
|
for i = 1, arg.n do
|
||||||
local child = arg[i]
|
local child = arg[i]
|
||||||
tinsert(self.children, child)
|
tinsert(self.children, child)
|
||||||
child:SetParent(self)
|
child:SetParent(self)
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ local function FirstFrameUpdate()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function BuildUniqueValue(...)
|
local function BuildUniqueValue(...)
|
||||||
return tconcat(arg, "\001", 1, getn(arg))
|
return tconcat(arg, "\001", 1, arg.n)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[-----------------------------------------------------------------------------
|
--[[-----------------------------------------------------------------------------
|
||||||
@@ -539,7 +539,7 @@ local methods = {
|
|||||||
self.filter = false
|
self.filter = false
|
||||||
local status = self.status or self.localstatus
|
local status = self.status or self.localstatus
|
||||||
local groups = status.groups
|
local groups = status.groups
|
||||||
for i = 1, getn(arg) do
|
for i = 1, arg.n do
|
||||||
groups[tconcat(arg, "\001", 1, i)] = true
|
groups[tconcat(arg, "\001", 1, i)] = true
|
||||||
end
|
end
|
||||||
status.selected = uniquevalue
|
status.selected = uniquevalue
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
|||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local unpack = unpack
|
local unpack = unpack
|
||||||
local getn = table.getn
|
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local PlaySound = PlaySound
|
local PlaySound = PlaySound
|
||||||
@@ -228,7 +227,7 @@ local methods = {
|
|||||||
image:SetTexture(path)
|
image:SetTexture(path)
|
||||||
|
|
||||||
if image:GetTexture() then
|
if image:GetTexture() then
|
||||||
local n = getn(arg)
|
local n = arg.n
|
||||||
if n == 4 or n == 8 then
|
if n == 4 or n == 8 then
|
||||||
image:SetTexCoord(unpack(arg))
|
image:SetTexCoord(unpack(arg))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ local AceGUI = LibStub("AceGUI-3.0")
|
|||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local assert, unpack = assert, unpack
|
local assert, unpack = assert, unpack
|
||||||
local getn = table.getn
|
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local PlaySound = PlaySound
|
local PlaySound = PlaySound
|
||||||
@@ -14,7 +13,7 @@ local function fixlevels(parent, ...)
|
|||||||
local child
|
local child
|
||||||
local level = parent:GetFrameLevel() + 1
|
local level = parent:GetFrameLevel() + 1
|
||||||
|
|
||||||
for i = 1, getn(arg) do
|
for i = 1, arg.n do
|
||||||
child = arg[i]
|
child = arg[i]
|
||||||
child:SetFrameLevel(level)
|
child:SetFrameLevel(level)
|
||||||
fixlevels(child)
|
fixlevels(child)
|
||||||
@@ -25,7 +24,7 @@ local function fixstrata(strata, parent, ...)
|
|||||||
local child
|
local child
|
||||||
parent:SetFrameStrata(strata)
|
parent:SetFrameStrata(strata)
|
||||||
|
|
||||||
for i = 1, getn(arg) do
|
for i = 1, arg.n do
|
||||||
child = arg[i]
|
child = arg[i]
|
||||||
fixstrata(strata, child)
|
fixstrata(strata, child)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ local function fixlevels(parent, ...)
|
|||||||
local child
|
local child
|
||||||
local level = parent:GetFrameLevel() + 1
|
local level = parent:GetFrameLevel() + 1
|
||||||
|
|
||||||
for i = 1, getn(arg) do
|
for i = 1, arg.n do
|
||||||
child = arg[i]
|
child = arg[i]
|
||||||
child:SetFrameLevel(level)
|
child:SetFrameLevel(level)
|
||||||
fixlevels(child)
|
fixlevels(child)
|
||||||
@@ -31,7 +31,7 @@ local function fixstrata(strata, parent, ...)
|
|||||||
local child
|
local child
|
||||||
parent:SetFrameStrata(strata)
|
parent:SetFrameStrata(strata)
|
||||||
|
|
||||||
for i = 1, getn(arg) do
|
for i = 1, arg.n do
|
||||||
child = arg[i]
|
child = arg[i]
|
||||||
fixstrata(strata, child)
|
fixstrata(strata, child)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
|||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local pairs, print, unpack = pairs, print, unpack
|
local pairs, print, unpack = pairs, print, unpack
|
||||||
local getn = table.getn
|
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
@@ -59,7 +58,7 @@ local methods = {
|
|||||||
image:SetTexture(path)
|
image:SetTexture(path)
|
||||||
|
|
||||||
if image:GetTexture() then
|
if image:GetTexture() then
|
||||||
local n = getn(arg)
|
local n = arg.n
|
||||||
if n == 4 or n == 8 then
|
if n == 4 or n == 8 then
|
||||||
image:SetTexCoord(unpack(arg))
|
image:SetTexCoord(unpack(arg))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
|||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local pairs, unpack = pairs, unpack
|
local pairs, unpack = pairs, unpack
|
||||||
local getn = table.getn
|
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
@@ -50,7 +49,7 @@ local methods = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
["SetHighlightTexCoord"] = function(self, ...)
|
["SetHighlightTexCoord"] = function(self, ...)
|
||||||
local c = getn(arg)
|
local c = arg.n
|
||||||
if c == 4 or c == 8 then
|
if c == 4 or c == 8 then
|
||||||
self.highlight:SetTexCoord(unpack(arg))
|
self.highlight:SetTexCoord(unpack(arg))
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
|||||||
|
|
||||||
-- Lua APIs
|
-- Lua APIs
|
||||||
local max, pairs, unpack = math.max, pairs, unpack
|
local max, pairs, unpack = math.max, pairs, unpack
|
||||||
local getn = table.getn
|
|
||||||
|
|
||||||
-- WoW APIs
|
-- WoW APIs
|
||||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||||
@@ -112,7 +111,7 @@ local methods = {
|
|||||||
|
|
||||||
if image:GetTexture() then
|
if image:GetTexture() then
|
||||||
self.imageshown = true
|
self.imageshown = true
|
||||||
local n = getn(arg)
|
local n = arg.n
|
||||||
if n == 4 or n == 8 then
|
if n == 4 or n == 8 then
|
||||||
image:SetTexCoord(unpack(arg))
|
image:SetTexCoord(unpack(arg))
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user