Implement joingroup and leavegroup for commander
This commit is contained in:
@@ -146,6 +146,25 @@ function shared.Commander.Init()
|
|||||||
end
|
end
|
||||||
local function HelpRu() return helpMessages.ru end
|
local function HelpRu() return helpMessages.ru end
|
||||||
local function HelpEn() return helpMessages.en end
|
local function HelpEn() return helpMessages.en end
|
||||||
|
local groupInviteFrame = CreateFrame("Frame")
|
||||||
|
groupInviteFrame:SetScript("OnEvent", function(self, event, ...)
|
||||||
|
AcceptGroup()
|
||||||
|
groupInviteFrame:UnregisterEvent("PARTY_INVITE_REQUEST")
|
||||||
|
C_Timer.NewTimer(0.1, function()
|
||||||
|
_G["StaticPopup1Button1"]:Click()
|
||||||
|
end, 1)
|
||||||
|
end)
|
||||||
|
local function JoinGroup()
|
||||||
|
groupInviteFrame:RegisterEvent("PARTY_INVITE_REQUEST")
|
||||||
|
C_Timer.NewTimer(10, function()
|
||||||
|
groupInviteFrame:UnregisterEvent("PARTY_INVITE_REQUEST")
|
||||||
|
end, 1)
|
||||||
|
return { "+" }
|
||||||
|
end
|
||||||
|
local function LeaveGroup()
|
||||||
|
LeaveParty()
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
---@class Command
|
---@class Command
|
||||||
---@field keywordRe string
|
---@field keywordRe string
|
||||||
@@ -158,6 +177,8 @@ function shared.Commander.Init()
|
|||||||
{ keywordRe = "^classes", commanderOnly = false, callback = CountClassPartitionedStinkies },
|
{ keywordRe = "^classes", commanderOnly = false, callback = CountClassPartitionedStinkies },
|
||||||
{ keywordRe = "^help", commanderOnly = false, callback = HelpRu },
|
{ keywordRe = "^help", commanderOnly = false, callback = HelpRu },
|
||||||
{ keywordRe = "^helpen", commanderOnly = false, callback = HelpEn },
|
{ keywordRe = "^helpen", commanderOnly = false, callback = HelpEn },
|
||||||
|
{ keywordRe = "^joingroup", commanderOnly = true, callback = JoinGroup },
|
||||||
|
{ keywordRe = "^leavegroup", commanderOnly = true, callback = LeaveGroup },
|
||||||
}
|
}
|
||||||
|
|
||||||
local commanderChannelFrame = CreateFrame("Frame")
|
local commanderChannelFrame = CreateFrame("Frame")
|
||||||
|
|||||||
Reference in New Issue
Block a user