Quantcast
Eepanels2: Panel hide/show when target is/not selected. - WoWInterface
Thread Tools Display Modes
12-08-07, 10:01 PM   #1
gromlv
A Fallenroot Satyr
 
gromlv's Avatar
Join Date: Jun 2006
Posts: 21
Eepanels2: Panel hide/show when target is/not selected.

Hi people.
I decided to make new UI,and to finish it i need your help.

I must say i'am total nab when it comes to scripting coding atc.

Anywai the thing is iam useing eepanels2 to create chat/pet/action bars/target frame background's.
Naw what i need is,to make one of eepanels2 background's to fade out if target is not selected,and fade in if i have a target selected.

I'am 80% sure its done thro the''LUA script'' option in advanced panel options.

Here is 2x screenshots,the panel marked with red squire around is target frame background that i want to fade in/out on target selected/not selected.

Picture NR1.



Picture NR2.



If it is done thro that LUA thing option then i wold love if someone wold tell me what to type in it.
If it's not done thro it,maybe someone know a different wai to make it fade out/in?
I'am prity sure it's possible,because i remember reading about eepanels,that thei do provide sucha advanced options.
  Reply With Quote
12-08-07, 10:04 PM   #2
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
If you just want it to show with a target, make it's parent the target frame.

I don't know lua so I can't help with the fading part, sorry.
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote
12-08-07, 10:31 PM   #3
Viserion
A Defias Bandit
Join Date: Dec 2006
Posts: 2
I don't know about the fading part as I don't have access to wow atm but this is what I use for the showing/hiding of a frame when a target exists:

Code:
function eePanels2:PLAYER_TARGET_CHANGED()
  if UnitExists("target")then
    THIS:Show()
  else
    THIS:Hide()
  end
end
eePanels2:RegisterEvent("PLAYER_TARGET_CHANGED")
  Reply With Quote
12-08-07, 11:17 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,757
Originally Posted by Viserion
I don't know about the fading part as I don't have access to wow atm but this is what I use for the showing/hiding of a frame when a target exists:
So not needed. Just do what Dreadlorde said and parent the frame to the target frame. To get the name of that frame, hover your mouse over the target frame and enter this into chat
Code:
/print GetMouseFocus():GetName()
__________________
"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
12-09-07, 12:07 AM   #5
gromlv
A Fallenroot Satyr
 
gromlv's Avatar
Join Date: Jun 2006
Posts: 21
Originally Posted by Viserion
I don't know about the fading part as I don't have access to wow atm but this is what I use for the showing/hiding of a frame when a target exists:

Code:
function eePanels2:PLAYER_TARGET_CHANGED()
  if UnitExists("target")then
    THIS:Show()
  else
    THIS:Hide()
  end
end
eePanels2:RegisterEvent("PLAYER_TARGET_CHANGED")

this one worked PERFECTLY!
thx

1 more thing.
How the code wold look if i want to hide panel when i dont have pet under my control and show it when i do?

Last edited by gromlv : 12-09-07 at 12:15 AM.
  Reply With Quote
12-09-07, 12:24 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,757
Same as I told you to do for the target frame (but you didn't listed ). Parent that eePanel to the pet frame.
__________________
"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
12-09-07, 05:07 AM   #7
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Seerah
Same as I told you to do for the target frame (but you didn't listed ). Parent that eePanel to the pet frame.
Listen to seerah if you set frame A to frame B's parent then whenever B is hidden A is hidden so when your pet frame is hidden your frame will be hidden.
  Reply With Quote
12-09-07, 05:43 AM   #8
Delena
A Cyclonian
 
Delena's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 49
Originally Posted by Seerah
Same as I told you to do for the target frame (but you didn't listed ). Parent that eePanel to the pet frame.
Seerah is right, you don't need a script for target and pet frames. However I've noticed that agUF needs that script for party frames 2,3,4, not for the first.
You only need to discover the pet frame name typing in chat: /script DEFAULT_CHAT_FRAME:AddMessage(GetMouseFocus():GetName());
__________________
armory profile

Last edited by Delena : 12-09-07 at 05:47 AM.
  Reply With Quote
12-09-07, 12:55 PM   #9
Viserion
A Defias Bandit
Join Date: Dec 2006
Posts: 2
Originally Posted by Seerah
So not needed.
Code:
/print GetMouseFocus():GetName()
So sorry for trying to help.....
  Reply With Quote
12-09-07, 05:02 PM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,757
Originally Posted by Viserion
So sorry for trying to help.....
Don't be sorry. I'm trying to help both of you, as setting parent is 10x easier and more efficient than having a script do that simple thing for you.
__________________
"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
12-18-07, 01:42 PM   #11
nddst
A Kobold Labourer
Join Date: Dec 2007
Posts: 1
Hi, I hate to hijack the OP thread, but I have a question about eepanels2.

Background: I am using PitBull for all my frames (party, Raid, etc.)

I created an interface and I wanted to have a black-ish box around my raid frames when I am in a raid. So, I created an eepanel2 panel for it and bound it to my raid frames by checking the name with [/print GetMouseFocus():GetName()]. Now, it works great until I reload my UI. Then the panel gets shrunk to just the one frame I am using as a reference frame. (PitBullCluster1UnitButton1 in both the Anchor and Parent frames.)

So it is not holding the size I set when I create it from load to load.

I changed the "Anchor Frame" to the UIParent thinking that it might hold the size correctly. It acts very strangey and does not align correctly from loading time to loading time.

So, to my question, I think if I bind it to the parentui for both the anchor and the parent and the script it to show only when I am in a raid it will work as I would like it to. That way I can show the box when either is visible (I had tried 2 seperate frames for each, but, again once I reloaded it would show them both).

Any help would be great. I will check back to answer more questions.

Last edited by nddst : 12-18-07 at 01:45 PM.
  Reply With Quote
12-18-07, 01:56 PM   #12
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,757
PitBull's frames are tricky. They are only created when needed and they (and their names) get recycled. You do need a script to hide/show for raid and party frames. See the eePanels2 wiki and thread on wowace.com for more info and for example scripts.
__________________
"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
12-19-07, 08:28 PM   #13
okami
A Kobold Labourer
 
okami's Avatar
Join Date: Dec 2007
Posts: 1
How do I get this to work with Pearl? I tried '/print GetMouseFocus():GetName()' on it and I get 'Pearl_Target_StatsFrame_CastClickOverlay' and when I set the panel to it...it disappears (I've tried 'TargetFrame' but I still get the same problem). I've also tried the other script and it works but for some reason only on one frame at a time.

Originally Posted by Seerah
So not needed. Just do what Dreadlorde said and parent the frame to the target frame. To get the name of that frame, hover your mouse over the target frame and enter this into chat
Code:
/print GetMouseFocus():GetName()
  Reply With Quote
12-19-07, 09:01 PM   #14
Delena
A Cyclonian
 
Delena's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 49
Originally Posted by okami
How do I get this to work with Pearl? I tried '/print GetMouseFocus():GetName()' on it and I get 'Pearl_Target_StatsFrame_CastClickOverlay' and when I set the panel to it...it disappears (I've tried 'TargetFrame' but I still get the same problem). I've also tried the other script and it works but for some reason only on one frame at a time.
CastClickOverlay is a sub frame, not the main one. You can download the ace mod Baddiel, with the chat command /baddiel ft you will know all the frame family tree.
Perl has multiple frames could be tricky, you can try with the frame Perl_Target_Name or Perl_Target_Stats. Try also to modify the level or strata of your panel.
I don't use perl but you can try.
__________________
armory profile

Last edited by Delena : 12-19-07 at 09:07 PM.
  Reply With Quote
12-19-07, 11:26 PM   #15
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,757
It's also "Perl" not pearl
__________________
"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 » Eepanels2: Panel hide/show when target is/not selected.

Thread Tools
Display Modes

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