[Addon - money for work] Hiding UI Frame out of combat

[Addon - money for work] Hiding UI Frame out of combat

by dji200 » Sat Sep 12, 2015 8:50 am

Hello all!
I want an addon that can hide my UI Frame when I am out of combat. I have currently not found a addon with that ability, so I am not sure if it is possible (it was definitely possible in BC, but I know that the API changed). I use Discord for everything (UI, Actionbars, Art).

Now, it is possible to do this for Actionbars. I have made it so it only shows when I am in combat/targeting a not-friendly target. I hope that the same thing is possible for my UI frame.

I am hoping one of you can give me an aswer.
dji200
Private
Private
 

Re: [Addon - money for work] Hiding UI Frame out of combat

by Guybrush » Sat Sep 12, 2015 10:59 am

The entire UI? Yeah it could be done. How much you paying? ^^
Guybrush
Sergeant Major
Sergeant Major
 

Re: [Addon - money for work] Hiding UI Frame out of combat

by Athene » Sat Sep 12, 2015 11:25 am

Code: Select all
local djiFrame = CreateFrame("frame");
djiFrame:RegisterEvent("PLAYER_REGEN_ENABLED"); --leaving combat
djiFrame:RegisterEvent("PLAYER_REGEN_DISABLED"); --entering combat
djiFrame:SetScript("OnEvent", function()
   if (event == "PLAYER_REGEN_ENABLED") then
      UIParent:Hide();
   elseif (event == "PLAYER_REGEN_DISABLED") then
      UIParent:Show();
   end
end)



UIParent being the name of the frame you want to hide (this hide everything), you may want to change this to:

DUF_PlayerFrame:Hide();
DUF_TargetFrame:Hide();
DUF_TargetOfTargetFrame:Hide();

and

DUF_PlayerFrame:Show();
DUF_TargetFrame:Show();
DUF_TargetOfTargetFrame:Show();

If you don't know how to make a new addon you can add the above code at the end of any addon you're using.
<Genesis>
youtube.com/GenesisGuilde

MSBT [Continued] landed on Nostalrius, check it here: forum.nostalrius.org/viewtopic.php?f=63&t=1721
User avatar
Athene
Senior Sergeant
Senior Sergeant
 

Re: [Addon - money for work] Hiding UI Frame out of combat

by dji200 » Sat Sep 12, 2015 12:05 pm

I am talking about the my own UI Frame (my health mana bar).

I will try what you suggested Athene, thanks alot! I'll PM you.

Edit: Works now.
dji200
Private
Private
 


Return to Addons & macros