From 4f370f4e636efa2327bcee5a6ea053a9a7437d36 Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Tue, 15 Jun 2021 09:05:50 +0200 Subject: [PATCH] send version check by group type --- Modules/VersionCheck.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Modules/VersionCheck.lua b/Modules/VersionCheck.lua index 991fecc..45bd3da 100644 --- a/Modules/VersionCheck.lua +++ b/Modules/VersionCheck.lua @@ -1,6 +1,8 @@ local str_match, tonumber, tostring = string.match, tonumber, tostring local UnitName = UnitName +local IsInGroup, IsInRaid = IsInGroup, IsInRaid +local LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_HOME, LE_PARTY_CATEGORY_INSTANCE local Gladdy = LibStub("Gladdy") local L = Gladdy.L @@ -21,6 +23,13 @@ end function VersionCheck:JOINED_ARENA() self:RegisterComm("GladdyVCheck", VersionCheck.OnCommReceived) + if IsInRaid(LE_PARTY_CATEGORY_HOME) then + self:SendCommMessage("GladdyVCheck", tostring(Gladdy.version_num), "RAID", self.playerName) + elseif IsInGroup(LE_PARTY_CATEGORY_INSTANCE) or IsInRaid(LE_PARTY_CATEGORY_INSTANCE) then + self:SendCommMessage("GladdyVCheck", tostring(Gladdy.version_num), "INSTANCE_CHAT", self.playerName) + elseif IsInGroup(LE_PARTY_CATEGORY_HOME) then + self:SendCommMessage("GladdyVCheck", tostring(Gladdy.version_num), "PARTY", self.playerName) + end end function VersionCheck:Test(unit) @@ -39,7 +48,7 @@ function VersionCheck.OnCommReceived(prefix, message, distribution, sender) else Gladdy:Warn("Current version", "\"".. addonVersion.."\"", "is outdated. Most recent version is", "\"".. message.."\"") Gladdy:Warn("Please download the latest Gladdy version at:") - Gladdy:Warn("https://github.com/XiconQoo/Gladdy-TBC") + Gladdy:Warn("https://www.curseforge.com/wow/addons/gladdy-tbc or https://github.com/XiconQoo/Gladdy-TBC") end end end