View Single Post
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