diff --git a/ElvUI/Core/General/Core.lua b/ElvUI/Core/General/Core.lua index 2fdf2a6bc7..860ab83593 100644 --- a/ElvUI/Core/General/Core.lua +++ b/ElvUI/Core/General/Core.lua @@ -62,7 +62,7 @@ local LSM = E.Libs.LSM E.noop = function() end E.title = format('%s%s|r', E.InfoColor, 'ElvUI') E.toc = tonumber(GetAddOnMetadata('ElvUI', 'X-Interface')) -E.version, E.versionString = E:ParseVersionString('ElvUI') +E.version, E.versionString, E.versionDev, E.versionGit = E:ParseVersionString('ElvUI') E.myfaction, E.myLocalizedFaction = UnitFactionGroup('player') E.myLocalizedClass, E.myclass, E.myClassID = UnitClass('player') E.myLocalizedRace, E.myrace, E.myRaceID = UnitRace('player') @@ -900,7 +900,7 @@ end do local SendMessageWaiting -- only allow 1 delay at a time regardless of eventing function E:SendMessage() - if E.version < 99999 then + if not E.versionGit then 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') elseif IsInGroup() then @@ -957,10 +957,13 @@ do _G.C_ChatInfo.RegisterAddonMessagePrefix('ELVUI_VERSIONCHK') local f = CreateFrame('Frame') - f:RegisterEvent('CHAT_MSG_ADDON') - f:RegisterEvent('GROUP_ROSTER_UPDATE') - f:RegisterEvent('PLAYER_ENTERING_WORLD') f:SetScript('OnEvent', SendRecieve) + f:RegisterEvent('CHAT_MSG_ADDON') + + if not E.versionGit then + f:RegisterEvent('GROUP_ROSTER_UPDATE') + f:RegisterEvent('PLAYER_ENTERING_WORLD') + end end function E:UpdateStart(skipCallback, skipUpdateDB) diff --git a/ElvUI/Core/General/Tags.lua b/ElvUI/Core/General/Tags.lua index ce1ed99f85..274a93e65a 100644 --- a/ElvUI/Core/General/Tags.lua +++ b/ElvUI/Core/General/Tags.lua @@ -1201,7 +1201,7 @@ do end do - local highestVersion = E.version + local highestVersion = E.versionGit and 0 or E.version E:AddTag('ElvUI-Users', 20, function(unit) if E.UserList and next(E.UserList) then local name, realm = UnitName(unit) @@ -1212,6 +1212,7 @@ do if highestVersion < userVersion then highestVersion = userVersion end + return (userVersion < highestVersion) and '|cffFF3333E|r' or '|cff3366ffE|r' end end diff --git a/ElvUI/Core/Modules/Tooltip/Tooltip.lua b/ElvUI/Core/Modules/Tooltip/Tooltip.lua index d8a748e486..82226cfaf3 100644 --- a/ElvUI/Core/Modules/Tooltip/Tooltip.lua +++ b/ElvUI/Core/Modules/Tooltip/Tooltip.lua @@ -292,7 +292,7 @@ function TT:SetUnitText(tt, unit, isPlayerUnit) local addonUser = E.UserList[nameRealm] if addonUser then local same = addonUser == E.version - tt:AddDoubleLine(L["ElvUI Version:"], format('%.2f', addonUser), nil, nil, nil, same and 0.2 or 1, same and 1 or 0.2, 0.2) + tt:AddDoubleLine(L["ElvUI Version:"], format('%.2f', addonUser), nil, nil, nil, E.versionGit and 1 or same and 0.2 or 1, E.versionGit and 1 or same and 1 or 0.2, E.versionGit and 1 or 0.2) end end diff --git a/ElvUI/Core/init.lua b/ElvUI/Core/init.lua index 39c56d5e09..7f9a857ca3 100644 --- a/ElvUI/Core/init.lua +++ b/ElvUI/Core/init.lua @@ -5,8 +5,8 @@ ]] local _G = _G -local gsub, tinsert, next = gsub, tinsert, next -local tostring, strfind, type, strsub = tostring, strfind, type, strsub +local gsub, tinsert, next, type = gsub, tinsert, next, type +local tostring, tonumber, strfind, strmatch = tostring, tonumber, strfind, strmatch local CreateFrame = CreateFrame local GetBuildInfo = GetBuildInfo @@ -114,13 +114,12 @@ do -- this is different from E.locale because we need to convert for ace locale end function E:ParseVersionString(addon) - local version = strsub(GetAddOnMetadata(addon, 'Version'), 2) - if not strfind(version, '%-') then - return tonumber(version), version - elseif strfind(version, 'project%-version') then - return 99999, 'Development' + local version = GetAddOnMetadata(addon, 'Version') + if strfind(version, 'project%-version') then + return 99999, 'Development', nil, true else - return 99999, version + local release, extra = strmatch(version, '^v?([%d.]+)(.*)') + return tonumber(release), release..extra, extra ~= '' end end @@ -351,4 +350,4 @@ function E:OnInitialize() elseif GetAddOnEnableState(E.myname, 'Tukui') == 2 then E:StaticPopup_Show('TUKUI_ELVUI_INCOMPATIBLE') end -end \ No newline at end of file +end