This commit is contained in:
Bunny67
2018-07-13 17:31:57 +03:00
parent 89e48a1432
commit c9f6edcd9b
13 changed files with 21 additions and 59 deletions
+1 -3
View File
@@ -338,9 +338,7 @@ function E:CreateMover(parent, name, text, overlay, snapoffset, postdrag, moverT
E.CreatedMovers[name]["shouldDisable"] = shouldDisable E.CreatedMovers[name]["shouldDisable"] = shouldDisable
E.CreatedMovers[name]["type"] = {} E.CreatedMovers[name]["type"] = {}
local types = {split(",", moverTypes)} for _, moverType in {split(",", moverTypes)} do
for i = 1, getn(types) do
local moverType = types[i]
E.CreatedMovers[name]["type"][moverType] = true E.CreatedMovers[name]["type"][moverType] = true
end end
end end
+4 -4
View File
@@ -931,7 +931,7 @@ function E:RegisterModule(name, loadFunc)
--Add module name to registry --Add module name to registry
self.ModuleCallbacks[name] = true self.ModuleCallbacks[name] = true
self.ModuleCallbacks["CallPriority"][getn(self.ModuleCallbacks["CallPriority"]) + 1] = name tinsert(self.ModuleCallbacks["CallPriority"], name)
--Register loadFunc to be called when event is fired --Register loadFunc to be called when event is fired
E:RegisterCallback(name, loadFunc, E:GetModule(name)) E:RegisterCallback(name, loadFunc, E:GetModule(name))
@@ -941,7 +941,7 @@ function E:RegisterModule(name, loadFunc)
if self.initialized then if self.initialized then
self:GetModule(name):Initialize() self:GetModule(name):Initialize()
else else
self["RegisteredModules"][getn(self["RegisteredModules"]) + 1] = name tinsert(self["RegisteredModules"], name)
end end
end end
end end
@@ -957,13 +957,13 @@ function E:RegisterInitialModule(name, loadFunc)
--Add module name to registry --Add module name to registry
self.InitialModuleCallbacks[name] = true self.InitialModuleCallbacks[name] = true
self.InitialModuleCallbacks["CallPriority"][getn(self.InitialModuleCallbacks["CallPriority"]) + 1] = name tinsert(self.InitialModuleCallbacks["CallPriority"], name)
--Register loadFunc to be called when event is fired --Register loadFunc to be called when event is fired
E:RegisterCallback(name, loadFunc, E:GetModule(name)) E:RegisterCallback(name, loadFunc, E:GetModule(name))
--Old deprecated initialize method --Old deprecated initialize method
else else
self["RegisteredInitialModules"][getn(self["RegisteredInitialModules"]) + 1] = name tinsert(self["RegisteredInitialModules"], name)
end end
end end
@@ -117,8 +117,7 @@ function AceSerializer:Serialize(...)
local nres = 1 local nres = 1
for i = 1, arg.n do for i = 1, arg.n do
local v = select(i, unpack(arg)) nres = SerializeValue(arg[i], serializeTbl, nres)
nres = SerializeValue(v, serializeTbl, nres)
end end
serializeTbl[nres+1] = "^^" -- "^^" = End of serialized data serializeTbl[nres+1] = "^^" -- "^^" = End of serialized data
@@ -14,6 +14,7 @@ end
local pairs, select, tonumber = pairs, select, tonumber local pairs, select, tonumber = pairs, select, tonumber
local find, gsub, match, lower = string.find, string.gsub, string.match, string.lower local find, gsub, match, lower = string.find, string.gsub, string.match, string.lower
local getn = table.getn
local GetItemInfo = GetItemInfo local GetItemInfo = GetItemInfo
+3 -38
View File
@@ -36,41 +36,6 @@ local function enableTargetUpdate(object)
end end
Private.enableTargetUpdate = enableTargetUpdate Private.enableTargetUpdate = enableTargetUpdate
local function updateActiveUnit(self, event, unit)
return true
end
local function iterateChildren(...)
for i = 1, getn(arg) do
local obj = arg[i]
if(type(obj) == "table" and obj.isChild) then
updateActiveUnit(obj, "iterateChildren")
end
end
end
local function onAttributeChanged(self, name, value)
if(name == "unit" and value) then
if(self.hasChildren) then
iterateChildren(self:GetChildren())
end
if(not self.onlyProcessChildren) then
updateActiveUnit(self, "OnAttributeChanged")
end
if(self.unit and self.unit == value) then
return
else
if(self.hasChildren) then
iterateChildren(self:GetChildren())
end
end
end
end
local frame_metatable = { local frame_metatable = {
__index = CreateFrame("Button") __index = CreateFrame("Button")
} }
@@ -278,7 +243,7 @@ local function onShow(self)
end end
local function initObject(unit, style, styleFunc, header, ...) local function initObject(unit, style, styleFunc, header, ...)
local num = getn(arg) local num = arg.n
for i = 1, num do for i = 1, num do
local object = arg[i] local object = arg[i]
local objectUnit = object.guessUnit or unit local objectUnit = object.guessUnit or unit
@@ -452,8 +417,8 @@ do
function getCondition(...) function getCondition(...)
local cond = "" local cond = ""
for i = 1, getn(arg) do for i = 1, arg.n do
local short = select(i, unpack(arg)) local short = arg[i]
local condition = conditions[short] local condition = conditions[short]
if(condition) then if(condition) then
+1 -2
View File
@@ -5,8 +5,7 @@ function Private.argcheck(value, num, ...)
assert(type(num) == 'number', "Bad argument #2 to 'argcheck' (number expected, got " .. type(num) .. ')') assert(type(num) == 'number', "Bad argument #2 to 'argcheck' (number expected, got " .. type(num) .. ')')
for i = 1, arg.n do for i = 1, arg.n do
-- if(type(value) == arg[i]) then return end if(type(value) == arg[i]) then return end
if(type(value) == select(i, unpack(arg))) then return end
end end
local types = strjoin(', ', unpack(arg)) local types = strjoin(', ', unpack(arg))
@@ -3,7 +3,7 @@ local oUF = ns.oUF
assert(oUF, "oUF not loaded") assert(oUF, "oUF not loaded")
local cos, sin, sqrt2, max, atan2 = math.cos, math.sin, math.sqrt(2), math.max, math.atan2 local cos, sin, sqrt2, max, atan2 = math.cos, math.sin, math.sqrt(2), math.max, math.atan2
local tinsert, tremove = table.insert, table.remove local getn, tinsert, tremove = table.getn, table.insert, table.remove
local pi2 = 3.141592653589793 / 2 local pi2 = 3.141592653589793 / 2
local GetPlayerMapPosition = GetPlayerMapPosition local GetPlayerMapPosition = GetPlayerMapPosition
+1 -1
View File
@@ -9,7 +9,7 @@ local _G = _G
local unpack, select, pairs, ipairs = unpack, select, pairs, ipairs local unpack, select, pairs, ipairs = unpack, select, pairs, ipairs
local floor, min, max, huge = math.floor, math.min, math.max, math.huge local floor, min, max, huge = math.floor, math.min, math.max, math.huge
local format = string.format local format = string.format
local wipe, tinsert, tsort, tremove = table.wipe, table.insert, table.sort, table.remove local getn, wipe, tinsert, tsort, tremove = table.getn, table.wipe, table.insert, table.sort, table.remove
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetInventoryItemQuality = GetInventoryItemQuality local GetInventoryItemQuality = GetInventoryItemQuality
+1 -1
View File
@@ -5,7 +5,7 @@ local Search = LibStub("LibItemSearch-1.2");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local ipairs, pairs, pcall, tonumber, select, unpack = ipairs, pairs, pcall, tonumber, select, unpack local ipairs, pairs, pcall, tonumber, select, unpack = ipairs, pairs, pcall, tonumber, select, unpack
local tinsert, tremove, tsort, twipe = table.insert, table.remove, table.sort, table.wipe local getn, tinsert, tremove, tsort, twipe = table.getn, table.insert, table.remove, table.sort, table.wipe
local floor, mod = math.floor, math.mod local floor, mod = math.floor, math.mod
local band = bit.band local band = bit.band
local match, gmatch, find = string.match, string.gmatch, string.find local match, gmatch, find = string.match, string.gmatch, string.find
+2 -2
View File
@@ -1,5 +1,5 @@
local E, L, V, P, G = unpack(ElvUI) --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins") local S = E:GetModule("Skins");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
+2 -2
View File
@@ -1,5 +1,5 @@
local E, L, V, P, G = unpack(ElvUI) --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins") local S = E:GetModule("Skins");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
+2 -2
View File
@@ -535,7 +535,7 @@ function S:AddCallbackForAddon(addonName, eventName, loadFunc, forceLoad, bypass
else else
--Insert eventName in this addons' registry --Insert eventName in this addons' registry
self.addonCallbacks[addonName][eventName] = true self.addonCallbacks[addonName][eventName] = true
self.addonCallbacks[addonName]["CallPriority"][getn(self.addonCallbacks[addonName]["CallPriority"]) + 1] = eventName tinsert(self.addonCallbacks[addonName]["CallPriority"], eventName)
end end
end end
@@ -558,7 +558,7 @@ function S:AddCallback(eventName, loadFunc)
--Add event name to registry --Add event name to registry
self.nonAddonCallbacks[eventName] = true self.nonAddonCallbacks[eventName] = true
self.nonAddonCallbacks["CallPriority"][getn(self.nonAddonCallbacks["CallPriority"]) + 1] = eventName tinsert(self.nonAddonCallbacks["CallPriority"], eventName)
--Register loadFunc to be called when event is fired --Register loadFunc to be called when event is fired
E.RegisterCallback(E, eventName, loadFunc) E.RegisterCallback(E, eventName, loadFunc)
+1 -1
View File
@@ -5,7 +5,7 @@ local TT = E:NewModule("Tooltip", "AceHook-3.0", "AceEvent-3.0");
--Lua functions --Lua functions
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
local twipe, tinsert, tconcat = table.wipe, table.insert, table.concat local getn, twipe, tinsert, tconcat = table.getn, table.wipe, table.insert, table.concat
local floor = math.floor local floor = math.floor
local find, format, match = string.find, string.format, string.match local find, format, match = string.find, string.format, string.match
--WoW API / Variables --WoW API / Variables