Commit 9dbc8437 authored by Simpy's avatar Simpy 🐹

ver check: dont bother with group checking

parent a0fb5f70
......@@ -7,14 +7,11 @@ if not lib then return end
local pairs, tonumber, strmatch, strsub = pairs, tonumber, strmatch, strsub
local format, strsplit, strlen, gsub, ceil = format, strsplit, strlen, gsub, ceil
--WoW API / Variables
local GetLocale = GetLocale
local GetLocale, IsInGuild = GetLocale, IsInGuild
local CreateFrame, IsAddOnLoaded = CreateFrame, IsAddOnLoaded
local IsInGroup, IsInRaid, IsInGuild = IsInGroup, IsInRaid, IsInGuild
local GetAddOnMetadata, GetChannelName = GetAddOnMetadata, GetChannelName
local C_ChatInfo_RegisterAddonMessagePrefix = C_ChatInfo.RegisterAddonMessagePrefix
local C_ChatInfo_SendAddonMessage = C_ChatInfo.SendAddonMessage
local LE_PARTY_CATEGORY_HOME = LE_PARTY_CATEGORY_HOME
local LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_INSTANCE
--Global variables that we don't cache, list them here for the mikk's Find Globals script
-- GLOBALS: ElvUI
......@@ -213,17 +210,11 @@ function lib:SendPluginVersionCheck(message)
if (not message) or strmatch(message, "^%s-$") then return end
local ChatType, Channel
if IsInRaid() then
ChatType = (not IsInRaid(LE_PARTY_CATEGORY_HOME) and IsInRaid(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "RAID"
elseif IsInGroup() then
ChatType = (not IsInGroup(LE_PARTY_CATEGORY_HOME) and IsInGroup(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "PARTY"
else
local ElvUIGVC = GetChannelName('ElvUIGVC')
if ElvUIGVC and ElvUIGVC > 0 then
ChatType, Channel = "CHANNEL", ElvUIGVC
elseif IsInGuild() then
ChatType = "GUILD"
end
local ElvUIGVC = GetChannelName('ElvUIGVC')
if ElvUIGVC and ElvUIGVC > 0 then
ChatType, Channel = "CHANNEL", ElvUIGVC
elseif IsInGuild() then
ChatType = "GUILD"
end
local delay, maxChar, msgLength = 0, 250, strlen(message)
......
......@@ -23,7 +23,7 @@ local GetSpecialization, GetActiveSpecGroup = GetSpecialization, GetActiveSpecGr
local GetSpecializationRole = GetSpecializationRole
local InCombatLockdown = InCombatLockdown
local IsAddOnLoaded, DisableAddOn = IsAddOnLoaded, DisableAddOn
local IsInInstance, IsInGroup, IsInRaid, IsInGuild = IsInInstance, IsInGroup, IsInRaid, IsInGuild
local IsInInstance, IsInGuild = IsInInstance, IsInGuild
local RequestBattlefieldScoreData = RequestBattlefieldScoreData
local C_ChatInfo_SendAddonMessage = C_ChatInfo.SendAddonMessage
local UnitGroupRolesAssigned = UnitGroupRolesAssigned
......@@ -33,8 +33,6 @@ local JoinPermanentChannel = JoinPermanentChannel
local UnitLevel, UnitStat, UnitAttackPower = UnitLevel, UnitStat, UnitAttackPower
local COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN = COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN
local ERR_NOT_IN_COMBAT = ERR_NOT_IN_COMBAT
local LE_PARTY_CATEGORY_HOME = LE_PARTY_CATEGORY_HOME
local LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_INSTANCE
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local UnitFactionGroup = UnitFactionGroup
local GetChannelList = GetChannelList
......@@ -907,17 +905,11 @@ function E:SplitString(s, delim)
end
function E:SendMessage()
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
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, (not IsInGroup(LE_PARTY_CATEGORY_HOME) and IsInGroup(LE_PARTY_CATEGORY_INSTANCE)) and "INSTANCE_CHAT" or "PARTY")
else
local ElvUIGVC = GetChannelName('ElvUIGVC')
if ElvUIGVC and ElvUIGVC > 0 then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, "CHANNEL", ElvUIGVC)
elseif IsInGuild() then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, "GUILD")
end
local ElvUIGVC = GetChannelName('ElvUIGVC')
if ElvUIGVC and ElvUIGVC > 0 then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, "CHANNEL", ElvUIGVC)
elseif IsInGuild() then
C_ChatInfo_SendAddonMessage("ELVUI_VERSIONCHK", E.version, "GUILD")
end
end
......
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