Thread Tools Display Modes
10-28-10, 07:13 AM   #21
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Would hooking the header's OnEvent ensure that it's run after the default update so the vehicle updates do not happen to "early" ?

Edit: Should just had realized the problem lies in that the unit attribute is still player even when entering a vehicle and that's why it's not updating correctly. Just made it change unit on attribute whenever you enter or exit an vehicle.

When you change any attribute the header updates so there's not much else to do to it it seems
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 10-28-10 at 02:45 PM. Reason: whoa.. that's not english
  Reply With Quote
10-28-10, 03:19 PM   #22
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Anyone got experience with the sorting blizzard implemented? Is it working? More specifically is TIME working?

When I try it I get some weird orders...
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote
10-30-10, 05:43 PM   #23
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Originally Posted by v6o View Post
Anyone got experience with the sorting blizzard implemented? Is it working? More specifically is TIME working?

When I try it I get some weird orders...
Same here, TIME doesn't seem to work...
__________________
  Reply With Quote
10-31-10, 05:00 AM   #24
Dargen
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 22
Originally Posted by v6o View Post
Should just had realized the problem lies in that the unit attribute is still player even when entering a vehicle and that's why it's not updating correctly. Just made it change unit on attribute whenever you enter or exit an vehicle.

When you change any attribute the header updates so there's not much else to do to it it seems
One thing to remember is that you can't change the unit attribute if you are in combat when you get into or out of the vehicle.
  Reply With Quote
10-31-10, 05:08 AM   #25
Dargen
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 22
Originally Posted by Mischback View Post
Same here, TIME doesn't seem to work...
I believe sorting by time is working correctly. However, there is a bug that causes it to always separate the buffs you've cast from the buffs cast by other people, so it can look like the list is not properly sorted. It would be nice if there was a way to customize if buffs with no duration got sorted to the top or bottom.
  Reply With Quote
10-31-10, 11:21 AM   #26
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Originally Posted by Dargen View Post
One thing to remember is that you can't change the unit attribute if you are in combat when you get into or out of the vehicle.
Doh. Completely forgot about the secure restrictions.... Is it possible to change the unit attribute with secure code or should I just make a double and show/hide with a secure on-state handler (or whatever they're called)


Edit: Tried to test this in combat but not sure if I left as I was dismounted, any way to shorten this?

Code:
local sechan = CreateFrame("Frame", nil, nil, "SecureHandlerStateTemplate")
sechan:SetAttribute("_onstate-aurastate", [[
local buffs = self:GetFrameRef("auraframe1")
local debuffs = self:GetFrameRef("auraframe2")
if newstate == "invehicle" then
    buffs:SetAttribute("unit", "vehicle")
    debuffs:SetAttribute("unit", "vehicle")
elseif newstate == "notinvehicle" then
    buffs:SetAttribute("unit", "player")
    debuffs:SetAttribute("unit", "player")
end
]])

sechan:SetFrameRef("auraframe1", buffs)
sechan:SetFrameRef("auraframe2", debuffs)
RegisterStateDriver(sechan, "aurastate", "[vehicleui] invehicle; notinvehicle")
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 10-31-10 at 02:46 PM.
  Reply With Quote
11-07-10, 09:25 AM   #27
Taroven
A Cyclonian
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 49
Code:
local sechan = CreateFrame("Frame", nil, nil, "SecureHandlerStateTemplate")
sechan:SetAttribute("_onstate-aurastate", [[
local buffs = self:GetFrameRef("auraframe1")
local debuffs = self:GetFrameRef("auraframe2")
local state = newstate == "invehicle" and "vehicle" or "player"
buffs:SetAttribute("unit",state)
debuffs:SetAttribute("unit",state)
]])

sechan:SetFrameRef("auraframe1", buffs)
sechan:SetFrameRef("auraframe2", debuffs)
RegisterStateDriver(sechan, "aurastate", "[vehicleui] invehicle; notinvehicle")
Not sure about the framerefs, but that at least gets rid of the if statement.
__________________
Former author of EventHorizon Continued and Other Releases.
  Reply With Quote
11-10-10, 11:36 AM   #28
aX0rZ
A Murloc Raider
 
aX0rZ's Avatar
Join Date: Nov 2010
Posts: 6
I'm currently trying to implement SecureAuraHeaderTemplates in my UnitFrame-AddOn. So I'm using it for "unit"-Attribute-Values != "player". But I'm having some problems with it. Generally my code is based on nivBuffs which is based on the code sigg posted.

1. When i have no unit in target and then target any unit, buffs are correctly shown. But when I then target another unit, the buffs of the old unit are shown. I call the "UpdateStyle"-function when targets change but it seems SecureAuraHeaderTemplates do no adjust the buff-frames (child1, ...) when switching target.
2. Sometimes new buffs are not shown on my player frame. This is true for being inside combat aswell as for not.

Did anyone implement anything like this yet. Is it a flaw in my code or in Blizzards? Or do you need to see my code to judge that?
  Reply With Quote
11-11-10, 10:11 AM   #29
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
You need that only for player buffs. You cannot cancel buffs on your target anyway so those can be just normal textures.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
11-11-10, 10:39 AM   #30
aX0rZ
A Murloc Raider
 
aX0rZ's Avatar
Join Date: Nov 2010
Posts: 6
Well I think it simplyfies the code, for example its super easy to sort the buffs (just :SetAttribute call). Also if blizzard changes something about their buff api or how events are handeld for buffs i just have to use SecureAuraHandler witch makes it easier to maintain my code.
  Reply With Quote
11-11-10, 11:07 AM   #31
aX0rZ
A Murloc Raider
 
aX0rZ's Avatar
Join Date: Nov 2010
Posts: 6
Originally Posted by aX0rZ View Post
1. When i have no unit in target and then target any unit, buffs are correctly shown. But when I then target another unit, the buffs of the old unit are shown. I call the "UpdateStyle"-function when targets change but it seems SecureAuraHeaderTemplates do no adjust the buff-frames (child1, ...) when switching target.
Managed to resolve this issue. A simple "SecureAuraHeader_Update(header)" inserted at the beggining of "UpdateStyle" fixed that. But when now applying a new buff in combat I get an error, so it only works ooc.
  Reply With Quote
11-11-10, 12:47 PM   #32
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
You will need to force an update from an secure environment whenever your target changes. I do not know how to do this.
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.

Last edited by v6o : 11-12-10 at 01:46 AM. Reason: Rephrased
  Reply With Quote
11-11-10, 01:10 PM   #33
aX0rZ
A Murloc Raider
 
aX0rZ's Avatar
Join Date: Nov 2010
Posts: 6
Originally Posted by v6o View Post
As you change target nothing happens to the auras because the unit is still "target". You will need to force an update but you need to remember that you will have to do it from secure code.
Well how do i force an update? With SecureAuraHeader_Update()? That doesn't work infight, probably because my Event-Handler is not secure code. But how do you react to events in a secure environment? I also tried force an update with "header:SetAttribute("unit", header:GetAttribute("unit"))", because SecureAuraHeader_OnAttributeChange updates the header everytime an attribute is changed, which should be secure code since it's frome blizzard, but that didn't work.

Last edited by aX0rZ : 11-11-10 at 01:12 PM.
  Reply With Quote
11-12-10, 05:53 PM   #34
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Ok, I've been constantly trying... I've tried with XML, without, with SecureAuraHeader, with SecureActionButton .. quite frankly - my "solution" worked fine for Seerah she told me, but somehow - it doesn't work for me >.<

I can only disable first most left and most right buff. So could someone be kind and help me understand a bit more?

Code is at https://github.com/moonwitch/Furbish/tree/experimental
  Reply With Quote
11-12-10, 08:38 PM   #35
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I actually didn't need any solution other than to stop doing something stupid that was tainting after 4.0. I just changed my method to a better, smarter way.

I don't sort or filter my buffs, I only skin them. That's why it worked.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-13-10, 02:00 AM   #36
aX0rZ
A Murloc Raider
 
aX0rZ's Avatar
Join Date: Nov 2010
Posts: 6
Originally Posted by MoonWitch View Post
Ok, I've been constantly trying... I've tried with XML, without, with SecureAuraHeader, with SecureActionButton .. quite frankly - my "solution" worked fine for Seerah she told me, but somehow - it doesn't work for me >.<

I can only disable first most left and most right buff. So could someone be kind and help me understand a bit more?

Code is at https://github.com/moonwitch/Furbish/tree/experimental
As far as I understand SecureAuraHeaderTemplate the following is wrong:
  1. When you use :SetScript("OnEvent", ...) on "addon", you overite the SecureAuraHeader Event-Handler, so removing its functionallity. Rather use :HookScript().
  2. You don't need to register "UNIT_AURA" on "addon", since Blizzard does that for you.
  3. It's not "addon" that needs :EnableMouse() and :SetScript("OnEnter/OnLeave") you need to do this for every buff frame
  4. (I'm not sure on this) It seems like you want to use the default Blizzard Buff Frames, I don't know if thats possible, rather create your own (You already have in your .xml but you don't use them).
  5. You miss a bunch of :SetAttribute() calls. As far as i remember there are atleast 3 or so needed to display any buffs in any way. You can get all the attribute names at http://wow.go-hero.net/framexml/1311...oupHeaders.lua line 614.
  6. Once your BuffCount and DebuffCount reach BUFF_MAX_DISPLAY/DEBUFF_MAX_DISPLAY you unregister UNIT_AURA resulting in that Buffs are no longer updated

If you have any problems I recommend taking a look into nivBuffs it's very clean code and it's working.
  Reply With Quote
11-14-10, 07:04 AM   #37
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
I have taken a look at nivBuffs, still no win.

I took out :
- the positioning
- the ref to UNIT_AURA
- the enablemouse (and tooltip part in the xml)
- max display was taken out as well

As far attributes go : I don't quite see which ones I am missing that are needed. Unless all of them are needed, then Blizz created a monster

@Seerah : Show me?

EDIT : Apparently Show() is key :P

Last edited by MoonWitch : 11-14-10 at 07:45 AM. Reason: solved it
  Reply With Quote
11-14-10, 07:40 AM   #38
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
There really is no need to use the new SecureAuraHeaderTemplate if you are just moving and/or skinning the buff-buttons. It's only useful if you want to filter or sort buffs, since that would taint the original Blizzard BuffFrame.

So you seem to be mixing apples with oranges right now. Here's my local copy of Furbish, that I hacked a bit to also add a border. Maybe it'll help. To get the buffs where you want you must move both the BuffFrame and the ConsolidatedBuffs since Blizzards anchors the second row to ConsolidatedBuffs.

http://pastebin.com/axuBEh9G

Looking at your mission statement on what's different in your version of Furbish, it would be how the times are formatted, which is easily changed at the top of the paste I linked.
__________________
Oh, the simulated horror!
  Reply With Quote
11-14-10, 07:47 AM   #39
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Well, the mission statement was slightly outdated :P

Basically here's what the my version did :
- Skin buffs, debuffs
- relocate
- add timers

And apparently those 3 made sure I got taint >.< So I set out to solve it. (I really do need that right click) Now that being said, I could only get it partially working. It seems to have a mind of its own.

Thank you, Ailae, you solved it for me, I thought I had gone through all the global blizzy stuff, but apparently I missed one.

BUFF_WARNING_TIME <- causes taint. So it works fine now, thanks!

Last edited by MoonWitch : 11-14-10 at 08:22 AM.
  Reply With Quote
01-24-11, 09:38 AM   #40
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
Does anyone know if the problems with temporary weapon enchants in the SecureAuraHeader have been fixed on the PTR?
  Reply With Quote

WoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » How To : Right click removing buff

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off