Commit efa5e6bd authored by Simpy's avatar Simpy 🐹

rename variables so it's maybe more clear

parent d0b760ad
......@@ -112,8 +112,8 @@ function lib:DelayedSendVersionCheck()
ElvUI[1].SendPluginVersionCheck = SendVersionCheckMessage
end
if not lib.SendMessageTimer then
lib.SendMessageTimer = E:Delay(10, ElvUI[1].SendPluginVersionCheck)
if not lib.SendMessageWaiting then
lib.SendMessageWaiting = E:Delay(10, ElvUI[1].SendPluginVersionCheck)
end
end
......@@ -214,13 +214,13 @@ function lib:GeneratePluginList()
return list
end
function lib:ClearSendMessageTimer()
lib.SendMessageTimer = nil
function lib:ClearSendMessageWait()
lib.SendMessageWaiting = nil
end
function lib:SendPluginVersionCheck(message)
if (not message) or strmatch(message, '^%s-$') then
lib.ClearSendMessageTimer()
lib.ClearSendMessageWait()
return
end
......@@ -239,7 +239,7 @@ function lib:SendPluginVersionCheck(message)
end
if not ChatType then
lib.ClearSendMessageTimer()
lib.ClearSendMessageWait()
return
end
......@@ -255,10 +255,10 @@ function lib:SendPluginVersionCheck(message)
end
end
E:Delay(delay, lib.ClearSendMessageTimer)
E:Delay(delay, lib.ClearSendMessageWait)
else
C_ChatInfo_SendAddonMessage(lib.prefix, message, ChatType, Channel)
lib.ClearSendMessageTimer()
lib.ClearSendMessageWait()
end
end
......
......@@ -908,7 +908,7 @@ function E:SplitString(s, delim)
return unpack(t)
end
local SendMessageTimer -- prevent setting multiple timers at once
local SendMessageWaiting -- only allow 1 delay at a time regardless of eventing
function E:SendMessage()
if IsInRaid() then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, (not IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInRaid(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "RAID")
......@@ -923,7 +923,7 @@ function E:SendMessage()
end
end
SendMessageTimer = nil
SendMessageWaiting = nil
end
local SendRecieveGroupSize = 0
......@@ -945,8 +945,8 @@ local function SendRecieve(_, event, prefix, message, _, sender)
E.recievedOutOfDateMessage = true
end
elseif msg and (msg < ver) then -- Send Message Back if you intercept and are higher revision
if not SendMessageTimer then
SendMessageTimer = E:Delay(10, E.SendMessage)
if not SendMessageWaiting then
SendMessageWaiting = E:Delay(10, E.SendMessage)
end
end
end
......@@ -954,15 +954,15 @@ local function SendRecieve(_, event, prefix, message, _, sender)
local num = GetNumGroupMembers()
if num ~= SendRecieveGroupSize then
if num > 1 and num > SendRecieveGroupSize then
if not SendMessageTimer then
SendMessageTimer = E:Delay(10, E.SendMessage)
if not SendMessageWaiting then
SendMessageWaiting = E:Delay(10, E.SendMessage)
end
end
SendRecieveGroupSize = num
end
elseif event == "LOADING_SCREEN_DISABLED" then
if not SendMessageTimer then
SendMessageTimer = E:Delay(5, E.DelayedElvUIGVC)
if not SendMessageWaiting then
SendMessageWaiting = E:Delay(5, E.DelayedElvUIGVC)
end
end
end
......@@ -984,8 +984,8 @@ function E:DelayedElvUIGVC()
end
end
if not SendMessageTimer then
SendMessageTimer = E:Delay(5, E.SendMessage)
if not SendMessageWaiting then
SendMessageWaiting = E:Delay(5, E.SendMessage)
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment