WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   kgPanels Help (https://www.wowinterface.com/forums/showthread.php?t=46453)

Redigit 05-12-13 08:43 AM

kgPanels Help
 
I'm really new to this whole kgPanels thing (I got it today haha) was just wondering what the script would be to only show a texture when i have a target. I am trying to go for the infamous Kait:Auras glowing health orb look if that helps anybody. Have made a circle texture, just need the script/code to make it only appear when i target something, so that i dont have a random circle in the middle of my screen. Any help would be greatly appreciated, thanks!

lynce 05-12-13 09:44 AM

I don't use kgPanels myself. But this may help you.
Quote:

- KgPanels, Player, Target, Anchoring -

Now we're going to create panels for the player and target frame. The problem with target frame is obvious. We're not always targeting someone or something, so we need the panel to disappear if we're not targeting anything. This is done by parenting frames.

Go ahead and create a new panel with the name "Player". Copy All from Buttons and move it into place, very simple.

Now that we've made it fit with the player frame, the target frame will use the same dimensions. So it's going to be very easy for us. Make a new panel named "Target" and copy all from Player. Sometimes, as in my case it refuse to copy, simply type "/rl" and do it again.

Lock the panel once it's in place. Now we need to figure out what the target frame is called, so that we can parent the panel to the frame. Do this by using this macro. "/run ChatFrame1:AddMessage(GetMouseFocus():GetName())" while your mouse is hovering over the target frame. My target frame is called: "PitBullUnitFrame3". Remember that you need to copy EXACTLY what it says, including capital letters.

At the absolute bottom of Target are two options. Anchor and Parent. Anchor decides the position, if you move the target frame, it will move with. The Parent frame follows whatever action happens. Shown, Hidden etc.

So set the Parent to "PitBullUnitFrame3" or whatever yours was, be sure to press Okay. You don't need to anchor this frame unless you're planning on moving your target frame constantly.

Kendian 05-12-13 11:15 AM

Just parent it to your targets unit frame, then it will only show up when you have a target.

ravagernl 05-13-13 10:57 AM

Here is some code not depending on any unitframe addon.

Onload:
Code:

self:RegisterEvent('PLAYER_TARGET_CHANGED')
OnEvent:
Code:

self:SetShown(UnitExists('target'))

Seerah 05-13-13 04:11 PM

well, yes, but parenting the kgPanel to the frame is 100x better...


All times are GMT -6. The time now is 12:54 AM.

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