Thread Tools Display Modes
06-11-10, 02:22 AM   #1
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
kgPanels Addon Dependancy Scripts?

So I'm trying to make a particular panel not show when a particular addon isn't loaded.

Is that possible?
  Reply With Quote
06-11-10, 02:26 AM   #2
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Register for the event ADDON_LOADED. Then, in your event code, check if the AddOn you want is loaded, and hide or show the frame.
  Reply With Quote
06-11-10, 02:54 AM   #3
harrellj
A Flamescale Wyrmkin
Join Date: Jul 2009
Posts: 132
Even easier, go to the specific panel > scripts > scripts dependency and put the name of the addon in that box (like recount). If the addon isn't loaded, the script won't even do anything.
  Reply With Quote
06-11-10, 09:03 AM   #4
Taryble
A Molten Giant
 
Taryble's Avatar
Join Date: Jan 2009
Posts: 811
should work if you parent the panel to a frame created by the addon.
__________________
-- Taryble
  Reply With Quote
06-11-10, 10:22 AM   #5
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by harrellj View Post
Even easier, go to the specific panel > scripts > scripts dependency and put the name of the addon in that box (like recount). If the addon isn't loaded, the script won't even do anything.
I tried that but to no avail.

Trying to get this to work with "Skada" as the addon name.

Didn't seem to do anything.
  Reply With Quote
06-11-10, 10:23 AM   #6
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Taryble View Post
should work if you parent the panel to a frame created by the addon.
There's no way to properly parent the frame to skada with its "non-frame-iness".
  Reply With Quote
06-11-10, 10:25 AM   #7
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by mrruben5 View Post
Register for the event ADDON_LOADED. Then, in your event code, check if the AddOn you want is loaded, and hide or show the frame.
would it just be:

Code:
self.Hide()
if arg1 == "Skada" then
self.Show()
end
??
  Reply With Quote
06-11-10, 10:50 AM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by suicidalkatt View Post
There's no way to properly parent the frame to skada with its "non-frame-iness".
No? I was able to add Skada to my Dash because it had an addon name... (I don't have it installed atm, though, and I had to clear my Dash saved vars, though, so I can't tell you what I used. I just used /framestack to find it though.)
__________________
"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
06-11-10, 10:54 AM   #9
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Seerah View Post
No? I was able to add Skada to my Dash because it had an addon name... (I don't have it installed atm, though, and I had to clear my Dash saved vars, though, so I can't tell you what I used. I just used /framestack to find it though.)
Haven't tried framestack, I'll try it.

What would be the proper coding for the OnEvent?
  Reply With Quote
06-11-10, 11:28 AM   #10
Kagaro
A Cyclonian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 45
Originally Posted by mrruben5 View Post
Register for the event ADDON_LOADED. Then, in your event code, check if the AddOn you want is loaded, and hide or show the frame.
And that is exactly what the dependecy box does. it delays OnLoad of you addon scrip till the specified addon is loaded.
  Reply With Quote
06-11-10, 12:14 PM   #11
MidgetMage55
Grinch!
 
MidgetMage55's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,498
For parenting purposes SkadaBarWindowSkada seems to work just fine for me. Might be useful to you as well for your needs.
__________________

I think Hong Kong Phooey was a ninja AND a pirate. That was just too much awesome. - Yhor
  Reply With Quote
06-11-10, 12:54 PM   #12
Taryble
A Molten Giant
 
Taryble's Avatar
Join Date: Jan 2009
Posts: 811
Yeah, SkadaBarWindowSkada works for me as well.
__________________
-- Taryble
  Reply With Quote
06-13-10, 08:05 AM   #13
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Using the addon dependency didn't seem to work for me.

Is there an alternative method with using ADDON_LOADED?

Edit: I'm making a button that shows and hides skada, but I'd like the button to not show if skada isn't loaded.

For now I'm just using IsAddOnLoaded("Skada") in the OnClick.

Last edited by suicidalkatt : 06-13-10 at 08:45 AM.
  Reply With Quote
06-13-10, 10:56 AM   #14
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Use that in the panel's OnLoad instead.
__________________
"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
06-13-10, 02:32 PM   #15
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
Originally Posted by Seerah View Post
Use that in the panel's OnLoad instead.
Thanks for that suggestion, that seems to work well.

OnLoad:
Code:
if IsAddOnLoaded("Skada") then
self:Show()
else
self:Hide()
end
OnEnter:
Code:
local c = RAID_CLASS_COLORS[select(2, UnitClass("player"))]
self.bg:SetGradientAlpha("VERTICAL",c.r,c.g,c.b,1,0.074,0.074,0.074,1)
OnLeave:
Code:
self.bg:SetGradientAlpha("VERTICAL",0.28,0.28,0.28,1,0.074,0.074,0.074,1)
OnClick:
Code:
if pressed and IsAddOnLoaded("Skada") then
Skada:ToggleWindow()
self:SetAlpha(0.25)
elseif released then
self:SetAlpha(1)
end
Thank you all for your suggestions as well <3

Last edited by suicidalkatt : 06-13-10 at 02:58 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » kgPanels Addon Dependancy Scripts?


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