Skip to content

Commit

Permalink
Fixes #514 - Taunt watcher not working outdoors
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Jun 3, 2024
1 parent 395f516 commit be06edf
Showing 1 changed file with 36 additions and 27 deletions.
63 changes: 36 additions & 27 deletions Modules/TauntWatcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ local TauntsList = {
204079, --Final Stand
}
local lastTimeStamp, lastSpellID, lastspellName = 0, 0, ''

local function printFormattedString(who, target, sid, failed)
local msg = module.DB.text
local ChatChannel = module.DB.announceLocation
Expand All @@ -34,42 +33,52 @@ local function printFormattedString(who, target, sid, failed)
if ChatChannel == 'SELF' then
SUI:Print(msg)
else
if not IsInGroup(2) then
if IsInRaid() then
if ChatChannel == 'INSTANCE_CHAT' then ChatChannel = 'RAID' end
elseif IsInGroup(1) then
if ChatChannel == 'INSTANCE_CHAT' then ChatChannel = 'PARTY' end
end
elseif IsInGroup(2) then
if ChatChannel == 'RAID' then ChatChannel = 'INSTANCE_CHAT' end
if ChatChannel == 'PARTY' then ChatChannel = 'INSTANCE_CHAT' end
end
local inInstanceGroup = IsInGroup(2)
local inInstanceRaid = IsInRaid(2)
local inGroup = IsInGroup(1)
local inRaid = IsInRaid(1)

if ChatChannel == 'SMART' then
ChatChannel = 'RAID'
if ChatChannel == 'RAID' and not IsInRaid() then ChatChannel = 'PARTY' end
-- Handle group type and location
if ChatChannel == 'RAID' and not inRaid then
return
elseif ChatChannel == 'PARTY' and not inGroup then
return
end

if ChatChannel == 'PARTY' and not IsInGroup(1) then ChatChannel = 'SAY' end
-- Adjust ChatChannel for instance groups
if inInstanceGroup then
if ChatChannel == 'RAID' and inInstanceRaid then
ChatChannel = 'INSTANCE_CHAT'
elseif ChatChannel == 'PARTY' and not inInstanceRaid then
ChatChannel = 'INSTANCE_CHAT'
end
else
if inRaid and ChatChannel == 'INSTANCE_CHAT' then
ChatChannel = 'RAID'
elseif inGroup and ChatChannel == 'INSTANCE_CHAT' then
ChatChannel = 'PARTY'
end
end

if ChatChannel == 'INSTANCE_CHAT' and not IsInGroup(2) then ChatChannel = 'SAY' end
-- Simplified SMART channel logic
if module.DB.announceLocation == 'SMART' then
if inInstanceRaid or inInstanceGroup then
ChatChannel = 'INSTANCE_CHAT'
elseif inRaid then
ChatChannel = 'RAID'
elseif inGroup then
ChatChannel = 'PARTY'
else
SUI:Print(msg)
return
end
end

SendChatMessage(msg, ChatChannel)
end
end

function module:OnInitialize()
if SUI.IsClassic or SUI.IsTBC then
TauntsList = {
-- Warrior taunt
'Taunt',
-- Warrior improved taunt
'Improved Taunt',
-- Druid Growl ranks
'Challenging Roar',
'Growl',
}
end
local defaults = {
profile = {
active = {
Expand Down

0 comments on commit be06edf

Please sign in to comment.