Display Ordering and Frame Strata within a Group

  • 5 posts
    #1 Jul 12, 2012 at 19:28 UTC - 0 likes


    I have created a set of icon displays inside a group. They all occupy the same x,y co-ordinates so you can only see one icon at once. The intention is to create a priority frame, so the icon for the highest priority spell appears on top. The Frame Strata option for the group and all the displays within it is set to Inherited.

    As I understand it the order of the displays within the group determines the relative frame strata on screen. So my highest priority spell icons are at the bottom of the group. This all works fine until I relog (or reload UI). After which the ordering seems screwed up and doesn't appear to obey any sort of pattern. To fix it I have to open the WeakAuras options and either move a display up and then down again within the group ordering or toggle the Load - Never option for the group (on and then off again). As you can imagine it is quite annoying to have to do this every time I log in to fix my auras.

    Any ideas how I can solve this?

    Last edited Jul 12, 2012 by ericph
    #2 Jul 13, 2012 at 22:03 UTC - 0 likes

    Set up multiple conditionals for each one. It's a little more tedious to set up, but it will do the job, and is arguably the "proper" way to do it. That way only the one you want will be shown, and the others will be hidden. Then strata doesn't matter.

    It sounds like you're trying to set up something that shows your spell rotation for you, but since I don't know what you're going for, I can only give a vague example:

    Spell priority is A > B > C

    Spell A trigger: Spell A is usable

    Spell B trigger: Spell A is on cooldown, Spell B is usable

    Spell C trigger: Spell A is on cooldown, Spell B is on cooldown, Spell C is usable

    Hopefully that makes some sense.

    Last edited Jul 13, 2012 by Crytuff
    #3 Jul 14, 2012 at 01:44 UTC - 0 likes

    Hi Crytuff, thanks for your suggestion. I understand what you are saying, unfortunately it doesn't really suit my needs. I was hoping to create something that would be easily maintainable if the spell priority I wanted to follow would change. With what I currently have set up it is as simple as re-ordering the displays within the group. However with your suggestion I would need to go and edit multiple triggers on all of the displays to change the priority order. Also not all of my displays have only one trigger, making the logic for the inverse even more complex to add to all the other displays that are lower down in the priority queue.

    I know I am probably trying to do something with WeakAuras that it wasn't intended for, but that flexibility is what I love about this addon.

    #4 Sep 01, 2012 at 13:00 UTC - 1 like

    I have managed to fix my issue with a code change in WeakAuras.lua. The problem appears to be that the frameLevels of controlledChildren within a group are not set until the ordering of the group is modified (from the options window). Then they are not maintained when the addon is reloaded.

    To solve this I added the following function to the bottom of WeakAuras.lua:

    function WeakAuras.FixGroupChildrenOrder()
    	for id, data in pairs(db.displays) do
            if(data.controlledChildren) then
    			local lowestRegion = WeakAuras.regions[data.controlledChildren[1]] and WeakAuras.regions[data.controlledChildren[1]].region;
    			if(lowestRegion) then
    				local frameLevel = lowestRegion:GetFrameLevel();
    				for i=2,#data.controlledChildren do
    					local childRegion = WeakAuras.regions[data.controlledChildren[i]] and WeakAuras.regions[data.controlledChildren[i]].region;
    					if(childRegion) then
    						frameLevel = frameLevel + 1;

    Then at the bottom of the ADDON_LOADED OnEvent function (around line 1525):

    WeakAuras.ResolveCollisions(function() registeredFromAddons = true; end);

    I lifted the body of FixGroupChildrenOrder() from the 'modify' function in RegionTypes\group.lua.

    There is probably a cleaner way of doing this, but I'm not too familiar with the WeakAuras code yet. Would it be possible to add this fix or something equivalent into the official release?

    Many thanks!

    Last edited Sep 01, 2012 by ericph
    #5 Nov 07, 2012 at 20:34 UTC - 0 likes

    I am having a similar problem, and I would love to see this become a fix for the official release. It seems like a bug, but was probably just overlooked. Hopefully it will be fixed soon.

  • 5 posts

You must login to post a comment. Don't have an account? Register to get one!