Thread Tools Display Modes
10-19-10, 03:04 PM   #1
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Question Modify frame behavior onshow/onhide

I try to make frames fade in/out and slide in/out when shown and hid. This would apply to all the standard frames like character frames, achievement frame, calendar and so forth.

http://pastey.net/141851

The code is in alpha stage, it's not good at all I am sure. The main thing I am curious about is if there is another, perhaps more performance friendly way of hooking these frames and their show/hide?

Some frames use ShowUIPanel() to show, so just using :Hide() would make them act funny. Other frames simply clip and bug out when you spam them too much and too fast. If you run my code on CharacterFrame and you spam the "C" key too fast it may bug where the ShowUIPanel thinks its hidden when it's visible and such... hard to explain.

If anyone has some ideas I am all ears. So far it does not really use more than 60KB code to hook 120 frames, then it decays under 20KB to idle. My problem is that I want to write this shorter, more neat!

Thanks guys, out!

Edit: last thing, I also wish to add a slide in/out feature where the frame when shown, I will GetPoint(1) then put it let's say 64 pixels on the left/right (depending what side is closer) then make it slide in into position while fading in. It would fade out and slide out in the same manner when hid. Problem also is if I hook the :Hide then I can't use :Hide() within the code or I will make a loop... I also wish for a easy way to avoid this without too much newbie like code, hmm...
  Reply With Quote
10-20-10, 12:52 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Have you looked into using
http://www.wowwiki.com/API_UIFrameFadeIn
and the animation system (for your fades/moving respectively)?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Modify frame behavior onshow/onhide


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