Hello, I've got a dynamic group that holds one WeakAura that has a TSU trigger. The trigger is responsible to show the essences of my Evoker. I'm using a TSU trigger to be able to show the recharge time of each essence.
I am now trying to adjust the size of the aura so the total width of all 5 (or 6) essences matches the width of another dynamic group which holds my rotation.
I am normally using a custom script in Actions -> Init for each of my resource bars on each class:
aura_env.minWidth = 200
aura_env.classNames = {
"Warrior",
"Paladin",
"Hunter",
"Rogue",
"Priest",
"DK",
"Shaman",
"Mage",
"Warlock",
"Monk",
"Druid",
"DH",
"Evoker"
}
function aura_env:Init()
-- AUTO RESIZE
local ctx = self.region.arcCustomContext
if not ctx then
ctx = {}
self.region.arcCustomContext = ctx
end
local classBar = self:GetClassBarName()
local parentRegion = WeakAuras.GetRegion(classBar)
if not parentRegion then
print(self.id, "could not find WA:", classBar)
return
end
ctx.parentRegion = parentRegion
ctx.minWidth = aura_env.minWidth
ctx.region = self.region
if not ctx.hooked then
hooksecurefunc(ctx.parentRegion, "SetWidth", function(_, width)
ctx.region:SetRegionWidth(max(ctx.minWidth, width))
end)
ctx.hooked = true
end
end
function aura_env:GetClassBarName()
local classIndex = select(3, UnitClass("player"))
local className = aura_env.classNames[classIndex]
return "Romp - " .. className .. " - Rotation"
end
aura_env:Init()
I've tried this, it doesn't change anything on the TSU auras width. I've then done some researching here in discord and found someone that used Actions -> Show -> Custom and only set the width by using:
aura_env.region:SetRegionWidth(100)
The first image shows the weakaura with no custom code, with a default width of "40". When I now tick Actions -> Show -> Init and execute the resize function mentioned in the second code snippet, it produces something like the second image - so it makes the bar a lot bigger, but it doesn't set the correct size and produces some very weird overlaps.
I'd appreciate any hints as to how to progress on this, as it's the last piece missing to my ui.