[Bug] Secure aura header issues

Bug Report
Secure aura header issues still present in SecureGroupHeaders.lua.

- extractTemplateInfo():

It does not properly separate a template name from a widget type when both are specified in a template name string. There is no way to work around this issue.

To fix this, change this line (664):
template, widgetType = strsplit(",", tostring(template):trim():gsub("%s*,%s*", ","));

into this line:
template, widgetType = strsplit(",", (tostring(template):trim():gsub("%s*,%s*", ",")));


- sortFactory():

The separateOwn parameter can be -1, 0, or 1. The existing code treats 0 as if it were -1.

To fix this, change this line (867):
if ( separateOwn ) then

into:
if ( separateOwn ~= 0 ) then


- configureAuras():

It is using the wrong inventory slot number for the off hand temporary enchant.

To fix this, change this line (720):
local slot = GetInventorySlotInfo("MainHandSlot");

into this line:
local slot = GetInventorySlotInfo("SecondaryHandSlot");


- configureAuras():

It does not properly handle buttons with a negative :GetRight() or :GetTop() value. It uses 0 instead of the actual value which then results in an incorrect and larger header width and/or height than expected.

To work around this, ensure that the anchor point of the frame is on the screen (ie. frame:GetRight() and frame:GetTop() are positive) before you force the secure routines to reconfigure the buttons, and then move the frame back to its original position afterwards.

To fix this, change this line (809):
local left, right, top, bottom = math.huge, 0, 0, math.huge;

into:
local left, right, top, bottom = math.huge, -math.huge, -math.huge, math.huge;


- configureAuras():

It does not hide buttons that have already been shown if you later reduce the value in the "wrapAfter" and/or "maxWraps" attributes.

To work around this, hide all of the buttons prior to forcing the secure routines to reconfigure the buttons.

To fix this, move the existing loop (lines 711-717) that uses "deadIndex" to hide the buttons, down to a point after the buttons are displayed (lines 810-826), and change the initial value of "deadIndex" from "#buttons + 1" to "display + 1".


- configureAuras():

Setting the "wrapAfter" attribute to nil or 0 results in a divide by nil or 0 error. If it is not intended that we use 0 or nil, then the following line (682) is not needed:
if ( wrapAfter == 0 ) then wrapAfter = nil; end


- SecureAuraHeader_Update():

Setting the "includeWeapons" attribute to nil will not hide a weapon button if the button already exists. To work around this, addons can hide all weapon enchant buttons before setting the attribute to nil.


- Temporary enchants on ranged weapons are not currently supported.


- There is no way to alter the size of new buttons when they are created from the template. A partial work around is to use multiple templates each with a different size, and resize any existing buttons when you switch templates.


- The code does not track consolidated buffs in order to move them out of consolidation when they no longer belong there. Only something that triggers a call to SecureAuraHeader_Update will move them out.


- Buffs with no duration are sorted first when sorting by time. It would be nice if we could set an attribute to make those buffs sort first or last.


- The comments use the attribute name "sortDir" but the actual code uses "sortDirection".


- The comments indicate that you can set the "includeWeapons" attribute to 0 or nil to have weapons enchants ignored. However, using 0 does not cause them to be ignored.

Join the Conversation

Return to Forum