Is there a way to determine raid group number with macro conditional?
Hi all,
I am using an oUF to spawn my raid frames, but since this is more like generic WoW Lua related question, I've decided to post it here :p So, oUF uses macro conditional to decide whether it should display raid frames or not and here's my current setting(?). Code:
for i = 1, NUM_RAID_GROUPS do My question is would it be possible to write a macro conditional to: "Show this raid group if there is at least a single member in that specific group, otherwise hide" Thanks in advance!! |
Since unit id can't tell which group it's in, so I don't think that'd be done with macro condition.
Don't know how ouf handle this, I have secure codes to resize the whole panel and re-position unit frames based on their visibility, so the panel will keep 0-width, 0-height if there is no unit in it. The key is using SecureHandlerWrapScript. |
Quote:
Thanks for a hint! I'll have a look at SecureHandlerWrapScript and see how I go :D *EDIT hm.... there's not many info about SecureHandlerWrapScript even on Wowpedia... Could you please give me some example on how this function works? Thank you! |
My codes is here, it's an interface so I used it for raid panel and bag containers.
Here is a simple one, I don't do a test, since the group header settings is ignored : Lua Code:
Also there is a topic discuss about Run secure code based on the group header system, you can find my answer from #12. I don't know if it can be combined with the Ouf, you may have a try. |
And about the wrapscript, you'd better have a look at the SecureHandlers, it's a little like the HookScript, but there are two secure snippets, prebody before the real script handler, and a postbody after that.
The snippets are running in the manager's environment not the target frames, so I can use variables like Manager in those snippets, that's the main reason why I use it, so I can manage all unit frames on all panels in one Manager's environment. You can find the variables for each script type in that file. The prebody may return two values, the first determine whether the real script handler would be run(also the postbody), the second is a message, if the message existed then the postbody would be called after the real script handler. As an example, I can swap two button's action after clicking one of them. |
Hi again kurapica,
sorry for a late response. Hm...... guess I got the concept, but still need some practice to fully understand it :rolleyes: Thank you for a detailed explanation! |
All times are GMT -6. The time now is 10:58 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI