Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[-----------------------------------------------------------
- oUF_Kygo
- PvE oriented oUF layout.
- Modifications and edits are allowed to be uploaded to http://www.wowinterface.com
- ---------------------------------------------------------------]]
- --Some Tags
- oUF.Tags.Events["shorthp"] = "UNIT_HEALTH"
- oUF.Tags.Methods["shorthp"] = function(unit)
- if not UnitIsDeadOrGhost(unit) then
- local hp = UnitHealth(unit)
- return AbbreviateLargeNumbers(hp)
- end
- end
- oUF.Tags.Events["shortpp"] = "UNIT_POWER"
- oUF.Tags.Methods["shortpp"] = function(unit)
- if not UnitIsDeadOrGhost(unit) then
- local pp = UnitPower(unit)
- return AbbreviateLargeNumbers(pp)
- end
- end
- oUF.Tags.Events["shortname"] = "UNIT_NAME"
- oUF.Tags.Methods["shortname"] = function(unit)
- local name = UnitName(unit)
- return string.sub(UnitName(unit), 1, 20)
- end
- oUF.Tags.Events["readycheckicon"] = "DoReadyCheck"
- oUF.Tags.SharedEvents["IsInGroup"] = true
- oUF.Tags.Methods["readycheckicon"] = function(unit)
- if unit == "player" and IsInGroup() then
- return [[|TInterface\RAIDFRAME\ReadyCheck-Ready|t]]
- end
- end
- oUF.Tags.Events["rsicon"] = "PLAYER_UPDATE_RESTING"
- oUF.Tags.SharedEvents["PLAYER_UPDATE_RESTING"] = true
- oUF.Tags.Methods["rsicon"] = function(unit)
- if unit == "player" and IsResting() then
- return [[|TInterface\CharacterFrame\UI-StateIcon:0:0:0:-6:64:64:28:6:6:28|t]]
- end
- end
- oUF.Tags.Events["combaticon"] = "PLAYER_REGEN_DISABLED PLAYER_REGEN_ENABLED"
- oUF.Tags.SharedEvents["PLAYER_REGEN_DISABLED"] = true
- oUF.Tags.SharedEvents["PLAYER_REGEN_ENABLED"] = true
- oUF.Tags.Methods["combaticon"] = function(unit)
- if unit == "player" and UnitAffectingCombat("player") then
- return [[|TInterface\CharacterFrame\UI-StateIcon:0:0:0:0:64:64:37:58:5:26|t]]
- end
- end
- oUF.Tags.Events["licon"] = "GROUP_ROSTER_UPDATE"
- oUF.Tags.SharedEvents["GROUP_ROSTER_UPDATE"] = true
- oUF.Tags.Methods["licon"] = function(unit)
- if UnitIsGroupLeader(unit) then
- return [[|TInterface\GroupFrame\UI-Group-LeaderIcon:0|t]]
- elseif UnitInRaid(unit) and UnitIsGroupAssistant(unit) then
- return [[|TInterface\GroupFrame\UI-Group-AssistantIcon:0|t]]
- end
- end
- oUF.Tags.Events["mastericon"] = "PARTY_LOOT_METHOD_CHANGED GROUP_ROSTER_UPDATE"
- oUF.Tags.SharedEvents["PARTY_LOOT_METHOD_CHANGED"] = true
- oUF.Tags.SharedEvents["GROUP_ROSTER_UPDATE"] = true
- oUF.Tags.Methods["mastericon"] = function(unit)
- local method, pid, rid = GetLootMethod()
- if method ~= "master" then return end
- local munit
- if pid then
- if pid == 0 then
- munit = "player"
- else
- munit = "party" .. pid
- end
- elseif rid then
- munit = "raid" .. rid
- end
- if munit and UnitIsUnit(munit, unit) then
- return [[|TInterface\GroupFrame\UI-Group-MasterLooter:0:0:0:2|t]]
- end
- end
- -- Aura Bars
- local BUFF_HEIGHT = 20
- local function bar_OnUpdate(frame, elapsed)
- local t = frame.timeLeft - elapsed
- frame:SetValue(t > 0 and t or 0)
- frame.timeLeft = t
- end
- local function auras_PostCreateIcon(element, icon)
- local frame = element.__owner
- local bar = CreateFrame("StatusBar", nil, icon)
- bar:SetPoint("LEFT", icon, "RIGHT")
- bar:SetWidth(frame:GetWidth() - BUFF_HEIGHT)
- bar:SetHeight(BUFF_HEIGHT)
- bar:SetStatusBarTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal")
- bar:SetStatusBarColor(0, 0.6, 0)
- local bg = bar:CreateTexture(nil, "BACKGROUND")
- bg:SetAllPoints(true)
- bg:SetTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal")
- bg:SetVertexColor(0, 0.2, 0)
- bar.bg = bg
- bar.timeLeft = 0
- bar:SetMinMaxValues(0, 1)
- bar:SetScript("OnUpdate", bar_OnUpdate)
- icon.bar = bar
- end
- --
- local function Portrait_PostUpdate(portrait, unit)
- portrait:SetCamera(0)
- end
- local function Style(frame, unit, isSingle)
- frame:SetSize(150, 35)
- frame:RegisterForClicks("AnyUp")
- frame:SetScript("OnEnter", UnitFrame_OnEnter)
- frame:SetScript("OnLeave", UnitFrame_OnLeave)
- -----------------------------------
- -- Frame background and border --
- -----------------------------------
- frame:SetBackdrop({
- bgFile = "Interface\\AddOns\\oUF_Kygo\\Media\\backdrop", tile = false,
- edgeFile = "Interface\\AddOns\\oUF_Kygo\\Media\\backdrop_edge", edgeSize = 5,
- insets = { left = 1, right = 1 , top = 1, bottom = 1 }
- })
- frame:SetBackdropColor(0, 0, 0, .1)
- frame:SetBackdropBorderColor(0, 0, 0, 1)
- -----------------------------------
- -- Health bar --
- -----------------------------------
- local health = CreateFrame("StatusBar", nil, frame)
- health:SetPoint("TOPLEFT", frame, 5, -5)
- health:SetPoint("TOPRIGHT", frame, -5, 5)
- health:SetHeight(20)
- -- Health bar background
- local healthBG = health:CreateTexture(nil, "BACKGROUND")
- healthBG:SetAllPoints()
- healthBG:SetTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal")
- health.bg = healthBG
- -- Health bar colors
- health:SetStatusBarTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal")
- health:SetStatusBarColor(0.2, 0.2, 0.2) -- foreground color
- health.bg:SetVertexColor(0.2, 0, 0) --background color
- --Health bar text
- local healthText = health:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- healthText:SetPoint("RIGHT", health, "RIGHT")
- healthText:SetTextColor(1, 1, 1, 1)
- healthText:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- frame:Tag(healthText, "[dead][shorthp]")
- -- % HP on target and target of target
- if unit == "target" or unit == "targettarget" then
- local healthPer = health:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- healthPer:SetPoint("LEFT", health, "LEFT", 2, 0)
- healthPer:SetTextColor(1, 1, 1, 1)
- healthPer:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 6)
- frame:Tag(healthPer, "[perhp]")
- end
- frame.Health = health
- -----------------------------------
- -- Power bar --
- -----------------------------------
- local power = CreateFrame("StatusBar", nil, frame)
- power:SetPoint("TOPLEFT", health, "BOTTOMLEFT")
- power:SetPoint("TOPRIGHT", health, "BOTTOMRIGHT")
- power:SetPoint("BOTTOM", frame, 0, 5)
- --Power background
- local powerBG = power:CreateTexture(nil, "BACKGROUND")
- powerBG:SetAllPoints()
- powerBG:SetTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal")
- power:SetStatusBarTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal")
- powerBG.multiplier = 0.3
- power.bg = powerBG
- --Power Text
- local powerText = power:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- powerText:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 6)
- powerText:SetPoint("RIGHT", power, "RIGHT")
- powerText:SetTextColor(1, 1, 1, 1)
- frame:Tag(powerText, "[shortpp]")
- power.colorPower = true
- frame.Power = power
- ---------------------------------
- -- Name text --
- ---------------------------------
- if unit == "target" or unit == "targettarget" or unit == "focus" or unit == "boss1" then
- local name = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- name:SetPoint("LEFT", frame, 5, -22)
- name:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- name:SetTextColor(1, 1, 1, 1)
- frame:Tag(name, "[raidcolor][shortname]")
- end
- ---------------------------------
- --Level and classification text--
- ---------------------------------
- local level = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- level:SetPoint("RIGHT", frame, "RIGHT", -5, -22)
- level:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- level:SetTextColor(1, 1, 1, 1)
- frame:Tag(level, "[smartlevel][shortclassification]")
- --------------------------------
- -- Misc --
- --------------------------------
- local resting = health:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- resting:SetPoint("TOPLEFT", frame)
- resting:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- frame:Tag(resting, "[rsicon]")
- local master = health:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- master:SetPoint("TOPLEFT", frame, "TOPRIGHT", -15, 0)
- master:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- frame:Tag(master, "[mastericon]")
- local combaticon = health:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- combaticon:SetPoint("TOPLEFT", frame)
- combaticon:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- frame:Tag(combaticon, "[combaticon]")
- local readycheckicon = health:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- readycheckicon:SetPoint("CENTER", frame)
- readycheckicon:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- frame.Tag(readycheckicon, "[readycheckicon]")
- local licon = health:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- licon:SetPoint("TOPLEFT", frame)
- licon:SetFont("Interface\\AddOns\\oUF_Kygo\\Media\\neuropol.ttf", 10)
- frame.Tag(licon, "[licon]")
- --------------------------------
- -- Portrait --
- --------------------------------
- if unit == "player" or unit == "target" then
- local portrait = CreateFrame("PlayerModel", nil, frame)
- portrait:SetWidth(30)
- portrait:SetAlpha(0.8)
- if unit == "player" then
- portrait:SetPoint("TOPRIGHT", frame, "TOPLEFT")
- portrait:SetPoint("BOTTOMRIGHT", frame, "BOTTOMLEFT")
- else
- portrait:SetPoint("TOPLEFT", frame, "TOPRIGHT")
- portrait:SetPoint("BOTTOMLEFT", frame, "BOTTOMRIGHT")
- end
- frame.Portrait = portrait
- end
- if unit == "player" or unit == "target" then
- local portraitBG = frame:CreateTexture(nil, "BACKGROUND")
- portraitBG:SetWidth(32)
- portraitBG:SetTexture("Interface\\AddOns\\oUF_Kygo\\Media\\BlackSquare")
- portraitBG:SetAlpha(0.9)
- if unit == "player" then
- portraitBG:SetPoint("TOPRIGHT", frame, "TOPLEFT")
- portraitBG:SetPoint("BOTTOMRIGHT", frame, "BOTTOMLEFT")
- else
- portraitBG:SetPoint("TOPLEFT", frame, "TOPRIGHT")
- portraitBG:SetPoint("BOTTOMLEFT", frame, "BOTTOMRIGHT")
- end
- frame.portraitBG = portraitBG
- end
- ---------------------------------
- -- Combo Points --
- ---------------------------------
- if unit == "target" then
- local CPoints = {}
- for index = 1, MAX_COMBO_POINTS do
- local CPoint = health:CreateTexture(nil, "OVERLAY")
- -- Position and size of the combo point.
- CPoint:SetSize(10, 10)
- CPoint:SetPoint("LEFT", health, "LEFT", index * CPoint:GetWidth(), 0, 20)
- CPoint:SetTexture("Interface\\AddOns\\oUF_Kygo\\Media\\CPoint")
- CPoints[index] = CPoint
- end
- frame.CPoints = CPoints
- end
- ---------------------------------
- -- Aurabars --
- ---------------------------------
- if unit == "player" or unit == "target" then
- local Auras = CreateFrame("Frame", nil, element)
- Auras:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 0, 10)
- Auras:SetWidth(BUFF_HEIGHT) -- no, Width/HEIGHT is not a mistake
- Auras["initialAnchor"] = "BOTTOMLEFT"
- Auras["growth-y"] = "UP"
- Auras["spacing-y"] = 1 -- 1px gap between bars, adjust as desired
- Auras["num"] = 10 -- limit to showing 5 bars, adjust as desired
- Auras["size"] = BUFF_HEIGHT
- Auras.PostCreateIcon = auras_PostCreateIcon
- if unit == "player" then
- function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff)
- if duration < 30 then
- icon.bar.timeLeft = timeLeft
- icon.bar:SetMinMaxValues(0, duration)
- icon.bar:SetValue(timeLeft)
- return true
- end
- end
- frame.Buffs = Auras
- elseif unit == "target" then
- function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff)
- if canApplyAura then
- icon.bar.timeLeft = timeLeft
- icon.bar:SetMinMaxValues(0, duration)
- icon.bar:SetValue(timeLeft)
- return true
- end
- end
- frame.Debuffs = Auras
- end
- end
- --------------------------------
- -- Misc PvE Stuff --
- --------------------------------
- --[[
- local RaidRole = frame:CreateTexture(nil, "OVERLAY")
- RaidRole:SetSize(16, 16)
- RaidRole:SetPoint("TOPLEFT")
- frame.RaidRole = RaidRole
- local ReadyCheck = frame:CreateTexture(nil, "OVERLAY")
- ReadyCheck:SetTexture("Interface\\AddOns\\oUF_Kygo\\Media\\CPoint")
- ReadyCheck:SetSize(16, 16)
- ReadyCheck:SetPoint("CENTER")
- ReadyCheck.finishedTime = 10
- ReadyCheck.fadeTime = 2
- frame.ReadyCheck = ReadyCheck
- --]]
- end
- oUF:RegisterStyle("Kygo", Style)
- oUF:SetActiveStyle("Kygo")
- --Spawning units!
- local player = oUF:Spawn("player")
- player:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
- local target = oUF:Spawn("target")
- target:SetPoint("LEFT", player, "RIGHT", 20, 0)
- local pet = oUF:Spawn("pet")
- pet:SetPoint("BOTTOMLEFT", player, "TOPLEFT", 0, 20)
- local tot = oUF:Spawn("targettarget")
- tot:SetPoint("BOTTOMLEFT", target, "TOPLEFT", 0, 20)
- local focus = oUF:Spawn("focus")
- focus:SetPoint("CENTER", player, "CENTER", 0, 40)
- local boss1 = oUF:Spawn("boss1")
- boss1:SetPoint("CENTER", player, "CENTER", 0, 70)
- local party1 = oUF:Spawn("party1")
- party1:SetPoint("CENTER", player, "CENTER", 0, 110)
- local party2 = oUF:Spawn("party2")
- party2:SetPoint("CENTER", player, "CENTER", 0, 150)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement