View Single Post
10-08-16, 03:33 AM   #14
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Yes, but written that way it would toggle the CVar based on whether or not you were in combat, not whether or not you were in a raid. Also, since you still check for raid status, whatever state you were in when you left a raid group -- quest info shown, or not shown -- would "stick" until the next time you entered or left combat after joining another raid group, which probably isn't the intention.
My code start from the info that you should be not in combat to set the CVAR and on my idea that you can't be kicked or leave the group in combat (WRONG


So now, reading again (and understanding better) your code I think it is a so simple and elegant solution.

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("GROUP_ROSTER_UPDATE")
  3. f:SetScript("OnEvent", function(self, event)
  4.     SetCVar("showQuestTrackingTooltips", IsInRaid() and 0 or 1)
  5. end)

Thanks (as usual)
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote