Commit 21f033e0 authored by Simpy's avatar Simpy 🐹

surprise more ver check stuffs

parent 359667d8
......@@ -162,14 +162,16 @@ function lib:VersionCheck(event, prefix, message, _, sender)
if sender == lib.myName then return end
if not E.pluginRecievedOutOfDateMessage then
local name, version, plugin, Pname
local name, version, plugin, Pname, Pver, ver
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]
if (version ~= nil and plugin.version ~= nil and plugin.version ~= 'BETA') and (tonumber(version) ~= nil and tonumber(plugin.version) ~= nil) and (tonumber(version) > tonumber(plugin.version)) then
plugin.old, plugin.newversion = true, tonumber(version)
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.old, plugin.newversion = true, ver
Pname = GetAddOnMetadata(plugin.name, 'Title')
E:Print(format(MSG_OUTDATED,Pname,plugin.version,plugin.newversion))
ElvUI[1].pluginRecievedOutOfDateMessage = true
......
......@@ -934,14 +934,16 @@ 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 (not E.recievedOutOfDateMessage) and (msg ~= nil and msg > ver) 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) 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
E:StaticPopup_Show("ELVUI_UPDATE_AVAILABLE")
end
if msg ~= nil and ((msg - ver) >= 0.05) then
E:StaticPopup_Show("ELVUI_UPDATE_AVAILABLE")
end
E.recievedOutOfDateMessage = true
E.recievedOutOfDateMessage = true
end
elseif msg ~= nil and (msg < ver) then -- Send Message Back if you intercept and are higher revision
if not SendMessageTimer then
SendMessageTimer = E:ScheduleTimer('SendMessage', 10)
......
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