Skip to content

Commit 67d3908

Browse files
committed
reimplement version check to dev builds
1 parent aeb6751 commit 67d3908

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

ElvUI/Core/General/Core.lua

+8-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ local LSM = E.Libs.LSM
6262
E.noop = function() end
6363
E.title = format('%s%s|r', E.InfoColor, 'ElvUI')
6464
E.toc = tonumber(GetAddOnMetadata('ElvUI', 'X-Interface'))
65-
E.version, E.versionString = E:ParseVersionString('ElvUI')
65+
E.version, E.versionString, E.versionDev, E.versionGit = E:ParseVersionString('ElvUI')
6666
E.myfaction, E.myLocalizedFaction = UnitFactionGroup('player')
6767
E.myLocalizedClass, E.myclass, E.myClassID = UnitClass('player')
6868
E.myLocalizedRace, E.myrace, E.myRaceID = UnitRace('player')
@@ -900,7 +900,7 @@ end
900900
do
901901
local SendMessageWaiting -- only allow 1 delay at a time regardless of eventing
902902
function E:SendMessage()
903-
if E.version < 99999 then
903+
if not E.versionGit then
904904
if IsInRaid() then
905905
C_ChatInfo_SendAddonMessage('ELVUI_VERSIONCHK', E.version, (not IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInRaid(LE_PARTY_CATEGORY_INSTANCE)) and 'INSTANCE_CHAT' or 'RAID')
906906
elseif IsInGroup() then
@@ -957,10 +957,13 @@ do
957957
_G.C_ChatInfo.RegisterAddonMessagePrefix('ELVUI_VERSIONCHK')
958958

959959
local f = CreateFrame('Frame')
960-
f:RegisterEvent('CHAT_MSG_ADDON')
961-
f:RegisterEvent('GROUP_ROSTER_UPDATE')
962-
f:RegisterEvent('PLAYER_ENTERING_WORLD')
963960
f:SetScript('OnEvent', SendRecieve)
961+
f:RegisterEvent('CHAT_MSG_ADDON')
962+
963+
if not E.versionGit then
964+
f:RegisterEvent('GROUP_ROSTER_UPDATE')
965+
f:RegisterEvent('PLAYER_ENTERING_WORLD')
966+
end
964967
end
965968

966969
function E:UpdateStart(skipCallback, skipUpdateDB)

ElvUI/Core/General/Tags.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ do
12011201
end
12021202

12031203
do
1204-
local highestVersion = E.version
1204+
local highestVersion = E.versionGit and 0 or E.version
12051205
E:AddTag('ElvUI-Users', 20, function(unit)
12061206
if E.UserList and next(E.UserList) then
12071207
local name, realm = UnitName(unit)
@@ -1212,6 +1212,7 @@ do
12121212
if highestVersion < userVersion then
12131213
highestVersion = userVersion
12141214
end
1215+
12151216
return (userVersion < highestVersion) and '|cffFF3333E|r' or '|cff3366ffE|r'
12161217
end
12171218
end

ElvUI/Core/Modules/Tooltip/Tooltip.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function TT:SetUnitText(tt, unit, isPlayerUnit)
292292
local addonUser = E.UserList[nameRealm]
293293
if addonUser then
294294
local same = addonUser == E.version
295-
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)
295+
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)
296296
end
297297
end
298298

ElvUI/Core/init.lua

+8-9
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
]]
66

77
local _G = _G
8-
local gsub, tinsert, next = gsub, tinsert, next
9-
local tostring, strfind, type, strsub = tostring, strfind, type, strsub
8+
local gsub, tinsert, next, type = gsub, tinsert, next, type
9+
local tostring, tonumber, strfind, strmatch = tostring, tonumber, strfind, strmatch
1010

1111
local CreateFrame = CreateFrame
1212
local GetBuildInfo = GetBuildInfo
@@ -114,13 +114,12 @@ do -- this is different from E.locale because we need to convert for ace locale
114114
end
115115

116116
function E:ParseVersionString(addon)
117-
local version = strsub(GetAddOnMetadata(addon, 'Version'), 2)
118-
if not strfind(version, '%-') then
119-
return tonumber(version), version
120-
elseif strfind(version, 'project%-version') then
121-
return 99999, 'Development'
117+
local version = GetAddOnMetadata(addon, 'Version')
118+
if strfind(version, 'project%-version') then
119+
return 99999, 'Development', nil, true
122120
else
123-
return 99999, version
121+
local release, extra = strmatch(version, '^v?([%d.]+)(.*)')
122+
return tonumber(release), release..extra, extra ~= ''
124123
end
125124
end
126125

@@ -351,4 +350,4 @@ function E:OnInitialize()
351350
elseif GetAddOnEnableState(E.myname, 'Tukui') == 2 then
352351
E:StaticPopup_Show('TUKUI_ELVUI_INCOMPATIBLE')
353352
end
354-
end
353+
end

0 commit comments

Comments
 (0)