WoW:Removing Blizzard default frames: Difference between revisions

Added a note on preventing events from poping hidden frames back.
No edit summary
(Added a note on preventing events from poping hidden frames back.)
Line 15: Line 15:
   /script MyFrame:Show()
   /script MyFrame:Show()


'''NOTE:''' Most frames have event handlers so even if you hide it, it can pop back up as a result of an event handler calling it's Show function. To avoid this you need to prevent the frame from getting these events or from executing the code that makes the frame show. Most Blizzard's frames (if not all) use the a single fuction to handle all events, which makes it easier for us. When hidding the frame you can make the OnEvent fucntion point to nill so no function gets called:
  PlayerFrame:SetScript("OnEvent", nil);
  PlayerFrame:Hide();
And then restore the original function when you want to show the frame again:
  PlayerFrame:SetScript("OnEvent", PlayerFrame_OnEvent);
  PlayerFrame:Show();
You will have to go through the code for each frame to get the exact functions, and with some (like target or pet) do some checks before actually showing it, i.e. Make sure the unit exists.


'''''In the following there are listed some frames you might want to hide:'''''
'''''In the following there are listed some frames you might want to hide:'''''
Line 92: Line 103:
This is the long purple (or blue, if rested) bar on the default UI that shows your experience
This is the long purple (or blue, if rested) bar on the default UI that shows your experience
   MainMenuExpBar:Hide()
   MainMenuExpBar:Hide()
[[Category: HOWTOs|Remove Blizzard Default Frames]]
[[Category: HOWTOs|Remove Blizzard Default Frames]]
Anonymous user