Thread Tools Display Modes
06-25-17, 08:52 AM   #1
Makkadun
A Kobold Labourer
Join Date: Jun 2017
Posts: 1
Hide Buffs/Debuffs when out of combat?

Hey Gang

Been looking everywhere for a few code string that might be able to hide all my buffs and debuffs when im not in combat?
Can't figure out if it is even simple to do Would love your feedback.

If its already a thread in the forum i havent been able to find it, so please send me a link

Good day.
  Reply With Quote
07-15-17, 10:43 PM   #2
aallkkaa
A Warpwood Thunder Caller
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
Easy.
Code:
-- Create a frame to register events
local eventsFrame, events = CreateFrame("Frame", "SomeName_EventsFrame"), {};

-- Handler for login, entering instance, et al
function events:PLAYER_ENTERING_WORLD()
	BuffFrame:Hide();
end

-- Handler for entering combat
function events:PLAYER_REGEN_DISABLED()
	BuffFrame:Show();
end

-- Handler for leaving combat
function events:PLAYER_REGEN_ENABLED()
	BuffFrame:Hide();
end

eventsFrame:SetScript("OnEvent", function(self, event, ...)
	events[event](self, ...); -- Call one of the functions above
end);

for k, v in pairs(events) do
	eventsFrame:RegisterEvent(k); -- Register events to be notified of
end
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Hide Buffs/Debuffs when out of combat?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off