Group frames don't respond to OnShow/OnHide?
Hi all,
It's been a while since I posted my last oUF related thread here :) So, I'm currently spawning my raid group frames like the following: Lua Code:
I'm currently trying to display a text, "Group N", on top of each group's frame, but it seems like those frames don't call OnShow/OnHide scripts :confused: So, I've tested it without headText being hidden on creation and here's what it looks like at the moment. From "Group 1" to "Group 7" are properly positioned while "Group 8" is off... So, my conclusion here is that each of groups are created and already visible since I'm in raid group (and that's why it's not calling OnShow/OnHide scripts), but are not yet sized correctly until that particular group gets a member in it and that's why it's causing this. However, I'm still unsure of how I could fix this :( Any helps, please?! Thank you!! |
First off, it's good practice to use HookScript instead of SetScript when adding script handlers to a foreign object, to avoid overriding the original script handler.
As for the issue, try HookScript "OnAttributeChanged" and check for the amount of players in the given group. The visibility that you're trying to check for is always going to be true while you're in a raid, according to your visibility conditions "custom [group:raid] show; hide". |
Hi p3lim,
Quote:
I definitely didn't consider such cases.. Quote:
I forgot that I assigned "custom [group:raid] show; hide" for visibility which will always show each header frame while I'm in raid group as you said :( Had a go with "OnAttributeChanged" script, but eeh... doesn't seem like it. There were some attributes like "statehidden", "childN", "_ignore" and "frameref-childN" where I thought "childN" attribute would be the one that I should be dealing with, but it wasn't.. Thus, I'm guessing that the best option would be changing visibility condition, although I'm still unsure tho... (Maybe I should have a look at macro conditionals :p) |
You could try parenting the header text to the top member of each group, voids the check completely.
|
Quote:
Thanks a lot!! |
One more question!
What would be the best way to get access (or get reference) to first member frame of the group? I'm currently doing it this way. Lua Code:
This would work fine, but I am curious if there is any better solution to achieve this. |
All times are GMT -6. The time now is 11:47 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI