Skip to content

Instantly share code, notes, and snippets.

Created September 9, 2012 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3681753 to your computer and use it in GitHub Desktop.
Save anonymous/3681753 to your computer and use it in GitHub Desktop.
oUF_Drk cfg.lua & core.lua without portrait
-----------------------------
-- INIT
-----------------------------
local addon, ns = ...
local cfg = CreateFrame("Frame")
-----------------------------
-- CONFIG
-----------------------------
--unitframes
cfg.unitframeWidth = 250
cfg.unitframeScale = 1.0 -- Keep between 1 and 1.25 to have a good result, 1 = standard
--player
cfg.playerX = -180 -- x-coordinate of the player frame
cfg.playerY = 360 -- y-coordinate of the player frame
--target
cfg.targetX = 180 -- x-coordinate of the target frame
cfg.targetY = 360 -- y-coordinate of the target frame
--boss
cfg.bossX = 15 -- x-coordinate of boss frames
cfg.bossY = -40 -- y-coordinate is for the first bossframe, additional frames will grow upwards (75px each)
--auras
cfg.playerAuras = false -- show player buffs and debuffs, disables Blizzard buff bar
cfg.AltPowerBarPlayer = false --show altpowerbar on player frame, false = blizzard standard
cfg.targetBuffs = true -- show target buff frame
cfg.targetDebuffs = true -- show target debuff frame
cfg.totBuffs = false -- show target-of-target buffs (only one can be active)
cfg.totDebuffs = true -- show target-of-target debuffs (only one can be active)
cfg.focusBuffs = false -- show focus buffs (only one can be active)
cfg.focusDebuffs = true -- show focus debuffs (only one can be active)
--class-specific bars
cfg.showRunebar = true -- show DK rune bar
cfg.showHolybar = true -- show Paladin HolyPower bar
cfg.showEclipsebar = true -- show druid Eclipse bar
cfg.showShardbar = true -- show Warlock SoulShard bar
cfg.showHarmonybar = true -- show Monk Harmony bar
cfg.showShadoworbsbar = true -- show Shadow Priest Shadow Orbs bar
cfg.showComboPoints = true -- show Rogue Combo Points
--castbar
cfg.Castbars = true -- use built-in castbars
--player
cfg.playerCastBarOnUnitframe = false
cfg.playerCastBarX = 0
cfg.playerCastBarY = 200
cfg.playerCastBarWidth = 300
cfg.playerCastBarHeight = 30
--target
cfg.targetCastBarOnUnitframe = false
cfg.targetCastBarX = 0
cfg.targetCastBarY = 250
cfg.targetCastBarWidth = 200
cfg.targetCastBarHeight = 25
--raid&party frames
cfg.ShowRaid = true -- show raid frames
cfg.ShowParty = true -- show party frames (shown as 5man raid)
cfg.RaidShowSolo = true -- show raid frames even when solo
cfg.ShowIncHeals = true -- Show incoming heals in player and raid frames
cfg.ShowTooltips = true -- Show Tooltips on raid frames
cfg.ShowRoleIcons = false -- Show Role Icons on raid frames
cfg.Indicators = true -- Show Class Indicators on raid frames (HoT's, buffs etc.)
cfg.ThreatIndicator = true -- Show Threat Indicator on raid frames
cfg.raidOrientationHorizontal = false
cfg.raidX = -410
cfg.raidY = 190
cfg.raidScale = 1
cfg.IndicatorList = {
["NUMBERS"] = {
--["DEATHKNIGHT"] = ,
["DRUID"] = "[Druid:Lifebloom][Druid:Rejuv][Druid:Regrowth]",
--["HUNTER"] = missdirect,
--["MAGE"] = ,
["MONK"] = "[Monk:EnvelopingMist][Monk:RenewingMist]",
--["PALADIN"] = ,
["PRIEST"] = "[Priest:Renew][Priest:PowerWordShield]",
--["ROGUE"] = tricks,
["SHAMAN"] = "[Shaman:Riptide][Shaman:EarthShield]",
--["WARLOCK"] = ,
["WARRIOR"] = "[Warrior:Vigilance]",
},
["SQUARE"] = {
--["DEATHKNIGHT"] = ,
--["DRUID"] = ,
--["HUNTER"] = ,
--["MAGE"] = ,
--["MONK"] = "",
["PALADIN"] = "[Paladin:Forbearance][Paladin:Beacon]",
--["PRIEST"] = ,
--["ROGUE"] = ,
--["SHAMAN"] = ,
--["WARLOCK"] = darkintent,
--["WARRIOR"] = ,
},
}
cfg.DebuffWatchList = {
debuffs = {
--## USAGE: ["DEBUFF_NAME"] = PRIORITY, ##--
--## PRIORITY -> 10: high, 9: medium, 8: low, dispellable debuffs have standard priority of 5. ##--
--## CATACLYSM ##--
--Dragon Soul
--Warlord Zon'ozz
["103434"] = 9, -- Disrupting Shadows
--Yor'sahj the Unsleeping
["103628"] = 9, -- Deep Corruption
--Hagara the Stormbinder
["109325"] = 9, -- Frostflake
["104451"] = 9, -- Ice Tomb
--Ultraxion
["105926"] = 9, -- Fading Light
--Spine of Deathwing
["109379"] = 8, -- Searing Plasma
["105490"] = 9, -- Fiery Grip
["106199"] = 10, -- Blood Corruption: Death
["106200"] = 10, -- Blood Corruption: Earth
--Madness of Deathwing
["108649"] = 9, -- Corrupting Parasite
["106400"] = 10, -- Impale
["106444"] = 9, -- Impale (Stacks)
["106794"] = 9, -- Shrapnel (should be the right one)
--["106791"] = 9, -- Shrapnel
--## MISTS OF PANDARIA ##--
--World Bosses
--Sha of Anger
["119622"] = 8, -- Growing Anger
["119626"] = 9, -- Aggressive Behavior
--Heart of Fear
--Imperial Vizier Zor'lok
["122706"] = 9, -- Noise Cancelling
["122740"] = 10, -- Convert
--Blade Lord Ta'yak
["123474"] = 8, -- Overwhelming Assault
["123175"] = 9, -- Wind Step
--Garalon
["122835"] = 8, ["129815"] = 8, -- Pheromones
["123081"] = 10, -- Pungency
--Wind Lord Mel'jarak
["121885"] = 10, ["129078"] = 10, ["121881"] = 10, -- Amber Prison
["122055"] = 8, -- Residue
["122064"] = 9, -- Corrosive Resin
--Amber-Shaper Un'sok
["122784"] = 9, ["122370"] = 9, -- Reshape Life
["121949"] = 10, -- Parasitic Growth
--["Amber Globule"] = 9,
--Grand Empress Shek'zeer
["123707"] = 8, -- Eyes of the Empress
["124097"] = 8, -- Sticky Resin
["124862"] = 10, ["124863"] = 10, -- Visions of Demise
--Mogu'shan Vaults
--The Stone Guard
["116281"] = 8, -- Cobalt Mine
["130395"] = 10, -- Jasper Chains
["116301"] = 9, -- Living Jade
["116304"] = 9, -- Living Jasper
["116199"] = 9, -- Living Cobalt
["116322"] = 9, -- Living Amethyst
--Feng the Accursed
["116942"] = 8, -- Flaming Spear
["116784"] = 9, -- Wildfire Spark
["116577"] = 10, ["116576"] = 10, ["116574"] = 10, ["116417"] = 10, -- Arcane Resonance
--Gara'jal the Spiritbinder
["117723"] = 8, -- Frail Soul
["122151"] = 9, -- Voodoo Doll
["122181"] = 10, -- Conduit to the Spirit Realm
--The Spirit Kings
["117708"] = 8, -- Maddening Shout
["118047"] = 8, ["118048"] = 8, -- Pillage
["118141"] = 9, -- Pinning Arrow
["118163"] = 8, -- Robbed Blind
["117514"] = 9, ["117529"] = 9, ["117506"] = 9,-- Undying Shadows
--Elegon
--["117878"] = 8, -- Overcharged
["117949"] = 9, -- Closed Circuit
["132222"] = 10, -- Destabilizing Energies
["132226"] = 10, -- Destabilized
--Will of the Emperor
["116829"] = 10, -- Focused Energy
--Terrace of Endless Spring
--Protectors of the Endless
["117436"] = 10, ["131931"] = 10, ["111850"] = 10, -- Lightning Prison
--[""] = 8, -- Corrupted Essence -- ID MISSING
--Tsulong
["122777"] = 8, -- Nightmares
["123011"] = 10, ["123018"] = 10, -- Terrorize
--Lei Shi
["123705"] = 10, -- Scary Fog
["123121"] = 8, -- Spray
--Sha of Fear
--[""] = 8, -- Dread Spray -- ID MISSING
},
}
--media files
cfg.statusbar_texture = "Interface\\AddOns\\oUF_Drk\\media\\Statusbar"
cfg.powerbar_texture = "Interface\\AddOns\\oUF_Drk\\media\\Aluminium"
cfg.raid_texture = "Interface\\AddOns\\oUF_Drk\\media\\Minimalist"
cfg.highlight_texture = "Interface\\AddOns\\oUF_Drk\\media\\raidbg"
cfg.portrait_texture = "Interface\\AddOns\\oUF_Drk\\media\\portrait"
cfg.backdrop_texture = "Interface\\AddOns\\oUF_Drk\\media\\backdrop"
cfg.backdrop_edge_texture = "Interface\\AddOns\\oUF_Drk\\media\\backdrop_edge"
cfg.debuff_border_texture = "Interface\\AddOns\\oUF_Drk\\media\\iconborder"
cfg.font = "Interface\\AddOns\\oUF_Drk\\media\\BigNoodleTitling.ttf"
cfg.smallfont = "Interface\\AddOns\\oUF_Drk\\media\\semplice.ttf"
cfg.raidfont = "Interface\\AddOns\\oUF_Drk\\media\\vibroceb.ttf"
cfg.squarefont = "Interface\\AddOns\\oUF_Drk\\media\\squares.ttf"
cfg.ptscale = 0.8 -- scale factor for player and target frames
cfg.miscscale = 0.8 -- scale factor for all other frames
cfg.spec = nil
cfg.updateSpec = function()
cfg.spec = GetSpecialization()
end
-----------------------------
-- HANDOVER
-----------------------------
ns.cfg = cfg
local addon, ns = ...
local cfg = ns.cfg
local lib = ns.lib
-----------------------------
-- STYLE FUNCTIONS
-----------------------------
local UnitSpecific = {
player = function(self, ...)
self.mystyle = "player"
-- Size
self:SetSize(cfg.unitframeWidth*cfg.unitframeScale, 50*cfg.unitframeScale)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addHighlight(self)
lib.addPowerBar(self)
--lib.addPortrait(self)
lib.addRaidMark(self)
if cfg.AltPowerBarPlayer then lib.addAltPowerBar(self) end
lib.addAltPowerBarString(self)
if IsAddOnLoaded("oUF_Experience") then lib.addExperienceBar(self) end
-- Buffs and Debuffs
if cfg.playerAuras then
BuffFrame:Hide()
lib.addBuffs(self)
lib.addDebuffs(self)
end
self.colors.smooth = {255/255,0/255,0/255, 255/255,50/255,50/255, 42/255,48/255,50/255}
self.Health.frequentUpdates = true
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.3
self.Power.colorClass = true
self.Power.bg.multiplier = 0.5
self.Health.Smooth = true
self.Power.Smooth = true
lib.addCastBar(self)
lib.addInfoIcons(self)
lib.addPhaseIcon(self)
lib.addQuestIcon(self)
lib.addHealPred(self)
lib.addMirrorCastBar(self)
if cfg.showRunebar then lib.addRunes(self) end
if cfg.showHolybar then lib.addHolyPower(self) end
if cfg.showHarmonybar then lib.addHarmony(self) end
if cfg.showShardbar then lib.addShards(self) end
if cfg.showEclipsebar then lib.addEclipseBar(self) end
if cfg.showShadoworbsbar then lib.addShadoworbs(self) end
self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED", cfg.updateSpec)
end,
target = function(self, ...)
self.mystyle = "target"
-- Size and Scale
self:SetSize(cfg.unitframeWidth*cfg.unitframeScale, 50*cfg.unitframeScale)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addHighlight(self)
lib.addPowerBar(self)
--lib.addPortrait(self)
--self.Portrait.PostUpdate = lib.PortraitPostUpdate
lib.addRaidMark(self)
lib.addInfoIcons(self)
lib.addPhaseIcon(self)
--style specific stuff
self.colors.smooth = {255/255,0/255,0/255, 255/255,50/255,50/255, 42/255,48/255,50/255}
self.Health.frequentUpdates = true
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.3
self.Power.colorTapping = true
self.Power.colorDisconnected = true
self.Power.colorClass = true
self.Power.colorReaction = true
self.Power.bg.multiplier = 0.5
self.Health.Smooth = true
self.Power.Smooth = true
lib.addCastBar(self)
if cfg.targetBuffs then lib.addBuffs(self) end
if cfg.targetDebuffs then lib.addDebuffs(self) end
if cfg.showComboPoints then lib.addCPoints(self) end
lib.addHealPred(self)
lib.addAltPowerBar(self)
lib.addAltPowerBarString(self)
end,
focus = function(self, ...)
self.mystyle = "focus"
-- Size and Scale
self:SetSize((cfg.unitframeWidth/2-5)*cfg.unitframeScale, 25*cfg.unitframeScale)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addHighlight(self)
lib.addPowerBar(self)
lib.addRaidMark(self)
--style specific stuff
self.colors.smooth = {255/255,0/255,0/255, 255/255,50/255,50/255, 42/255,48/255,50/255}
self.Health.frequentUpdates = false
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.3
self.Power.colorTapping = true
self.Power.colorDisconnected = true
self.Power.colorClass = true
self.Power.colorReaction = true
self.Power.colorHealth = true
self.Power.bg.multiplier = 0.5
self.Health.Smooth = true
lib.addCastBar(self)
if cfg.focusBuffs or cfg.focusDebuffs then lib.addFocusAuras(self) end
end,
targettarget = function(self, ...)
self.mystyle = "tot"
-- Size and Scale
self:SetSize((cfg.unitframeWidth/2-5)*cfg.unitframeScale, 25*cfg.unitframeScale)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addHighlight(self)
lib.addPowerBar(self)
lib.addRaidMark(self)
--style specific stuff
self.colors.smooth = {255/255,0/255,0/255, 255/255,50/255,50/255, 42/255,48/255,50/255}
self.Health.frequentUpdates = false
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.3
self.Power.colorTapping = true
self.Power.colorDisconnected = true
self.Power.colorClass = true
self.Power.colorReaction = true
self.Power.colorHealth = true
self.Power.bg.multiplier = 0.5
self.Health.Smooth = true
lib.addCastBar(self)
if cfg.totBuffs or cfg.totDebuffs then lib.addTotAuras(self) end
end,
focustarget = function(self, ...)
self.mystyle = "focustarget"
-- Size and Scale
self:SetSize((cfg.unitframeWidth/5-2)*cfg.unitframeScale, 25*cfg.unitframeScale)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addHighlight(self)
lib.addPowerBar(self)
lib.addRaidMark(self)
--style specific stuff
self.colors.smooth = {255/255,0/255,0/255, 255/255,50/255,50/255, 42/255,48/255,50/255}
self.Health.frequentUpdates = false
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.3
self.Power.colorTapping = true
self.Power.colorDisconnected = true
self.Power.colorClass = true
self.Power.colorReaction = true
self.Power.colorHealth = true
self.Power.bg.multiplier = 0.5
lib.addCastBar(self)
end,
pet = function(self, ...)
local _, playerClass = UnitClass("player")
self.mystyle = "pet"
-- Size and Scale
self:SetSize((cfg.unitframeWidth/5-2)*cfg.unitframeScale, 25*cfg.unitframeScale)
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addHighlight(self)
lib.addPowerBar(self)
lib.addRaidMark(self)
--style specific stuff
self.colors.smooth = {255/255,0/255,0/255, 255/255,50/255,50/255, 42/255,48/255,50/255}
self.Health.frequentUpdates = false
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.3
self.Power.colorTapping = true
self.Power.colorDisconnected = true
self.Power.colorClass = true
self.Power.colorReaction = true
self.Power.colorHealth = true
self.Power.bg.multiplier = 0.5
lib.addCastBar(self)
end,
raid = function(self, ...)
self.mystyle = "raid"
self.Range = {
insideAlpha = 1,
outsideAlpha = .6,
}
-- Generate Bars
lib.addHealthBar(self)
lib.addStrings(self)
lib.addHighlight(self)
lib.addPowerBar(self)
lib.addRaidMark(self)
lib.addReadyCheck(self)
lib.addResurrectIcon(self)
--style specific stuff
self.colors.health = { r=.12, g=.12, b=.12, a=1 }
self.Health.colorHealth = true
self.Health.bg.multiplier = 0.2
self.Health.frequentUpdates = true
self.Power.colorClass = true
self.Power.bg.multiplier = .35
self.Power:SetAlpha(.9)
lib.addInfoIcons(self)
lib.CreateTargetBorder(self)
--lib.CreateThreatBorder(self)
lib.addHealPred(self)
lib.addRaidDebuffs(self)
self.DrkIndicators = cfg.Indicators and true or false
self.ShowThreatIndicator = cfg.ThreatIndicator and true or false
self.Health.PostUpdate = lib.PostUpdateRaidFrame
self.Power.PostUpdate = lib.PostUpdateRaidFramePower
self:RegisterEvent('PLAYER_TARGET_CHANGED', lib.ChangedTarget)
self:RegisterEvent('GROUP_ROSTER_UPDATE', lib.ChangedTarget)
if cfg.ShowRoleIcons or not cfg.ShowTooltips then
self:SetScript("OnEnter",function()
if not cfg.ShowTooltips then GameTooltip:Hide() end
if cfg.ShowRoleIcons then self.LFDRole:SetAlpha(1) end
end)
end
if cfg.ShowRoleIcons then
self:SetScript("OnLeave",function()
self.LFDRole:SetAlpha(0)
end)
end
if not cfg.ShowTooltips then end
--self:RegisterEvent("UNIT_THREAT_LIST_UPDATE", lib.UpdateThreat)
--self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", lib.UpdateThreat)
end,
}
-- The Shared Style Function
local GlobalStyle = function(self, unit, isSingle)
self.menu = lib.spawnMenu
self:RegisterForClicks('AnyUp')
-- Call Unit Specific Styles
if(UnitSpecific[unit]) then
return UnitSpecific[unit](self)
end
end
-- The Shared Style Function for Party and Raid
local GroupGlobalStyle = function(self, unit)
self.menu = lib.spawnMenu
self:RegisterForClicks('AnyUp')
-- Call Unit Specific Styles
if(UnitSpecific[unit]) then
return UnitSpecific[unit](self)
end
end
------------------------------------------------------------------------------
--
-- BOSS FRAMES
--
------------------------------------------------------------------------------
-- generate the frames
local function CreateUnitFrame(self, unit)
self:SetSize(250, 50)
self.mystyle="boss"
lib.addHealthBar(self)
lib.addStrings(self)
lib.addPowerBar(self)
lib.addAltPowerBar(self)
lib.addAltPowerBarString(self)
lib.addCastBar(self)
lib.addRaidMark(self)
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.2
self.Power.colorClass = true
self.Power.colorReaction = true
self.Power.colorHealth = true
self.Power.bg.multiplier = 0.2
lib.addBossBuffs(self)
lib.addBossDebuffs(self)
end
-----------------------------
-- SPAWN UNITS
-----------------------------
oUF:RegisterStyle('drk', GlobalStyle)
oUF:RegisterStyle('drkGroup', GroupGlobalStyle)
oUF:Factory(function(self)
-- Single Frames
self:SetActiveStyle('drk')
self:Spawn('player'):SetPoint("TOPRIGHT",UIParent,"BOTTOM", cfg.playerX, cfg.playerY)
self:Spawn('target'):SetPoint("TOPLEFT",UIParent,"BOTTOM", cfg.targetX, cfg.targetY)
self:Spawn('targettarget'):SetPoint("BOTTOMRIGHT",oUF_drkTarget,"TOPRIGHT", 0, 7)
self:Spawn('pet'):SetPoint("BOTTOMLEFT",oUF_drkPlayer,"TOPLEFT", 0, 7)
self:Spawn('focus'):SetPoint("BOTTOMRIGHT",oUF_drkPlayer,"TOPRIGHT", 0, 7)
self:Spawn('focustarget'):SetPoint("BOTTOMLEFT",oUF_drkTarget,"TOPLEFT", 0, 7)
-- Raid Frames
if cfg.ShowRaid then
local soloraid,point
if cfg.RaidShowSolo then
soloraid = "custom show;"
else
soloraid = "party,raid"
end
if cfg.raidOrientationHorizontal then
point = "LEFT"
else
point = "TOP"
end
self:SetActiveStyle('drkGroup')
local raid = {}
for i = 1, 5 do
local header = oUF:SpawnHeader(
"drkGroup"..i,
nil,
soloraid,
"showRaid", true,
"point", point,
"startingIndex", 1,
"yOffset", -5,
"xoffset", 4,
"columnSpacing", 7,
"groupFilter", tostring(i),
"groupBy", "GROUP",
"groupingOrder", "1,2,3,4,5",
"sortMethod", "NAME",
"columnAnchorPoint", "RIGHT",
"maxColumns", 5,
"unitsPerColumn", 5,
"oUF-initialConfigFunction", [[
self:SetHeight(32)
self:SetWidth(77)
]]
)
if i == 1 then
header:SetAttribute("showSolo", true)
header:SetAttribute("showPlayer", true)
header:SetAttribute("showParty", true)
header:SetPoint("TOPLEFT",UIParent,"BOTTOMRIGHT",cfg.raidX,cfg.raidY)
else
if cfg.raidOrientationHorizontal then
header:SetPoint("TOPLEFT",raid[i-1],"BOTTOMLEFT",0,-4)
else
header:SetPoint("TOPLEFT",raid[i-1],"TOPRIGHT",4,0)
end
end
header:SetScale(cfg.raidScale)
raid[i] = header
end
end
end)
-- Boss Frames
oUF:RegisterStyle("oUF_BossBars", CreateUnitFrame)
oUF:SetActiveStyle("oUF_BossBars")
local boss1 = oUF:Spawn("boss1", "oUF_Boss1")
boss1:SetPoint("TOPLEFT", UIParent, "LEFT", cfg.bossX, cfg.bossY)
local boss2 = oUF:Spawn("boss2", "oUF_Boss2")
boss2:SetPoint("TOPLEFT", UIParent, "LEFT", cfg.bossX, cfg.bossY+75)
local boss3 = oUF:Spawn("boss3", "oUF_Boss3")
boss3:SetPoint("TOPLEFT", UIParent, "LEFT", cfg.bossX, cfg.bossY+150)
local boss4 = oUF:Spawn("boss4", "oUF_Boss4")
boss4:SetPoint("TOPLEFT", UIParent, "LEFT", cfg.bossX, cfg.bossY+225)
oUF:DisableBlizzard('party')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment