Skip to content

Instantly share code, notes, and snippets.

@obble

obble/pr.lua Secret

Created August 28, 2016 19:16
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 obble/1058f64b9cd51804e885642a804195a1 to your computer and use it in GitHub Desktop.
Save obble/1058f64b9cd51804e885642a804195a1 to your computer and use it in GitHub Desktop.
local _, addon = ...
local options = function()
local _, class = UnitClass'player'
local colour = RAID_CLASS_COLORS[class]
DefaultCompactNamePlatePlayerFrameSetUpOptions['healthBarHeight'] = 9
DefaultCompactNamePlatePlayerFrameOptions['healthBarColorOverride'] = CreateColor(colour.r, colour.g, colour.b) -- this will still class colour your other nameplates too unfortunately
end
local buffs = function(self)
local f = self:GetParent()
for i = 1, 4 do
local bu = _G[f:GetName()..'Buff'..i]
if bu and not bu.skinned then
bu:SetSize(18, 12)
addon.BD(bu)
bu.skinned = true
end
end
end
local mana = function(self)
self:SetHeight(10) -- 1 more px to match, no idea why
addon.SB(self)
addon.BD(self)
end
local cp = function(self)
local max = UnitPowerMax('player', SPELL_POWER_COMBO_POINTS)
local x = 13
for i = 1, max do
self.ComboPoints[i].Point:SetSize(x, x)
self.ComboPoints[i].Point:SetTexture[[Interface\AddOns\iipui\art\nameplate\cp.tga]]
self.ComboPoints[i].Point:SetVertexColor(0, 1, .1)
self.ComboPoints[i].Background:SetSize(x, x)
self.ComboPoints[i].Background:SetTexture[[Interface\AddOns\iipui\art\nameplate\cp.tga]]
self.ComboPoints[i].Background:SetVertexColor(.2, .2, .2)
end
end
local style = function(frame)
if frame.styled then return end
addon.SB(frame.healthBar)
addon.BD(frame.healthBar)
addon.SB(frame.healthBar.background)
frame.healthBar.background:SetDrawLayer'BORDER'
frame.healthBar.background:SetVertexColor(r, g, b)
for _, v in pairs({frame.selectionHighlight, frame.aggroHighlight}) do
v:SetTexture''
end
frame.RaidTargetFrame.RaidTargetIcon:SetSize(15, 15)
frame.RaidTargetFrame.RaidTargetIcon:SetParent(frame.healthBar)
frame.RaidTargetFrame.RaidTargetIcon:ClearAllPoints()
frame.RaidTargetFrame.RaidTargetIcon:SetPoint('LEFT', frame.healthBar, 2, 4)
frame.RaidTargetFrame.RaidTargetIcon:SetDrawLayer'OVERLAY'
mana(ClassNameplateManaBarFrame)
hooksecurefunc(frame.BuffFrame, 'UpdateBuffs', buffs)
hooksecurefunc(ClassNameplateManaBarFrame, 'OnOptionsUpdated', mana)
hooksecurefunc(ClassNameplateBarRogueDruidFrame, 'UpdatePower', cp)
frame.styled = true
end
hooksecurefunc('DefaultCompactNamePlatePlayerFrameSetup', style)
lip:RegisterEvent('NAME_PLATE_CREATED', NAME_PLATE_CREATED)
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment