Thread Tools Display Modes
Old 11-29-12, 05:49 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,310
Killing the loss of control actionbutton cooldown

Source: http://www.arenajunkies.com/topic/23...orking-method/

Lua Code:
  1. local disableLossOfControlCooldown = function()
  2.   for _, b in pairs(ActionBarActionEventsFrame.frames) do
  3.     b.cooldown:SetLossOfControlCooldown(0,0)
  4.   end
  5. end
  6.  
  7. local f = CreateFrame("Frame")
  8. f:RegisterEvent("LOSS_OF_CONTROL_ADDED")
  9. f:RegisterEvent("LOSS_OF_CONTROL_UPDATE")
  10. f:SetScript("OnEvent", disableLossOfControlCooldown)

Not sure if there is anything better. Maybe it even possible to just kill SetLossOfControlCooldown.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline  
Old 11-29-12, 08:04 AM   #2
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 751
Is it triggered by an event or on the C-side? If event, just unregistered it would suffice. :P If not then you could override SetLossOfControlCooldown to simply do nothing on the action bar cooldown widgets.
__________________
Profile: Curse | Wowhead
Vlad is offline  
Old 11-29-12, 08:26 AM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,190
Wish I'd seen this before I uploaded a small addon.

It's not using this exact method but it's close.

@Vlad: unfortunately the red-out cooldown on the actionbars is triggered c-side, unregistering the events accomplishes nothing.

Last edited by Dridzt : 11-29-12 at 04:17 PM.
Dridzt is offline  
Old 11-29-12, 08:27 AM   #4
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 751
Why would they make this C-side when the API is lua side? ... makes no sense!
__________________
Profile: Curse | Wowhead
Vlad is offline  
Old 11-29-12, 03:46 PM   #5
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,977
Couldn't you just securehook the actual SetLossOfControlCooldown method on the button metatable, like OmniCC does for SetCooldown, and turn it off every time it's turned on?
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline  
Old 11-29-12, 05:40 PM   #6
semlar
A Firelord
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 469
Lua Code:
  1. local x = ActionButton1Cooldown.SetLossOfControlCooldown
  2. hooksecurefunc(getmetatable(ActionButton1Cooldown).__index, 'SetLossOfControlCooldown', function(s) x(s,0,0) end)

Still causes a cooldown shine, probably not the ideal solution.

I think replacing the function outright will end up causing taint though.
semlar is offline  
 

Go BackWoWInterface » WoD Beta » MoP archived threads » Killing the loss of control actionbutton cooldown

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