How To : Right click removing buff
Hello
I know that the new SecuredAuraheader is quite complicated to use, this is a helper to show you how RDX handle that. Create a file AuraButtonTemplate.xml : The secureAuraengine need a xml template to create buttons on the fly : Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ Size This will define the height and width of your buff, example: <Size x="30" y="30"/> Attribute : indicate the button is a cancelaura type. <Attributes> <Attribute name="type" value="cancelaura"/> </Attributes> Create the SecureAuraHeader handler : Code:
local headerAura = CreateFrame("Frame", "SAH", nil, "SecureAuraHeaderTemplate"); Code:
local f = CreateFrame("Frame"); Cheers Sigg |
Nice post ! I need that :)
|
Great, but you could even pray for people like me who have not much idea of it, explain in what folder is it?:confused::confused:
|
this is a sample code for developer LUA.
:eek: |
I'm trying to set up your example code as a standalone addon right now. I had to change some of these CreateTexture/CreateFontString calls. Also the events fire and call the updateStyle function. However I don't see any buffs ingame. Am I missing something?
Quote:
Also I did a quick search for any documentation on the SecureAuraHeaderTemplate, like.. eh.. usage maybe. ^^ Came up with basically nothing, I can't even find it in the Blizz UI Source Code.. **edit: After your example and explanation it really doesn't sound so complicated anymore, thank you for that! If only I could see my buffs. :D |
Woot, thanks :)
|
Quote:
http://github.com/tekkub/wow-ui-sour...oupHeaders.lua Thanks for the code, gonna play around with it a bit. But why does the update have to happen "on next frame"? |
Hello
About the style function, you have to call it in the next frame call, because the engine auraheader also use the event "UNIT_AURA" to update itself. What I saw, was the style function is called before the auraheader update. Goes to right : headerAura:SetAttribute("xOffset", 30); headerAura:SetAttribute("yOffset", 0); Goes to left : headerAura:SetAttribute("xOffset", -30); headerAura:SetAttribute("yOffset", 0); Goes to down : headerAura:SetAttribute("xOffset", 0); headerAura:SetAttribute("yOffset", -30); Goes to up: headerAura:SetAttribute("xOffset", 0); headerAura:SetAttribute("yOffset", 30); You should be able to move your mouse on the button and see the gametooltip. |
the SecureAuraHeaderTemplate is located in the SecureGroupHeaders.lua
|
Thanks to both of you (Ailae and sigg)!
The reason why I didn't see anything was because I forgot to call :SetPoint on the header.. *cough* It's working now. |
Now let's talk about the weapon enchant.
The system is still buggy and Blizzard has not finished it. - Rightclick on the weapon enchant is not working (bug blizzard SecureTemplates.lua:395: attempt to call global 'CancelItemTempEnchant' (a nil value)). - The gametooltip of the second enchant always show the main hand. (file SecureGroupHeaders.lua, line 777, local slot = GetInventorySlotInfo("MainHandSlot");, replace MainHandSlot by SecondaryHandSlot) - The third weapon enchant button is not implemented yet in the new securedauraheader Add this in the header : Code:
headerAura:SetAttribute("includeWeapons", 1); Code:
local tempEnchant1 = headerAura:GetAttribute("tempEnchant1"); |
These are the issues that I've encountered so far with the current implementation of the SecureAuraHeader:
SecureTemplates.lua: - You cannot cancel a weapon enchantment since the CancelTempEnchantment() function is spelled incorrectly. SecureGroupHeaders.lua: - Does not update the buttons if using a unit like "target" and the target changes, etc. - The "consolidateDuration" attribute mentioned in comments never gets used. - The "sortDir" attribute mentioned in the comments is spelled as "sortDirection" in the actual code. - The comments for the xOffset attribute say the default is width, however the code sets the default to 0. - The comments for the yOffset attribute say the default is height, however the code sets the default to 0. - sortFactory(): If the "separateOwn" attribute is 0 it will be handled as if it were -1. - configureAuras(): Setting the "wrapAfter" attribute to nil or 0 results in a divide by nil or 0 error. - configureAuras(): Cannot use a string template name for the "consolidateProxy" attribute or "consolidateHeader" attribute because the code tests the return value of type() for an uppercase 'STRING'. - configureAuras(): Assigns the slot number for the MainHandSlot to the off hand enchant button's "target-slot" attribute and :SetID(). You can work around this by comparing the child frame's value to header:GetAttribute("tempEnchant2") and supplying your own inventory slot number. - extractTemplateInfo(): Does not properly separate a template name from a widget type when both are specified in a template name string. - SecureAuraHeader_OnUpdate(): Does not track consolidated buffs in order to move them out of consolidation when time remaining is short. - SecureAuraHeader_Update(): Setting the "includeWeapons" attribute to 0 will cause weapon buttons to be displayed if they have previously been created. - SecureAuraHeader_Update(): The logic that decides which buffs to add to the consoliation frame is adding buffs with short rather than long time remaining values. - SecureAuraHeader_Update(): Due to a bug in the loop that parses the "groupBy" attribute, only the last filter in a comma separated list will be used. |
Blizzard updates the aura header anytime it is shown, it receives a UNIT_AURA event, or an attribute is assigned to it.
When setting a number of attributes in the header you can minimize the number of times Blizzard updates the header by setting the "_ignore" attribute first (or you can hide the header since the OnAttributeChanged script also ignores attribute updates when the header is not visible). As long as the "_ignore" attribute is set, Blizzard will not update the header. When you're finished changing attributes, restore the original "_ignore" attribute value. To force a header update you can then set any other attribute. Code:
local oldIgnore = header:GetAttribute("_ignore"); |
I just uploaded a first version of a very lightweight buff frame replacement using SecureAuraHeaders:
http://www.wowinterface.com/download...-nivBuffs.html Rightclicking buffs off works like a charm (except for weapon enchants, as already said). If something doesn't work, feel free to flame me. (No seriously, don't. :p ) |
This is a great guide to help me understand what I need to learn ... BIG THANK YOU!!
For my addon ProcWatch I have one bar that shows certain buffs on more than one unit (player, target, focus). From reading your guide I guess this will no longer work when I want cancleaura to work. Am I right ? |
Someone make sure Elkano sees this, ElkBB! :banana:
|
You don't need those calls to Show() and Hide() for buttons in the updateStyle() function. The headers do that on their own and the calls cause taint errors in combat.
Btw. how would I make it work with the consolidation feature, when Blizzards code to create the consolidation button from a template is broken? |
I'm playing with cancelaura ... why on earth do I have to set "unit" ?
Are there other units than player where I can cancel an aura ? ;) |
Quote:
|
Quote:
|
All times are GMT -6. The time now is 11:26 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI