There isn't really a shorter way, but this would probably use less resources:
local buffs = 1, onlyShowCastableBuffs = false;
local buff,_,_,_,_,_ = UnitBuff("player", buffs, onlyShowCastableBuffs);
while buff do
buffs = buffs + 1;
buff,_,_,_,_,_ = UnitBuff("player", buffs, onlyShowCastableBuffs);
end
buffs = buffs - 1;
-- 'buffs' should now contain the number of buffs on the player
I've tried searching, but my search-fu is weak, and I've been finding conflicting answers, so I figure I'll ask and hopefully get something definitive:
Is there a way to draw eePanels on PitBull's party/raid/cluster frames?
I've got frames parented to PitBullCluster1UnitButton1 (and 2 and so on), but when I join a party (or a raid), they don't show up.
I want to resize a panel according to the number of buffs my pet has. Which event do i need to trigger this?
Best regards
X-buZZ
The same script on the previous page, you just use UnitBuff("pet", ...) instead of UnitBuff("player", ...).
Quote from s3rial »
I've tried searching, but my search-fu is weak, and I've been finding conflicting answers, so I figure I'll ask and hopefully get something definitive:
Is there a way to draw eePanels on PitBull's party/raid/cluster frames?
I've got frames parented to PitBullCluster1UnitButton1 (and 2 and so on), but when I join a party (or a raid), they don't show up.
No, those frames are created on-demand, and you can't set them as a parent or anchor. You can create a script which will display when you're in a party/raid and manually position it where your raid/party frames are. Scripts for this are on this thread and in the script wiki.
The same script on the previous page, you just use UnitBuff("pet", ...) instead of UnitBuff("player", ...).
This is not the whole story, because the pet eePanel just resizes when a player buff changes because PLAYER_AURA_HAS_CHANGED is only fired when there is a change on the PLAYER buffs. It resizes correctly using UnitBuff("pet") but it is simple not refreshing at the right time.
This is not the whole story, because the pet eePanel just resizes when a player buff changes because PLAYER_AURA_HAS_CHANGED is only fired when there is a change on the PLAYER buffs. It resizes correctly using UnitBuff("pet") but it is simple not refreshing at the right time.
According to wowwiki that would be UNIT_AURA("pet")
No, those frames are created on-demand, and you can't set them as a parent or anchor. You can create a script which will display when you're in a party/raid and manually position it where your raid/party frames are. Scripts for this are on this thread and in the script wiki.
I've actually tried those scripts, as well as a few variations that've been suggested to me. Invariably, I get the following error message:
[string "eePanels2:RegisterEvent("PLAYER_ENTERING_WO..."]:
1. AceEvent-2.0: Cannot register event "PLAYER_ENTERING_WORLD" to method "PLAYER_ENTERING_WORLD", it does not exist.
Im tryin to get my eepanel2 to resize to my Grid layout as it gains members. I have tried this code
-- Create a new ace2 addon for hooking
THIS_Hook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
-- Create a function to resize the eePanel when the hooked frame is resized
function THIS_Hook:OnSizeChanged(frame, ...)
THIS:SetWidth(frame:GetWidth())
THIS:SetHeight(frame:GetHeight())
end
-- Hook to the frame we want to resize against (GridLayoutFrame)
THIS_Hook:HookScript(GridLayoutFrame, "OnSizeChanged")
But it hooks to the frame just doesnt resize. Anyone have maybe a sulotion to my problem?
-- Hide the panel so it's not shown until we want it to
THIS:Hide()
-- Change our panel's visibility when in/out of a raid
function eePanels2:RaidPanelVisibility(self, event, ...)
-- If we're in a raid
if GetNumPartyMembers() > 0 and not ((select(2, IsInInstance()) == "pvp" or select(2, IsInInstance()) == "arena")
or GetNumRaidMembers() > 0 and not ((select(2, IsInInstance()) == "pvp" or select(2, IsInInstance()) == "arena")
-- Show the panel this script is attached to
then THIS:Show()
-- If we're not in a raid, hide the panel this script is attached to
else THIS:Hide()
end
end
-- Ace2 event listeners; can't do this in more than one script
eePanels2:RegisterEvent("PLAYER_ENTERING_WORLD", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("PARTY_MEMBERS_CHANGED", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("RAID_ROSTER_UPDATE", eePanels2.RaidPanelVisibility)
Can anyone correct this so it works? Since when I try to use it, it tells me the following: [string "-- Hide the panel so it's shown until we want it to..."]:10: ')' expected (to close '(' at line 7) near 'then'
I've actually tried those scripts, as well as a few variations that've been suggested to me. Invariably, I get the following error message:
[string "eePanels2:RegisterEvent("PLAYER_ENTERING_WO..."]:
1. AceEvent-2.0: Cannot register event "PLAYER_ENTERING_WORLD" to method "PLAYER_ENTERING_WORLD", it does not exist.
You'll need to post your entire code.
Quote from Moocowcoww »
Ok i have a queson.
But it hooks to the frame just doesnt resize. Anyone have maybe a sulotion to my problem?
Not me. People reported that it would eventually resize, just not right away.
Can anyone correct this so it works? Since when I try to use it, it tells me the following: [string "-- Hide the panel so it's shown until we want it to..."]:10: ')' expected (to close '(' at line 7) near 'then'
For some reason the comments (lines that start with '--') mess things up for some people. Try this:
THIS:Hide()
function eePanels2:RaidPanelVisibility(self, event, ...)
if GetNumPartyMembers() > 0 and not ((select(2, IsInInstance()) == "pvp" or select(2, IsInInstance()) == "arena") or GetNumRaidMembers() > 0 and not ((select(2, IsInInstance()) == "pvp" or select(2, IsInInstance()) == "arena") then
THIS:Show()
else
THIS:Hide()
end
end
eePanels2:RegisterEvent("PLAYER_ENTERING_WORLD", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("PARTY_MEMBERS_CHANGED", eePanels2.RaidPanelVisibility)
eePanels2:RegisterEvent("RAID_ROSTER_UPDATE", eePanels2.RaidPanelVisibility)
I have two panels. Their settings are exactly the same, except that one is parented to the Minimap and the other is parented to an addon's Earth_Shield_Tracker_Tracker frame. The Minimap panel appears correctly. However, the ESTTracker panel is invisible on login. If I change the panel background alpha setting (doesn't matter what to; the background texture is set to None so only the border is visible), it reappears. What can I do to fix this?
So, I take no credit for this at all because I'm not the one who came up with it, but I mentioned that I was having a problem hooking eePanels to Pitbull's cluster frames over at Penny Arcade's WoW UI thread, and Saeris came up with this:
So, I take no credit for this at all because I'm not the one who came up with it, but I mentioned that I was having a problem hooking eePanels to Pitbull's cluster frames over at Penny Arcade's WoW UI thread, and Saeris came up with this:
Just add it to core.lua, and eePanels2 gains the ability to attach to Pitbull's cluster frames.
Again, I take no credit for this at all. Saeris did all the work. I just benefit from it.
Yeah, that's a pretty good work around. I've actually thought about hooking the CreateFrame function before, but never really looked into it. My concern would be that if you had quite a few "bad" panels (ie: panels attached to frames which haven't been created yet), it could lead to a lot of overhead, as multiple global lookups would be performed every time a new frame is created.
It's the type of thing I would be hesitant to add directly to the addon without doing some performance testing. Right now I'm juggling 4 different home projects, and I haven't logged into WoW in about 2 months. I'll add it to the Wiki for now, and we'll see how things turn out.
I added a toggleable switch to the eePanel2 menu called 'Dynamic Frames Fix'. Turning this on will perform the above mentioned secure hook, and should help people when parenting/anchoring to pitbull and other dynamically created frames.
It's a toggle because I'm not sure how much - if any - of a performance hit this could create. I've read that hooking secure functions can be somewhat slow and depending on how many dynamically created frames you're hooked to (but haven't been created yet) you could notice the effects depending on frame creation churn.
I've also added the AceHook-2.1 library to eePanels2 (so I could best implement the above workaround). This means you'll no longer need to manually add the AceHook library into your eePanel2 scripts. I don't think this will affect your current scripts, but if it does I'm sorry. Simply remove any AceHook references from your scripts and perform a /rl if it does. I'll see about going through the script wiki over the weekend and remove all the AceHook references if I get time.
i converted it back to jpg to host it on imageshack. i used IrfanView to convert it into .tga. i know the picture is less than the 512x512 limit, i pretty sure it's 24 bit, but i cant get it to show up on the panel. please help!
Have you tried just anchoring instead of parenting?
Didn't help. The panel anchored to Earth_Shield_Tracker_Tracker still doesn't appear on login; the new "dynamic frames fix" predictably also didn't help, as this frame is created in XML at load... I've deleted the panel and recreated it, and it simply won't appear on login. >_<
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
For me it worked to anchor the Panel to the BuffaloFrame
and just use the script for resizing depending on the number of buffs...
I want to resize a panel according to the number of buffs my pet has. Which event do i need to trigger this?
Best regards
X-buZZ
Is there a way to draw eePanels on PitBull's party/raid/cluster frames?
I've got frames parented to PitBullCluster1UnitButton1 (and 2 and so on), but when I join a party (or a raid), they don't show up.
The same script on the previous page, you just use UnitBuff("pet", ...) instead of UnitBuff("player", ...).
No, those frames are created on-demand, and you can't set them as a parent or anchor. You can create a script which will display when you're in a party/raid and manually position it where your raid/party frames are. Scripts for this are on this thread and in the script wiki.
This is not the whole story, because the pet eePanel just resizes when a player buff changes because PLAYER_AURA_HAS_CHANGED is only fired when there is a change on the PLAYER buffs. It resizes correctly using UnitBuff("pet") but it is simple not refreshing at the right time.
Any advises on this?
Thank you.
According to wowwiki that would be UNIT_AURA("pet")
I've actually tried those scripts, as well as a few variations that've been suggested to me. Invariably, I get the following error message:
[string "eePanels2:RegisterEvent("PLAYER_ENTERING_WO..."]:
1. AceEvent-2.0: Cannot register event "PLAYER_ENTERING_WORLD" to method "PLAYER_ENTERING_WORLD", it does not exist.
Any idea what's causing it?
EDIT: WORLD, not WOLRD
Im tryin to get my eepanel2 to resize to my Grid layout as it gains members. I have tried this code
But it hooks to the frame just doesnt resize. Anyone have maybe a sulotion to my problem?
Can anyone correct this so it works? Since when I try to use it, it tells me the following: [string "-- Hide the panel so it's shown until we want it to..."]:10: ')' expected (to close '(' at line 7) near 'then'
You'll need to post your entire code.
Not me. People reported that it would eventually resize, just not right away.
For some reason the comments (lines that start with '--') mess things up for some people. Try this:
Just add it to core.lua, and eePanels2 gains the ability to attach to Pitbull's cluster frames.
Again, I take no credit for this at all. Saeris did all the work. I just benefit from it.
Yeah, that's a pretty good work around. I've actually thought about hooking the CreateFrame function before, but never really looked into it. My concern would be that if you had quite a few "bad" panels (ie: panels attached to frames which haven't been created yet), it could lead to a lot of overhead, as multiple global lookups would be performed every time a new frame is created.
It's the type of thing I would be hesitant to add directly to the addon without doing some performance testing. Right now I'm juggling 4 different home projects, and I haven't logged into WoW in about 2 months. I'll add it to the Wiki for now, and we'll see how things turn out.
I added a toggleable switch to the eePanel2 menu called 'Dynamic Frames Fix'. Turning this on will perform the above mentioned secure hook, and should help people when parenting/anchoring to pitbull and other dynamically created frames.
It's a toggle because I'm not sure how much - if any - of a performance hit this could create. I've read that hooking secure functions can be somewhat slow and depending on how many dynamically created frames you're hooked to (but haven't been created yet) you could notice the effects depending on frame creation churn.
I've also added the AceHook-2.1 library to eePanels2 (so I could best implement the above workaround). This means you'll no longer need to manually add the AceHook library into your eePanel2 scripts. I don't think this will affect your current scripts, but if it does I'm sorry. Simply remove any AceHook references from your scripts and perform a /rl if it does. I'll see about going through the script wiki over the weekend and remove all the AceHook references if I get time.
http://img216.imageshack.us/img216/5268/saeug6.jpg
i converted it back to jpg to host it on imageshack. i used IrfanView to convert it into .tga. i know the picture is less than the 512x512 limit, i pretty sure it's 24 bit, but i cant get it to show up on the panel. please help!
edit: btw im using eepanel2
Didn't help. The panel anchored to Earth_Shield_Tracker_Tracker still doesn't appear on login; the new "dynamic frames fix" predictably also didn't help, as this frame is created in XML at load... I've deleted the panel and recreated it, and it simply won't appear on login. >_<