Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local important = {
- -- Crowd control
- [GetSpellInfo(55041)] = 3, -- Freezing Trap Effect
- [GetSpellInfo(5782)] = 3, -- Fear
- [GetSpellInfo(6789)] = 3, -- Mortal Coil
- [GetSpellInfo(6358)] = 3, -- Seduction
- [GetSpellInfo(5484)] = 3, -- Howl of Terror
- [GetSpellInfo(8122)] = 3, -- Psychic Scream
- [GetSpellInfo(10326)] = 3, -- Turn Evil
- [GetSpellInfo(5246)] = 3, -- Intimidating Shout
- [GetSpellInfo(118)] = 3, -- Polymorph
- [GetSpellInfo(28272)] = 3, -- Polymorph (pig)
- [GetSpellInfo(28271)] = 3, -- Polymorph (turtle)
- [GetSpellInfo(61305)] = 3, -- Polymorph (black cat)
- [GetSpellInfo(61025)] = 3, -- Polymorph (serpent)
- [GetSpellInfo(51514)] = 3, -- Hex
- [GetSpellInfo(33786)] = 3, -- Cyclone
- [GetSpellInfo(605)] = 3, -- Dominate Mind
- -- Roots
- [GetSpellInfo(339)] = 3, -- Entangling Roots
- [GetSpellInfo(122)] = 3, -- Frost Nova
- [GetSpellInfo(13809)] = 1, -- Frost Trap
- -- Stuns and incapacitates
- [GetSpellInfo(44572)] = 3, -- Deep Freeze
- [GetSpellInfo(19386)] = 3, -- Wyvern Sting
- [GetSpellInfo(853)] = 3, -- Hammer of Justice
- [GetSpellInfo(20066)] = 3, -- Repentance
- [GetSpellInfo(91800)] = 3, -- Gnaw
- [GetSpellInfo(5211)] = 3, -- Mighty Bash
- [GetSpellInfo(1822)] = 3, -- Rake
- [GetSpellInfo(107570)] = 3, -- Storm Bolt
- [GetSpellInfo(46968)] = 3, -- Shockwave
- [GetSpellInfo(30283)] = 3, -- Shadowfury
- [GetSpellInfo(6770)] = 3, -- Sap
- [GetSpellInfo(115078)] = 3, -- Paralysis
- [GetSpellInfo(1833)] = 3, -- Cheap Shot
- [GetSpellInfo(2094)] = 3, -- Blind
- [GetSpellInfo(88625)] = 3, -- Holy Word: Chastise
- [GetSpellInfo(99)] = 3, -- Incapacitating Roar
- -- Silences
- [GetSpellInfo(15487)] = 1, -- Silence
- [GetSpellInfo(47476)] = 1, -- Strangulate
- [GetSpellInfo(1330)] = 1, -- Garrote - Silence
- }
- local CanDispel = {
- DRUID = { Magic = true, Curse = true, Poison = true, },
- MONK = { Magic = true, Disease = true, Poison = true, },
- PALADIN = { Magic = true, Disease = true, Poison = true, },
- PRIEST = { Magic = true, Disease = true, },
- SHAMAN = { Magic = true, Curse = true, },
- MAGE = { Curse = true, }
- }
- local dispellist = CanDispel[select(2,UnitClass("player"))] or {}
- local Texture_SetSize = ActionButton1Icon.SetSize
- function styleCompactFrame(self)
- self:RegisterForDrag("LeftButton")
- self:SetScript("OnDragStart", function(self)
- if (self:GetParent().movable) then
- CompactRaidGroup_StartMoving(self:GetParent())
- else
- CompactRaidFrameManager_ResizeFrame_OnDragStart(CompactRaidFrameManagerContainerResizeFrameMover:GetParent():GetParent())
- end
- end)
- CompactUnitFrame_SetMaxDebuffs(self, 1)
- self:SetScript("OnDragStop", function(self)
- if (self:GetParent().movable) then
- CompactRaidGroup_StopMoving(self:GetParent())
- else
- CompactRaidFrameManager_ResizeFrame_OnDragStop(CompactRaidFrameManagerContainerResizeFrameMover:GetParent():GetParent())
- end
- end)
- self.name:SetFontObject(NumberFontNormal)
- self.name:ClearAllPoints()
- self.name:SetPoint("CENTER")
- local buffs = self.buffFrames
- local debuffs = self.debuffFrames
- local d_debuffs = self.dispelDebuffFrames
- for i=1,3 do
- Texture_SetSize(buffs[i], 20, 20) --12
- Texture_SetSize(debuffs[i], 26, 26) --32
- debuffs[i]:SetAlpha(1)
- debuffs[i]:ClearAllPoints()
- debuffs[i]:SetPoint('CENTER')
- debuffs[i].border:Hide()
- debuffs[i]:EnableMouse(false)
- d_debuffs[i]:Hide()
- d_debuffs[i].Show = function() end
- if not buffs[i].bg then
- buffs[i].icon:SetTexCoord(.1,.9,.1,.9)
- buffs[i].icon:SetPoint("TOPLEFT", 1, -1)
- buffs[i].icon:SetPoint("BOTTOMRIGHT", -1, 1)
- buffs[i].bg = buffs[i]:CreateTexture(nil, "BORDER")
- buffs[i].bg:SetAllPoints(buffs[i])
- buffs[i].bg:SetTexture(0,0,0,1)
- end
- end
- buffs[1]:ClearAllPoints()
- buffs[1]:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -1, 1)
- --self.background:SetTexture(0, 0, 0, .5)
- --self.statusText:SetFont(STANDARD_TEXT_FONT, 14, "OVERLAY")
- self.statusText:ClearAllPoints()
- self.statusText:SetPoint("BOTTOM", 0, 8)
- end
- function CompactUnitFrame_UtilIsPriorityDebuff(unit, index, filter)
- local _, _, _, _, debuffType = UnitDebuff(unit, index, filter)
- return (debuffType and dispellist[debuffType]) and true or false
- end
- function CompactUnitFrame_UpdateDebuffs(frame)
- if ( not frame.optionTable.displayDebuffs ) then CompactUnitFrame_HideAllDebuffs(frame); return; end
- local index = 1
- local _, _, icon, _, debuffType, _, _, _, _, _, spellId = UnitDebuff(frame.displayedUnit, index)
- local debuffFrame = frame.debuffFrames[1]
- debuffFrame.unstable = false
- debuffFrame:Hide()
- while spellId do
- _, _, icon, _, debuffType, _, _, _, _, _, spellId = UnitDebuff(frame.displayedUnit, index)
- if spellId == 30108 or spellId == 34914 then
- debuffFrame.unstable = true
- CompactUnitFrame_UtilSetDebuff(debuffFrame, frame.displayedUnit, index)
- styleCompactFrame(frame)
- return
- end
- index = index + 1
- end
- index = 1
- _, _, icon, _, debuffType, _, _, _, _, _, spellId = UnitDebuff(frame.displayedUnit, index)
- while spellId do
- _, _, icon, _, debuffType, _, _, _, _, _, spellId = UnitDebuff(frame.displayedUnit, index)
- if CompactUnitFrame_UtilIsPriorityDebuff(frame.displayedUnit, index) then
- if important[GetSpellInfo(spellId)] then
- CompactUnitFrame_UtilSetDebuff(debuffFrame, frame.displayedUnit, index)
- styleCompactFrame(frame)
- return
- end
- end
- index = index + 1
- end
- index = 1
- _, _, icon, _, debuffType, _, _, _, _, _, spellId = UnitDebuff(frame.displayedUnit, index)
- while spellId do
- _, _, icon, _, debuffType, _, _, _, _, _, spellId = UnitDebuff(frame.displayedUnit, index)
- if CompactUnitFrame_UtilIsPriorityDebuff(frame.displayedUnit, index) then
- CompactUnitFrame_UtilSetDebuff(debuffFrame, frame.displayedUnit, index)
- styleCompactFrame(frame)
- return
- end
- index = index + 1
- end
- end
- hooksecurefunc("CompactUnitFrame_UtilSetDebuff", function(debuffFrame, unit, index, filter)
- local _, _, icon, _, debuffType, _, _, _, _, _, spellId = UnitDebuff(unit, index, filter)
- debuffFrame.icon:SetTexCoord(.1,.9,.1,.9)
- if debuffFrame.unstable then
- debuffFrame.icon:SetDesaturated(true)
- debuffFrame:Show()
- return
- else
- debuffFrame.icon:SetDesaturated(false)
- end
- debuffFrame:Show()
- end)
- hooksecurefunc("DefaultCompactUnitFrameSetup", styleCompactFrame)
- hooksecurefunc("DefaultCompactMiniFrameSetup", styleCompactFrame)
- hooksecurefunc("CompactRaidFrameReservation_RegisterReservation", function(_, self, _) styleCompactFrame(self) end)
- --[[
- hooksecurefunc("CompactUnitFrame_UpdateName", function(self)
- if self.name and self.name:GetText() then
- if #self.name:GetText() > 8 then
- self.name:SetText(self.name:GetText():sub(1,8))
- end
- end
- end)--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement