Revised for joining a raid and only asking once per session
Code:
local f = CreateFrame("frame")
f:SetScript("OnEvent", function(self, event, ...) if self[event] then return self[event](self, event, ...) end end)
f:RegisterEvent("RAID_ROSTER_UPDATE")
-- set to true to automatically start the log
local autoLog = false
local currentlyLogging = false
-- fired when joining/starting a raid
function f:RAID_ROSTER_UPDATE()
if currentlyLogging == true then
return
end
if autoLog == true then
LoggingCombat(1)
currentlyLogging = true
else
StaticPopup_Show("ENABLE_LOGGING_ON_RAID");
end
end
-- simple dialog
StaticPopupDialogs["ENABLE_LOGGING_ON_RAID"] = {
text = "Do you want to start logging?",
button1 = "Yes",
button2 = "No",
OnAccept = function()
LoggingCombat(1);
currentlyLogging = true
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1
};