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