Uzum UI
http://rghost.ru/36783928 для охотников / фералов


Неполучается нормально добавть отображение процентов хп на Headline неймплейтах , они вот всем устраивают кроме этих так нужных процентов хп , приходится пользоваться mono_nameplate ради них которые неперекрашиваются в зависимости от аггро
И немогу добавить в баффы отображение скастовавшего их игрока , что тоже иногда очень важно
Если можете помоч , подсказать что надо вписать буду очень благодарен
Баффы
local addon, ns = ...
local cfg = ns.cfg
local f = CreateFrame"Frame"
f:RegisterEvent("VARIABLES_LOADED")
f:SetScript("OnEvent", function()
SetCVar("consolidateBuffs",1) -- disabling consolidated buffs
if cfg.disable_timers then cfg.disable_timers = 0 else cfg.disable_timers = 1 end
SetCVar("buffDurations",cfg.disable_timers) -- enabling buff durations
end)
BUFFS_PER_ROW = 16
DEBUFF_MAX_DISPLAY = 16
local backdrop_tab = {
bgFile = cfg.backdrop_texture,
edgeFile = cfg.backdrop_edge_texture,
tile = false, tileSize = 0, edgeSize = 2,
insets = {left = 0, right = 0, top = 0, bottom =0 ,},}
local overlay
local make_backdrop = function(f)
f:SetFrameLevel(20)
f:SetPoint("TOPLEFT",1,-1)
f:SetPoint("BOTTOMRIGHT",-1,1)
f:SetBackdrop(backdrop_tab);
f:SetBackdropColor(0,0,0,0)
f:SetBackdropBorderColor(0,0,0,1)
end
ConsolidatedBuffs:ClearAllPoints()
ConsolidatedBuffs:SetPoint(unpack(cfg.BUFFpos))
ConsolidatedBuffs:SetSize(cfg.iconsize, cfg.iconsize)
ConsolidatedBuffs.SetPoint = nil
ConsolidatedBuffsIcon:SetTexture("Interface\\Icons\\Spell_ChargePositive")
ConsolidatedBuffsIcon:SetTexCoord(0.03,0.97,0.03,0.97)
ConsolidatedBuffsIcon:SetSize(cfg.iconsize-2,cfg.iconsize-2)
local h = CreateFrame("Frame")
h:SetParent(ConsolidatedBuffs)
h:SetAllPoints(ConsolidatedBuffs)
h:SetFrameLevel(30)
ConsolidatedBuffsCount:SetParent(h)
ConsolidatedBuffsCount:SetPoint("BOTTOMRIGHT")
ConsolidatedBuffsCount:SetFont(cfg.font, cfg.countfontsize, "OUTLINE")
local CBbg = CreateFrame("Frame", nil, ConsolidatedBuffs)
make_backdrop(CBbg)
for i = 1, 3 do
_G["TempEnchant"..i.."Border"]:Hide()
local te = _G["TempEnchant"..i]
local teicon = _G["TempEnchant"..i.."Icon"]
local teduration = _G["TempEnchant"..i.."Duration"]
local h = CreateFrame("Frame")
h:SetParent(te)
h:SetAllPoints(te)
h:SetFrameLevel(30)
te:SetSize(cfg.iconsize,cfg.iconsize)
teicon:SetPoint("BOTTOMRIGHT", te, -2, 2)
teicon:SetTexCoord(.08, .92, .08, .92)
teicon:SetPoint("TOPLEFT", te, 2, -2)
teduration:ClearAllPoints()
teduration:SetParent(h)
teduration:SetPoint("BOTTOM", 0, cfg.timeYoffset)
teduration:SetFont(cfg.font, cfg.timefontsize, "THINOUTLINE")
local bg = CreateFrame("Frame", nil, te)
make_backdrop(bg)
end
local function CreateBuffStyle(buttonName, i, debuff)
local buff = _G[buttonName..i]
local icon = _G[buttonName..i.."Icon"]
local border = _G[buttonName..i.."Border"]
local duration = _G[buttonName..i.."Duration"]
local count = _G[buttonName..i.."Count"]
if icon and not _G[buttonName..i.."Background"] then
local h = CreateFrame("Frame")
h:SetParent(buff)
h:SetAllPoints(buff)
h:SetFrameLevel(30)
icon:SetTexCoord(.08, .92, .08, .92)
icon:SetPoint("TOPLEFT", buff, 2, -2)
icon:SetPoint("BOTTOMRIGHT", buff, -2, 2)
buff:SetSize(cfg.iconsize,cfg.iconsize)
duration:ClearAllPoints()
duration:SetParent(h)
duration:SetPoint("BOTTOM", 0, cfg.timeYoffset)
duration:SetFont(cfg.font, cfg.timefontsize, "THINOUTLINE")
local bg = CreateFrame("Frame", buttonName..i.."Background", buff)
make_backdrop(bg)
count:SetParent(h)
count:ClearAllPoints()
count:SetPoint("TOPRIGHT")
count:SetFont(cfg.font, cfg.countfontsize, "OUTLINE")
end
if border then
border:SetTexture(cfg.auratex)
border:SetTexCoord(0.03, 0.97, 0.03, 0.97)
border:SetPoint("TOPLEFT",2.7,-2.7)
border:SetPoint("BOTTOMRIGHT",-2.7,2.7)
end
end
local function OverrideBuffAnchors()
local buttonName = "BuffButton" -- c
local buff, previousBuff, aboveBuff;
local numBuffs = 0;
local slack = BuffFrame.numEnchants
if ( BuffFrame.numConsolidated > 0 ) then
slack = slack + 1;
end
for i=1, BUFF_ACTUAL_DISPLAY do
CreateBuffStyle(buttonName, i, false)
local buff = _G[buttonName..i]
if not ( buff.consolidated ) then
numBuffs = numBuffs + 1
i = numBuffs + slack
buff:ClearAllPoints()
if ( (i > 1) and (mod(i, BUFFS_PER_ROW) == 1) ) then
if ( i == BUFFS_PER_ROW+1 ) then
buff:SetPoint("TOP", ConsolidatedBuffs, "BOTTOM", 0, -10)
else
buff:SetPoint("TOP", aboveBuff, "BOTTOM", 0, -10)
end
aboveBuff = buff;
elseif ( i == 1 ) then
buff:SetPoint(unpack(cfg.BUFFpos))
else
if ( numBuffs == 1 ) then
local mh, _, _, oh, _, _, te = GetWeaponEnchantInfo()
if mh and oh and te and not UnitHasVehicleUI("player") then
buff:SetPoint("TOPRIGHT", TempEnchant3, "TOPLEFT", -cfg.spacing, 0);
elseif ((mh and oh) or (mh and te) or (oh and te)) and not UnitHasVehicleUI("player") then
buff:SetPoint("TOPRIGHT", TempEnchant2, "TOPLEFT", -cfg.spacing, 0);
elseif ((mh and not oh and not te) or (oh and not mh and not te) or (te and not mh and not oh)) and not UnitHasVehicleUI("player") then
buff:SetPoint("TOPRIGHT", TempEnchant1, "TOPLEFT", -cfg.spacing, 0)
else
buff:SetPoint("TOPRIGHT", ConsolidatedBuffs, "TOPLEFT", -cfg.spacing, 0);
end
else
buff:SetPoint("RIGHT", previousBuff, "LEFT", -cfg.spacing, 0);
end
end
previousBuff = buff
end
end
end
local function OverrideDebuffAnchors(buttonName, i)
CreateBuffStyle(buttonName, i, true)
local color
local buffName = buttonName..i
local dtype = select(5, UnitDebuff("player",i))
local debuffSlot = _G[buffName.."Border"]
local debuff = _G[buttonName..i];
debuff:ClearAllPoints()
if i == 1 then
debuff:SetPoint(unpack(cfg.DEBUFFpos))
else
debuff:SetPoint("RIGHT", _G[buttonName..(i-1)], "LEFT", -cfg.spacing, 0)
end
if (dtype ~= nil) then
color = DebuffTypeColor[dtype]
else
color = DebuffTypeColor["none"]
end
if debuffSlot then debuffSlot:SetVertexColor(color.r * 0.6, color.g * 0.6, color.b * 0.6, 1) end
end
-- fixing the consolidated buff container sizes because the default formula is just SHIT!
local z = 0.79 -- 37 : 28 // 30 : 24 -- dasdas;djal;fkjl;jkfsfoi !!!! meaningfull comments we all love them!!11
local function OverrideConsolidatedBuffsAnchors()
ConsolidatedBuffsTooltip:SetWidth(min(BuffFrame.numConsolidated * cfg.iconsize * z + 18, 4 * cfg.iconsize * z + 18));
ConsolidatedBuffsTooltip:SetHeight(floor((BuffFrame.numConsolidated + 3) / 4 ) * cfg.iconsize * z + CONSOLIDATED_BUFF_ROW_HEIGHT * z);
end
hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", OverrideBuffAnchors)
hooksecurefunc("DebuffButton_UpdateAnchors", OverrideDebuffAnchors)
hooksecurefunc("ConsolidatedBuffs_UpdateAllAnchors", OverrideConsolidatedBuffsAnchors)
Неймплейтики
local FONT = [=[Fonts\FRIZQT__.TTF]=]
local TEXTURE = [=[Interface\Addons\Headline\minimalist]=]
local OVERLAY = [=[Interface\TargetingFrame\UI-TargetingFrame-Flash]=]
local combat = false
local numChildren = -1
local frames = {}
local function QueueObject(parent, object)
parent.queue = parent.queue or {}
parent.queue[object] = true
end
local function HideObjects(parent)
for object in pairs(parent.queue) do
if(object:GetObjectType() == 'Texture') then
object:SetTexture(nil)
else
object:Hide()
end
end
end
local function UpdatePlates(frame)
if(HeadlineGlobalSettings.target) then
if(UnitName('target') and frame:GetAlpha() == 1) then
frame.bg:SetTexture(0, 0, 0)
else
frame.bg:SetTexture(0, 0, 0)
end
end
if(frame.hostile) then
if(combat) then
if(frame.region:IsShown()) then
local r, g, b = frame.region:GetVertexColor()
if(g + b == 0) then
frame.hp:SetStatusBarColor(1, 0, 0)
else
frame.hp:SetStatusBarColor(1, 1, 0.3)
end
else
frame.hp:SetStatusBarColor(0.3, 1, 0.3)
end
else
frame.hp:SetStatusBarColor(1, 0, 0)
end
end
end
local function UpdateObjects(frame)
frame = frame:GetParent()
local r, g, b = frame.hp:GetStatusBarColor()
frame.hostile = g + b == 0
frame.hp:SetHeight(HeadlineGlobalSettings.height)
frame.hp:SetWidth(HeadlineGlobalSettings.width)
frame.hp:ClearAllPoints()
frame.hp:SetPoint('CENTER', frame)
if(HeadlineGlobalSettings.level) then
local r, g, b = frame.level:GetTextColor()
if(frame.bossicon:IsShown()) then
frame.name:SetText('|cffff0000??|r ' .. frame.oldname:GetText())
else
frame.name:SetText(format('|cff%02x%02x%02x', r*255, g*255, b*255) .. (frame.elite:IsShown() and '+' or '') .. tonumber(frame.level:GetText()) .. '|r ' .. frame.oldname:GetText())
end
else
frame.name:SetText(frame.oldname:GetText())
end
HideObjects(frame)
end
local function UpdateCastbar(frame)
frame:SetHeight(3)
frame:SetWidth(HeadlineGlobalSettings.width)
frame:ClearAllPoints()
frame:SetPoint('TOP', frame:GetParent().hp, 'BOTTOM', 0, -4)
frame.icon:SetHeight(13.5)
frame.icon:SetWidth(13.5)
frame.icon:SetPoint('LEFT', frame:GetParent().hp, 'LEFT', -16,-3.5)
if(not frame.shield:IsShown()) then
frame:SetStatusBarColor(1, 0.35, 0.2)
end
end
local function SkinObjects(frame)
local hp, cb = frame:GetChildren()
local threat, hpborder, overlay, oldname, level, bossicon, raidicon, elite = frame:GetRegions()
local barfill,cbborder, cbshield, cbicon=cb:GetRegions()
local offset = UIParent:GetScale() / hp:GetEffectiveScale()
local hpbg = hp:CreateTexture(nil, 'BACKGROUND')
hpbg:SetPoint('BOTTOMRIGHT', offset, -offset)
hpbg:SetPoint('TOPLEFT', -offset, offset)
hpbg:SetTexture(0, 0, 0)
frame.bg = hpbg
local hpbg2 = hp:CreateTexture(nil, 'BORDER')
hpbg2:SetAllPoints(hp)
hpbg2:SetTexture(1/6, 1/6, 1/6)
hp:HookScript('OnShow', UpdateObjects)
hp:SetStatusBarTexture(TEXTURE)
frame.hp = hp
local offset = UIParent:GetScale() / cb:GetEffectiveScale()
local cbbg = cb:CreateTexture(nil, 'BACKGROUND')
cbbg:SetPoint('BOTTOMRIGHT', offset, -offset)
cbbg:SetPoint('TOPLEFT', -offset, offset)
cbbg:SetTexture(0, 0, 0)
local cbbg2 = cb:CreateTexture(nil, 'BORDER')
cbbg2:SetAllPoints(cb)
cbbg2:SetTexture(1/6, 1/6, 1/6)
cb.icon = cbicon
cb.shield = cbshield
cb:HookScript('OnShow', UpdateCastbar)
cb:HookScript('OnSizeChanged', UpdateCastbar)
cb:SetStatusBarTexture(TEXTURE)
frame.cb = cb
local name = hp:CreateFontString(nil, 'OVERLAY')
name:SetPoint('BOTTOMLEFT', hp, 'TOPLEFT', 0, 4)
name:SetPoint('BOTTOMRIGHT', hp, 'TOPRIGHT', 0, 4)
name:SetFont(FONT, 8, 'OUTLINE')
frame.oldname = oldname
frame.name = name
raidicon:ClearAllPoints()
raidicon:SetPoint('CENTER', hp, 'CENTER', 0, 5)
raidicon:SetSize(20, 20)
if(HeadlineGlobalSettings.level) then
frame.bossicon = bossicon
frame.elite = elite
frame.level = level
end
QueueObject(frame, threat)
QueueObject(frame, hpborder)
QueueObject(frame, cbshield)
QueueObject(frame, cbborder)
QueueObject(frame, overlay)
QueueObject(frame, oldname)
QueueObject(frame, level)
QueueObject(frame, bossicon)
QueueObject(frame, elite)
UpdateObjects(hp)
UpdateCastbar(cb)
frames[frame] = true
end
local select = select
local function HookFrames(...)
for index = 1, select('#', ...) do
local frame = select(index, ...)
local region = frame:GetRegions()
if(not frames[frame] and region and region:GetObjectType() == 'Texture' and region:GetTexture() == OVERLAY) then
--and not frame:GetName()
SkinObjects(frame)
frame.region = region
end
end
end
local f = CreateFrame'Frame'
f:RegisterEvent('ADDON_LOADED')
f:RegisterEvent('PLAYER_REGEN_ENABLED')
f:RegisterEvent('PLAYER_REGEN_DISABLED')
f:SetScript('OnUpdate', function(self, elapsed)
if(WorldFrame:GetNumChildren() ~= numChildren) then
numChildren = WorldFrame:GetNumChildren()
HookFrames(WorldFrame:GetChildren())
end
if(self.elapsed and self.elapsed > 0.1) then
for frame in pairs(frames) do
UpdatePlates(frame)
end
self.elapsed = 0
else
self.elapsed = (self.elapsed or 0) + elapsed
end
end)
f:SetScript('OnEvent', function(self, e, name)
if(e == 'PLAYER_REGEN_DISABLED') then
combat = true
elseif(e == 'PLAYER_REGEN_ENABLED') then
combat = false
elseif(name == 'Headline' and e == 'ADDON_LOADED') then
if not HeadlineGlobalSettings then HeadlineGlobalSettings = { width = 110, height = 5, fsize = 9, level = true, target = true } end
SetCVar('ShowClassColorInNameplate', 1)
SetCVar('bloattest', 0)
SetCVar('nameplateMotion', 1)
SetCVar('bloatnameplates', 0)
SetCVar('bloatthreat', 0)
end
end)
SLASH_HEADLINE1 = '/headline';
function SlashCmdList.HEADLINE(args)
local arg = string.split(' ', args):lower() or args:lower()
if(arg == 'width') then
arg = tonumber(select(2, string.split(' ', args)))
if(arg and arg > 49 and arg < 301) then
HeadlineGlobalSettings.width = arg
ReloadUI()
end
elseif(arg == 'height') then
arg = tonumber(select(2, string.split(' ', args)))
if(arg and arg > 1 and arg < 51) then
HeadlineGlobalSettings.height = arg
ReloadUI()
end
elseif(arg == 'fontsize') then
arg = tonumber(select(2, string.split(' ', args)))
if(arg and arg > 4 and arg < 31) then
HeadlineGlobalSettings.fsize = arg
ReloadUI()
end
elseif(arg == 'level') then
HeadlineGlobalSettings.level = not HeadlineGlobalSettings.level
ReloadUI()
elseif(arg == 'target') then
HeadlineGlobalSettings.target = not HeadlineGlobalSettings.target
ReloadUI()
else
print('Headline')
print(' - |cFF33FF99width <num>|r: current width is '..HeadlineGlobalSettings.width)
print(' - |cFF33FF99height <num>|r: current height is '..HeadlineGlobalSettings.height)
print(' - |cFF33FF99fontsize <num>|r: current font size is '..HeadlineGlobalSettings.fsize)
print(' - |cFF33FF99level|r: toggles the level display')
print(' - |cFF33FF99target|r: amplify target display')
end
end