Merge pull request #72 from gnwl/main

update announcing adjustments
This commit is contained in:
Lexie
2023-11-04 19:30:48 +11:00
committed by GitHub
+18 -31
View File
@@ -3830,26 +3830,31 @@ local remoteversion = tonumber(AtlasLoot_updateavailable) or 0
local loginchannels = { "BATTLEGROUND", "RAID", "GUILD" }
local groupchannels = { "BATTLEGROUND", "RAID" }
AtlasLoot_updater_ChatFrame_OnEvent = ChatFrame_OnEvent
AtlasLoot_updater = CreateFrame("Frame")
AtlasLoot_updater:RegisterEvent("CHAT_MSG_ADDON")
AtlasLoot_updater:RegisterEvent("CHAT_MSG_CHANNEL")
AtlasLoot_updater:RegisterEvent("PLAYER_ENTERING_WORLD")
AtlasLoot_updater:RegisterEvent("PARTY_MEMBERS_CHANGED")
function ChatFrame_OnEvent(event)
AtlasLoot_updater:SetScript("OnEvent", function()
if event == "CHAT_MSG_ADDON" and arg1 == "AtlasLoot" then
local v, remoteversion = AtlasLoot_strsplit(":", arg2)
local remoteversion = tonumber(remoteversion)
if remoteversion >= 40000 then remoteversion = 0 end --Block for people using some version from another version of WoW.
if v == "VERSION" and remoteversion then
if remoteversion > localversion then
AtlasLoot_updateavailable = remoteversion
if not alreadyshown then
DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasLoot]|r New version available! https://github.com/Lexiebean/AtlasLoot/")
alreadyshown = true
end
end
end
end
if event == "CHAT_MSG_CHANNEL" then
local type = strsub(event, 10)
local source = strsub(type,1,1)
if type == "CHANNEL" and arg4 then
_,_,source = string.find(arg4,"(%d+)%.")
end
if source then
_,name = GetChannelName(source)
end
local _,_,source = string.find(arg4,"(%d+)%.")
local _,name = GetChannelName(source)
if name == "LFT" then
local msg, v, remoteversion = AtlasLoot_strsplit(":", arg1)
if msg == "Atlasloot" then
@@ -3867,24 +3872,6 @@ function ChatFrame_OnEvent(event)
end
end
end
AtlasLoot_updater_ChatFrame_OnEvent(event);
end
AtlasLoot_updater:SetScript("OnEvent", function()
if event == "CHAT_MSG_ADDON" and arg1 == "AtlasLoot" then
local v, remoteversion = AtlasLoot_strsplit(":", arg2)
local remoteversion = tonumber(remoteversion)
if remoteversion >= 40000 then remoteversion = 0 end --Block for people using some version from another version of WoW.
if v == "VERSION" and remoteversion then
if remoteversion > localversion then
AtlasLoot_updateavailable = remoteversion
if not alreadyshown then
DEFAULT_CHAT_FRAME:AddMessage("|cffbe5eff[AtlasLoot]|r New version available! https://github.com/Lexiebean/AtlasLoot/")
alreadyshown = true
end
end
end
end
if event == "PARTY_MEMBERS_CHANGED" then
local groupsize = GetNumRaidMembers() > 0 and GetNumRaidMembers() or GetNumPartyMembers() > 0 and GetNumPartyMembers() or 0