Thread Tools Display Modes
10-27-13, 10:04 PM   #1
llerelol
A Murloc Raider
Join Date: Oct 2009
Posts: 7
Request: Crowd control icon on default raid frames

I'm really surprised there's no such an addon.

Here's an example:


And no, I don't wanna use grid or vuhdo or their alternative, i like default raid frames a lot, they just lack this one very important feature.
  Reply With Quote
10-27-13, 11:45 PM   #2
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
Originally Posted by llerelol View Post
I'm really surprised there's no such an addon.

Here's an example:


And no, I don't wanna use grid or vuhdo or their alternative, i like default raid frames a lot, they just lack this one very important feature.
http://www.wowinterface.com/download...aidFrames.html but i not update this alot time ago
  Reply With Quote
10-28-13, 04:56 PM   #3
llerelol
A Murloc Raider
Join Date: Oct 2009
Posts: 7
well yeah i know about those, the bad thing it doest display regular buffs\debuffs in the corners as default frames do.

btw i was using your superclassic ui back in S9 and i was loving it, too bad you stopped maintaining it.
  Reply With Quote
12-05-13, 08:53 AM   #4
ckaotik
A Fallenroot Satyr
 
ckaotik's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 29
I have something along these lines in a custom addon ... here are the parts that you would probably need. However, I have not tested this code (as standalone). It assumes that any CC effect is on a diminishing return and only shows those.

P.S. Please tell me if this worked for you

Requirements:

1) a place to put the code: If you don't happen to have a dummy addon to stuff code into already, you can create one here: http://addon.bool.no
2) DRData-1.0 library, which can be found here: http://www.wowace.com/addons/drdata-1-0/
3) put this in your lua file (or the lua input box on addon.bool.no)
Lua Code:
  1. local DRData = LibStub('DRData-1.0')
  2. local hideDRType = {
  3.     ["ctrlroot"] = true,
  4.     ["shortroot"] = true,
  5.     ["disarm"] = true,
  6.     ["taunt"] = true,
  7.     ["knockback"] = true,
  8. }
  9.  
  10. local isDisabled = nil
  11. local _FRAMES = {}
  12.  
  13. local function UpdateOverlay(self)
  14.     if not self.Overlay then return end
  15.     local display, drType = nil, nil
  16.     for i = 1, 40 do
  17.         local _, _, icon, count, dispelType, _, expires, caster, _, _, spellID, canApplyAura, isBoss = UnitDebuff(self.displayedUnit or self.unit, i)
  18.         local drType = DRData:GetSpellCategory(spellID)
  19.         if drType and not hideDRType[drType] then
  20.             display = true
  21.             break
  22.         end
  23.     end
  24.  
  25.     if display then
  26.         self.Overlay.icon:SetTexture(icon)
  27.         self.Overlay.icon:SetDesaturated( caster == "player" )
  28.         self.Overlay.count:SetText(count == 1 and '' or count)
  29.         local now = GetTime()
  30.         self.Overlay.cooldown:SetCooldown(now, expires - now)
  31.  
  32.         self.Overlay:Show()
  33.     else
  34.         self.Overlay:Hide()
  35.     end
  36. end
  37.  
  38. local isHooked = nil
  39. local Disable = function(self)
  40.     local overlay = self.Overlay
  41.     if overlay then
  42.         for k, frame in ipairs(_FRAMES) do
  43.             if frame == self then
  44.                 tremove(_FRAMES, k)
  45.                 overlay:Hide()
  46.                 break
  47.             end
  48.         end
  49.  
  50.         if #_FRAMES == 0 and isHooked then
  51.             isDisabled = true
  52.         end
  53.     end
  54. end
  55.  
  56. local Enable = function(self)
  57.     local overlay = self.Overlay
  58.     if overlay then
  59.         tinsert(_FRAMES, self)
  60.         isDisabled = nil
  61.         if not isHooked then
  62.             hooksecurefunc("CompactUnitFrame_UpdateDebuffs", UpdateOverlay)
  63.             isHooked = true
  64.         end
  65.     end
  66. end
  67.  
  68. hooksecurefunc("CompactUnitFrame_UpdateVisible", function(frame)
  69.     if not frame.Overlay and frame.unit and not frame.unit:find('pet') then
  70.         local overlay = CreateFrame("Button", "$parentCUFOverlay", frame, "CompactAuraTemplate")
  71.               overlay:SetPoint('CENTER', 0, 0)
  72.               overlay:SetSize(20, 20)
  73.               overlay:EnableMouse(false)
  74.               overlay:EnableMouseWheel(false)
  75.               overlay:Hide()
  76.         frame.Overlay = overlay
  77.         Enable(frame)
  78.     end
  79. end)
4) put this in your toc file (or click 'Show advanced (TOC) options' and add this line to the toc box):
Code:
## Dependencies: DRData-1.0
__________________
It all starts to make a creepy kind of sense. Avatar

Last edited by ckaotik : 12-11-13 at 01:58 PM. Reason: Fixed declaration of variables + _ taint, fixed missing argument 'frame'
  Reply With Quote
12-05-13, 06:41 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Just FYI there is no reason to define variables outside of a loop when they will only be used inside of the loop, and doing it anyway can have unintended consequences depending on what you're using the variables for.

Don't:
Code:
    local icon, count, dispelType, expires, caster, spellID, canApplyAura, isBoss
    for i = 1, 40 do
        _, _, icon, count, dispelType, _, expires, caster, _, _, spellID, canApplyAura, isBoss = UnitDebuff(self.displayedUnit or self.unit, i)
Do:
Code:
    for i = 1, 40 do
       local  _, _, icon, count, dispelType, _, expires, caster, _, _, spellID, canApplyAura, isBoss = UnitDebuff(self.displayedUnit or self.unit, i)
(Also, your code was leaking a global _ variable, which in the past has caused UI-wide breakage. Be careful about any global leakage, but especially _ and other common variable names.)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
12-06-13, 03:15 AM   #6
llerelol
A Murloc Raider
Join Date: Oct 2009
Posts: 7
i'm currently taking a break from wow, but as soon as i return i will test it, thank you.
  Reply With Quote
12-08-13, 09:45 AM   #7
ckaotik
A Fallenroot Satyr
 
ckaotik's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 29
Originally Posted by Phanx View Post
(Also, your code was leaking a global _ variable, which in the past has caused UI-wide breakage. Be careful about any global leakage, but especially _ and other common variable names.)
I updated the snippet above, thanks. Mostly I just "ignore" _ as my files usally start with the line
Lua Code:
  1. local addonName, addon, _ = ...
as I'm sure to miss it somewhere. I'm also a big fan of findglobals.lua This code suffered a bit as I ripped it right out of it's "natural environment"...
__________________
It all starts to make a creepy kind of sense. Avatar
  Reply With Quote
12-08-13, 12:24 PM   #8
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
So figured i'd give this a shot. Get this error solo out of combat.

Code:
Message: Interface\AddOns\Test\modules\test1.lua:73: attempt to index global 'frame' (a nil value)
Time: 12/08/13 13:22:00
Count: 1
Stack: Interface\AddOns\Test\modules\test1.lua:73: in function <Interface\AddOns\Test\modules\test1.lua:72>
[C]: in function `CompactUnitFrame_UpdateVisible'
Interface\FrameXML\CompactUnitFrame.lua:243: in function `CompactUnitFrame_UpdateAll'
Interface\FrameXML\CompactUnitFrame.lua:166: in function `CompactUnitFrame_SetUpFrame'
...actRaidFrames\Blizzard_CompactRaidFrameContainer.lua:347: in function `CompactRaidFrameContainer_GetUnitFrame'
...actRaidFrames\Blizzard_CompactRaidFrameContainer.lua:317: in function `CompactRaidFrameContainer_AddUnitFrame'
...actRaidFrames\Blizzard_CompactRaidFrameContainer.lua:254: in function `CompactRaidFrameContainer_AddPlayers'
...actRaidFrames\Blizzard_CompactRaidFrameContainer.lua:176: in function `CompactRaidFrameContainer_LayoutFrames'
...actRaidFrames\Blizzard_CompactRaidFrameContainer.lua:130: in function `CompactRaidFrameContainer_TryUpdate'
...actRaidFrames\Blizzard_CompactRaidFrameContainer.lua:95: in function `CompactRaidFrameContainer_SetFlowSortFunction'
...mpactRaidFrames\Blizzard_CompactRaidFrameManager.lua:407: in function <...mpactRaidFrames\Blizzard_CompactRaidFrameManager.lua:402>
...mpactRaidFrames\Blizzard_CompactRaidFrameManager.lua:491: in function `CompactRaidFrameManager_SetSetting'
...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:572: in function `func'
...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:549: in function `CompactUnitFrameProfiles_ApplyProfile'
...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:176: in function `CompactUnitFrameProfiles_ApplyCurrentSettings'
...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:172: in function `CompactUnitFrameProfiles_ActivateRaidProfile'
...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:45: in function `CompactUnitFrameProfiles_ValidateProfilesLoaded'
...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:25: in function <...rd_CUFProfiles\Blizzard_CompactUnitFrameProfiles.lua:18>

Locals: (*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'frame' (a nil value)"
Enable = <function> defined @Interface\AddOns\Test\modules\test1.lua:60
__________________
Tweets YouTube Website
  Reply With Quote
12-11-13, 02:00 PM   #9
ckaotik
A Fallenroot Satyr
 
ckaotik's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 29
Code:
Message: Interface\AddOns\Test\modules\test1.lua:73: attempt to index global 'frame' (a nil value)
Oops, forgot the argument to the function call. Please add the "frame" argument:
Lua Code:
  1. hooksecurefunc("CompactUnitFrame_UpdateVisible", function(frame)
(I also corrected the snippet in my first post)
__________________
It all starts to make a creepy kind of sense. Avatar
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Request: Crowd control icon on default raid frames


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