Thursday, April 12, 2012

removing party unit frames and keeping them gone

[:1]I'm working on an addon to hide some user interface components while doing RP, to provide a "cleaner" look and make it easier to focus on the characters and the chat.

One of the things I want to hide is the party member frames. This is simple enough, with:

PartyMemberFrame1:Hide()

etc., but any time the party changes (party leader changes, a member is added or leaves, etc.), they all unhide.

Does anyone have code around to keep them from showing back up until I want them to? Or know of an addon that already does this that I can look at to see how?

Thanks!|||Found a solution on WoWwiki:

for i = 1, 4 do

local frame = getglobal("PartyMemberFrame"..i)

frame:SetScript("OnShow", frame.Hide)

end



With that, any time the frames are shown, they will be hidden. Then, when you want them to show up again, do the same, only setting the OnShow handler to nil.|||You can also do this in some unitframe addons. AgUnitframes, for example. Just turn off all of the frames in the UI. An addon to solely do this (and nothing else) would be lighterweight of course

No comments:

Post a Comment