WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Eepanels2: Panel hide/show when target is/not selected. (https://www.wowinterface.com/forums/showthread.php?t=13978)

gromlv 12-08-07 10:01 PM

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.

Dreadlorde 12-08-07 10:04 PM

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.

Viserion 12-08-07 10:31 PM

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")


Seerah 12-08-07 11:17 PM

Quote:

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()

gromlv 12-09-07 12:07 AM

Quote:

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?

Seerah 12-09-07 12:24 AM

Same as I told you to do for the target frame (but you didn't listed :p ). Parent that eePanel to the pet frame.

Slakah 12-09-07 05:07 AM

Quote:

Originally Posted by Seerah
Same as I told you to do for the target frame (but you didn't listed :p ). 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.

Delena 12-09-07 05:43 AM

Quote:

Originally Posted by Seerah
Same as I told you to do for the target frame (but you didn't listed :p ). 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());

Viserion 12-09-07 12:55 PM

Quote:

Originally Posted by Seerah
So not needed. :)
Code:

/print GetMouseFocus():GetName()

So sorry for trying to help.....

Seerah 12-09-07 05:02 PM

Quote:

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. :)

nddst 12-18-07 01:42 PM

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.

Seerah 12-18-07 01:56 PM

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.

okami 12-19-07 08:28 PM

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. :confused:

Quote:

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()


Delena 12-19-07 09:01 PM

Quote:

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. :confused:

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.

Seerah 12-19-07 11:26 PM

It's also "Perl" not pearl


All times are GMT -6. The time now is 09:37 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI