Commit eb3b1ff3 authored by Simpy's avatar Simpy 🐹

surprise more ver check stuffs 💃

parent fe54d26b
......@@ -16,6 +16,7 @@ local LE_PARTY_CATEGORY_HOME = LE_PARTY_CATEGORY_HOME
local LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_INSTANCE
local C_ChatInfo_RegisterAddonMessagePrefix = C_ChatInfo.RegisterAddonMessagePrefix
local C_ChatInfo_SendAddonMessage = C_ChatInfo.SendAddonMessage
local UNKNOWN = UNKNOWN
--Global variables that we don't cache, list them here for the mikk's Find Globals script
-- GLOBALS: ElvUI
......@@ -166,13 +167,13 @@ function lib:VersionCheck(event, prefix, message, _, sender)
for _, p in pairs({strsplit(';',message)}) do
if not strmatch(p, '^%s-$') then
name, version = strmatch(p, '([%w_]+)=([%d%p]+)')
if lib.plugins[name] then
plugin = lib.plugins[name]
Pver = tonumber(plugin.version)
ver = tonumber(version)
if (version ~= nil and plugin.version ~= nil and plugin.version ~= 'BETA') and (ver ~= nil and Pver ~= nil) and (ver > Pver) then
plugin = name and lib.plugins[name]
if version and plugin and plugin.version and (plugin.version ~= 'BETA') then
Pver, ver = tonumber(plugin.version), tonumber(version)
if (ver and Pver) and (ver > Pver) then
plugin.old, plugin.newversion = true, ver
Pname = GetAddOnMetadata(plugin.name, 'Title')
Pname = plugin.name and GetAddOnMetadata(plugin.name, 'Title') or UNKNOWN
E:Print(format(MSG_OUTDATED,Pname,plugin.version,plugin.newversion))
ElvUI[1].pluginRecievedOutOfDateMessage = true
end
......
......@@ -934,17 +934,17 @@ local function SendRecieve(_, event, prefix, message, _, sender)
if sender == myName then return end
if prefix == "ELVUI_VERSIONCHK" then
local msg, ver = tonumber(message), tonumber(E.version)
if msg ~= nil and (msg > ver) then -- you're outdated D:
if msg and (msg > ver) then -- you're outdated D:
if not E.recievedOutOfDateMessage then
E:Print(L["ElvUI is out of date. You can download the newest version from www.tukui.org. Get premium membership and have ElvUI automatically updated with the Tukui Client!"])
if msg ~= nil and ((msg - ver) >= 0.05) then
if msg and ((msg - ver) >= 0.05) then
E:StaticPopup_Show("ELVUI_UPDATE_AVAILABLE")
end
E.recievedOutOfDateMessage = true
end
elseif msg ~= nil and (msg < ver) then -- Send Message Back if you intercept and are higher revision
elseif msg and (msg < ver) then -- Send Message Back if you intercept and are higher revision
if not SendMessageTimer then
SendMessageTimer = E:ScheduleTimer('SendMessage', 10)
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