Skip to content

Commit

Permalink
update raid utility to work regardless of having leader/assist
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Apr 13, 2024
1 parent f38ee28 commit c20d4df
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 60 deletions.
2 changes: 1 addition & 1 deletion ElvUI/Core/Modules/Chat/Chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ do --this can save some main file locals
--Thradex: summer without you
local ThradexColors = function(t) return specialText(t, 0.00,0.60,0.09, 0.22,0.65,0.90, 0.22,0.65,0.90, 1.00,0.74,0.27, 1.00,0.66,0.00, 1.00,0.50,0.20, 0.92,0.31,0.23) end
--Repooc: Something to change it up a little
local PoocsColors = function(t) return specialText(t, 0.90, 0.8, 0.50) end
local PoocsColors = function(t) return specialText(t, 0.9,0.8,0.5) end

itsSimpy = function() return ElvSimpy, SimpyColors end
itsElv = function() return ElvBlue, ElvColors end
Expand Down
26 changes: 17 additions & 9 deletions ElvUI/Core/Modules/Misc/Misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ local SendChatMessage = SendChatMessage
local StaticPopup_Hide = StaticPopup_Hide
local StaticPopupSpecial_Hide = StaticPopupSpecial_Hide
local UninviteUnit = UninviteUnit
local UnitExists = UnitExists
local UnitGUID = UnitGUID
local UnitInRaid = UnitInRaid
local UnitName = UnitName
local IsInGuild = IsInGuild
local PlaySound = PlaySound
local GetNumFactions = GetNumFactions
local GetFactionInfo = GetFactionInfo
local UnitIsGroupLeader = UnitIsGroupLeader
local GetWatchedFactionInfo = GetWatchedFactionInfo
local ExpandAllFactionHeaders = ExpandAllFactionHeaders
local SetWatchedFactionIndex = SetWatchedFactionIndex
Expand All @@ -58,6 +58,7 @@ local IsFriend = C_FriendList.IsFriend

local LE_GAME_ERR_GUILD_NOT_ENOUGH_MONEY = LE_GAME_ERR_GUILD_NOT_ENOUGH_MONEY
local LE_GAME_ERR_NOT_ENOUGH_MONEY = LE_GAME_ERR_NOT_ENOUGH_MONEY
local LE_PARTY_CATEGORY_HOME = LE_PARTY_CATEGORY_HOME
local MAX_PARTY_MEMBERS = MAX_PARTY_MEMBERS
local UNKNOWN = UNKNOWN

Expand Down Expand Up @@ -218,17 +219,24 @@ end
function M:DisbandRaidGroup()
if InCombatLockdown() then return end -- Prevent user error in combat

if UnitInRaid('player') then
for i = 1, GetNumGroupMembers() do
local name, _, _, _, _, _, _, online = GetRaidRosterInfo(i)
if online and name ~= E.myname then
UninviteUnit(name)
local myIndex = UnitInRaid('player')
if myIndex then
local _, myRank = GetRaidRosterInfo(myIndex)
if myRank == 2 then -- real raid leader
for i = 1, GetNumGroupMembers() do
if i ~= myIndex then -- dont kick yourself
local name = GetRaidRosterInfo(i)
if name then
UninviteUnit(name)
end
end
end
end
else
elseif not myIndex and UnitIsGroupLeader('player', LE_PARTY_CATEGORY_HOME) then
for i = MAX_PARTY_MEMBERS, 1, -1 do
if UnitExists('party'..i) then
UninviteUnit(UnitName('party'..i))
local name = UnitName('party'..i)
if name then
UninviteUnit(name)
end
end
end
Expand Down
Loading

0 comments on commit c20d4df

Please sign in to comment.