Thread Tools Display Modes
07-01-18, 03:32 AM   #1
Lolzen
An Aku'mai Servant
 
Lolzen's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
oUF - canel buffs

I searched around and got very old info (2010ish) including haste confirming plans to implement the secure template Auras to enable canceling buffs. Obviously this never came to fruition and was regarded low priority anyways.
I still want to have that and it kinda works using the PostUpdateIcon func, however obviously tainting because of SetAllPoints().
I'm out of ideas for now how to implement it without touching oUFs core, and in addition to that ask if this feature would ever make it into oUF or is regarded useless/niche/wontdo.

Below is my current implementation snippet:
Lua Code:
  1. local PostUpdateIcon = function(icons, unit, button, index, offset, filter, isDebuff)
  2.     local texture = button.icon
  3.     if button.isPlayer then
  4.         texture:SetDesaturated(false)
  5.     else
  6.         texture:SetDesaturated(true)
  7.     end
  8.                
  9.     if not button.clickablearea then
  10.         button.clickablearea = CreateFrame("Button", nil, UIParent, "SecureActionButtonTemplate")
  11.         button.clickablearea:SetAttribute("*type2", "cancelaura")
  12.         button.clickablearea:SetAttribute("index", index)
  13.         button.clickablearea:SetAllPoints(button)
  14.         button.clickablearea:RegisterForClicks("RightButtonUp")
  15.     end
  16. end

I'm just surfacing on grasping the SecureTemplates, so i might have overseen something.
  Reply With Quote
07-01-18, 07:16 AM   #2
runamonk
A Theradrim Guardian
 
runamonk's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 61
I added support to my layout, granted it only works while not in combat which is all I wanted/needed. This will work for now until we can get a more correct way to do it.

Lua Code:
  1. local function PostCreateIcon(Auras, button)
  2.     button.count = mnkLibs.createFontString(button, mnkLibs.Fonts.ap, 10,  nil, nil, true)
  3.     button.count:ClearAllPoints()
  4.     button.count:SetPoint('TOPRIGHT', button, 0, 2)
  5.     button.timer = mnkLibs.createFontString(button, mnkLibs.Fonts.ap, 10,  nil, nil, true)
  6.     button.timer:ClearAllPoints()
  7.     button.timer:SetPoint('BOTTOMLEFT', button, 0, 0)
  8.     button.icon:SetTexCoord(.07, .93, .07, .93)
  9.     button:SetScript('OnClick', function(self, button) CancelUnitBuff('player', self:GetName():match('%d')) end)
  10.     mnkLibs.createBorder(button, 1,-1,-1,1, {0,0,0,1})
  11. end
  Reply With Quote
07-01-18, 09:16 AM   #3
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by Lolzen View Post
I'm out of ideas for now how to implement it without touching oUFs core
Use runamonk's solution, it's good enough, just add InCombatLockdown check around CancelUnitBuff, and you're good to go.

Originally Posted by Lolzen View Post
and in addition to that ask if this feature would ever make it into oUF or is regarded useless/niche/wontdo.
Nah, simply because it's something that doesn't work all the time, but only works when you're out of combat.
__________________
  Reply With Quote
07-01-18, 09:24 AM   #4
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by runamonk View Post
This will work for now until we can get a more correct way to do it.
What did you mean by "a more correct way to do it"? Yours is fine, I'd change it a bit though.

Lua Code:
  1. button:SetScript('OnClick', function(self, button)
  2.     if not InCombatLockdown() and button == "RightButton" then
  3.         CancelUnitBuff("player", self:GetID(), self.filter)
  4.     end
  5. end)
__________________
  Reply With Quote
07-01-18, 09:24 AM   #5
Lolzen
An Aku'mai Servant
 
Lolzen's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
Originally Posted by runamonk View Post
I added support to my layout, granted it only works while not in combat which is all I wanted/needed. This will work for now until we can get a more correct way to do it.

Lua Code:
  1. local function PostCreateIcon(Auras, button)
  2.     button.count = mnkLibs.createFontString(button, mnkLibs.Fonts.ap, 10,  nil, nil, true)
  3.     button.count:ClearAllPoints()
  4.     button.count:SetPoint('TOPRIGHT', button, 0, 2)
  5.     button.timer = mnkLibs.createFontString(button, mnkLibs.Fonts.ap, 10,  nil, nil, true)
  6.     button.timer:ClearAllPoints()
  7.     button.timer:SetPoint('BOTTOMLEFT', button, 0, 0)
  8.     button.icon:SetTexCoord(.07, .93, .07, .93)
  9.     button:SetScript('OnClick', function(self, button) CancelUnitBuff('player', self:GetName():match('%d')) end)
  10.     mnkLibs.createBorder(button, 1,-1,-1,1, {0,0,0,1})
  11. end
Yes, that was what i had when i started tinkering with that idea, but i wanted to be able to cancel the buffs in combat too, hence why i'm exploring this

Originally Posted by lightspark View Post
Use runamonk's solution, it's good enough, just add InCombatLockdown check around CancelUnitBuff, and you're good to go.

Nah, simply because it's something that doesn't work all the time, but only works when you're out of combat.
See above
My solution kind of works in combat, however taints. The idea back the was to add a secure version, which isn't as flexible as the current implementation due to limitations.

Thanks for the answers guys, i'll try to find a solution and will probably miserably fail and give up - however iÄm grateful for the official statement, thanks!
  Reply With Quote
07-01-18, 09:29 AM   #6
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by Lolzen View Post
My solution kind of works in combat, however taints. The idea back the was to add a secure version, which isn't as flexible as the current implementation due to limitations.
Which means it doesn't work

Using secure templates for stuff that gets shown/hidden "insecurely" via basic :Show() and :Hide() in combat is a very bad idea.

The correct way to do it securely is to use Blizz secure aura headers, but then you won't be able to use custom filters, you'll have to rely on fairly basic Blizz aura filtering options.
__________________
  Reply With Quote
07-01-18, 09:34 AM   #7
runamonk
A Theradrim Guardian
 
runamonk's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 61
Originally Posted by lightspark View Post
What did you mean by "a more correct way to do it"? Yours is fine, I'd change it a bit though.

Lua Code:
  1. button:SetScript('OnClick', function(self, button)
  2.     if not InCombatLockdown() and button == "RightButton" then
  3.         CancelUnitBuff("player", self:GetID(), self.filter)
  4.     end
  5. end)
Just a hope that one day blizzard will let us cancel auras while in combat.
  Reply With Quote
07-01-18, 09:35 AM   #8
Lolzen
An Aku'mai Servant
 
Lolzen's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
Originally Posted by lightspark View Post
Which means it doesn't work
True :P

Basically i liked how oUF handled the Auras for me, so i loved the idea to use oUF as a bufframe replacement.
I get it simply isn't possible with my vision without basically implementing a plugin which is a secureAuraTemplate itself which kinda defeats the purpose entirely.
  Reply With Quote
07-01-18, 09:36 AM   #9
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by runamonk View Post
Just a hope that one day blizzard will let us cancel auras while in combat.
Not gonna happen, if they do, we'll just go back to Vanilla days of automated aura cancelling in raids/bgs/etc.
__________________

Last edited by lightspark : 07-01-18 at 09:39 AM.
  Reply With Quote
07-01-18, 09:39 AM   #10
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by Lolzen View Post
True :P

Basically i liked how oUF handled the Auras for me, so i loved the idea to use oUF as a bufframe replacement.
I get it simply isn't possible with my vision without basically implementing a plugin which is a secureAuraTemplate itself which kinda defeats the purpose entirely.
Buff frame? O_o Do you mean the one that's next to your minimap in the default UI? o_O If that's the case, you def shouldn't be using oUF for that, just use "SecureAuraHeaderTemplate" and build a custom addon around it.
__________________
  Reply With Quote
07-01-18, 09:43 AM   #11
Lolzen
An Aku'mai Servant
 
Lolzen's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 36
Originally Posted by lightspark View Post
Buff frame? O_o Do you mean the one that's next to your minimap in the default UI? o_O If that's the case, you def shouldn't be using oUF for that, just use "SecureAuraHeaderTemplate" and build a custom addon around it.
Yup, Well not the "Frame" aspect of it - but exactly that. I'm not filtering anything or using consolided bufframe, so that's why it seemed "possible".
I had my reasons for trying this - i'm really that mad *shrug*
(Yes, i had/have various versions of standalone auras)
  Reply With Quote
07-01-18, 09:50 AM   #12
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by Lolzen View Post
Yup, Well not the "Frame" aspect of it - but exactly that. I'm not filtering anything or using consolided bufframe, so that's why it seemed "possible".
I had my reasons for trying this - i'm really that mad *shrug*
(Yes, i had/have various versions of standalone auras)
Welp, secure aura header is what you need then. It's there to let people implement this kind of relatively simple aura displays w/ cancellable buffs

Also, consolidated buffs are long gone.
__________________
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - canel buffs

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