This commit is contained in:
Bunny67
2017-12-31 04:07:16 +03:00
parent a61017349c
commit 7b70d48d70
3 changed files with 14 additions and 17 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ function E:Grid(msg)
E.db.gridSize = msg E.db.gridSize = msg
E:Grid_Show() E:Grid_Show()
else else
if(EGrid) then if EGrid then
E:Grid_Hide() E:Grid_Hide()
else else
E:Grid_Show() E:Grid_Show()
+13 -14
View File
@@ -253,32 +253,31 @@ end
local waitTable = {} local waitTable = {}
local waitFrame local waitFrame
function E:Delay(delay, func, arg) function E:Delay(delay, func, ...)
if type(delay) ~= "number" or type(func) ~= "function" then if (type(delay) ~= "number") or (type(func) ~= "function") then
return false return false
end end
if waitFrame == nil then if waitFrame == nil then
waitFrame = CreateFrame("Frame","WaitFrame", E.UIParent) waitFrame = CreateFrame("Frame","WaitFrame", E.UIParent)
waitFrame:SetScript("OnUpdate", function () waitFrame:SetScript("onUpdate", function()
local elapse = arg1 local waitRecord, waitDelay, waitFunc, waitParams
local count = getn(waitTable) local i, count = 1, getn(waitTable)
local i = 1
while i <= count do while i <= count do
local waitRecord = tremove(waitTable, i) waitRecord = tremove(waitTable, i)
local d = tremove(waitRecord, 1) waitDelay = tremove(waitRecord, 1)
local f = tremove(waitRecord, 1) waitFunc = tremove(waitRecord, 1)
local p = tremove(waitRecord, 1) waitParams = tremove(waitRecord, 1)
if d > elapse then if waitDelay > arg1 then
tinsert(waitTable, i, {d-elapse, f, p}) tinsert(waitTable, i, {waitDelay - arg1, waitFunc, waitParams})
i = i + 1 i = i + 1
else else
count = count - 1 count = count - 1
f(unpack(p)) waitFunc(unpack(waitParams))
end end
end end
end) end)
end end
tinsert(waitTable, {delay, func, {arg}}) tinsert(waitTable, {delay, func, arg})
return true return true
end end
@@ -16,8 +16,6 @@ local function updateUnitWatch(frame)
if exists then if exists then
if not frame:IsShown() then if not frame:IsShown() then
frame:Show() frame:Show()
else
-- frame:UpdateAllElements('RefreshUnit')
end end
elseif frame:IsShown() then elseif frame:IsShown() then
frame:Hide() frame:Hide()