Download
(3Kb)
Download
Updated: 10-27-10 06:52 AM
Pictures
File Info
Updated:10-27-10 06:52 AM
Created:10-09-10 08:59 AM
Downloads:10,871
Favorites:60
MD5:

Headline (Nameplates)  Popular! (More than 5000 hits)

Version: r13
by: senomar [More]

Very lightweight nameplates addon.

Nameplates for hostile players are classcolored.

Nameplates for hostile mob's are threatcolored in combat!
green: low or no threat
yellow: medium threat
red: aggro

/headline for basic settings:
- height
- width
- font size
- level display
- amplified target

Since this is a forked overhead: credits to p3lim.

r13
- removed 4.0.1a obsolete hook
r12
- option to amplify target
r10+11
- bugfixes
r9
- toggle level via /headline level
r8
- bars are threatcolored for hostile mobs in combat only. so, hostile mobs are red out of combat
r7
- moved the raid icons to a saner position
r6
- basic settings via /headline
r5
- fixes
r4
- fixed theatplates on mobs
r3
- wow 4.0.1 fixes
Post A Reply Comment Options
Unread 05-05-11, 09:53 PM  
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar

Forum posts: 143
File comments: 20
Uploads: 0
any 1 else experiencing lag/delay when they have this addon on??
Report comment to moderator  
Reply With Quote
Unread 05-02-11, 11:33 AM  
lainbh
A Kobold Labourer

Forum posts: 1
File comments: 24
Uploads: 0
Originally posted by Fugaru
Works perfectly. The only thing that's not working atm is the colour of the cast bar. All casts have the red colour, even the interruptable casts.

Any idea?
Try change 86 line to
Code:
frame:SetStatusBarColor(0, 1, 0)
Change to interruptable cast to green color, dont now now how tested this, because not interruptable cast only boss.
Report comment to moderator  
Reply With Quote
Unread 05-01-11, 02:49 PM  
Minou
A Fallenroot Satyr

Forum posts: 27
File comments: 45
Uploads: 0
Try this veesion for 4.1.0. may be errors and not good work. (replace text in headline.lua)
Thank you thank you thank you!
Report comment to moderator  
Reply With Quote
Unread 05-01-11, 01:11 PM  
Fugaru
A Murloc Raider

Forum posts: 6
File comments: 3
Uploads: 0
Originally posted by lainbh
Uncomment(remove "--[[" and "]]--") section
Code:
	--[[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]]--
Works perfectly. The only thing that's not working atm is the colour of the cast bar. All casts have the red colour, even the interruptable casts.

Any idea?
Report comment to moderator  
Reply With Quote
Unread 04-30-11, 05:40 AM  
lainbh
A Kobold Labourer

Forum posts: 1
File comments: 24
Uploads: 0
Originally posted by tordenflesk
That worked, but the aggro-coloring of the health-bar is no longer there.
Uncomment(remove "--[[" and "]]--") section
Code:
	--[[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]]--
Report comment to moderator  
Reply With Quote
Unread 04-30-11, 03:10 AM  
tordenflesk
A Deviate Faerie Dragon

Forum posts: 18
File comments: 213
Uploads: 0
That worked, but the aggro-coloring of the health-bar is no longer there.
Report comment to moderator  
Reply With Quote
Unread 04-29-11, 04:02 PM  
lainbh
A Kobold Labourer

Forum posts: 1
File comments: 24
Uploads: 0
Code:
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(1, 1, 1)
		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(HeadlineGlobalSettings.height)
	frame:SetWidth(HeadlineGlobalSettings.width)
	frame:ClearAllPoints()
	frame:SetPoint('TOP', frame:GetParent().hp, 'BOTTOM', 0, -5)

	frame.icon:SetHeight(0.01)
	frame.icon:SetWidth(0.01)

	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/3, 1/3, 1/3)

	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/3, 1/3, 1/3)

	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, 2)
	name:SetPoint('BOTTOMRIGHT', hp, 'TOPRIGHT', 0, 2)
	name:SetFont(FONT, HeadlineGlobalSettings.fsize, 'THICKOUTLINE')
	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
Try this veesion for 4.1.0. may be errors and not good work. (replace text in headline.lua)
Last edited by lainbh : 04-29-11 at 04:06 PM.
Report comment to moderator  
Reply With Quote
Unread 04-29-11, 01:43 PM  
GOKUSSJ5
A Murloc Raider

Forum posts: 6
File comments: 18
Uploads: 1
[quote]Originally posted by Skyggesang
[b]BugGrabber reports the following error with patch 4.1.

Having same Problem
Report comment to moderator  
Reply With Quote
Unread 04-29-11, 08:08 AM  
Arodan
A Kobold Labourer

Forum posts: 1
File comments: 9
Uploads: 0
Yo, please make it run for 4.1!

Best nameplate Addon ever!
Report comment to moderator  
Reply With Quote
Unread 04-28-11, 01:20 AM  
Jelcha
A Kobold Labourer

Forum posts: 0
File comments: 10
Uploads: 0
Please Update - This is my favourite nameplate addon.
Report comment to moderator  
Reply With Quote
Unread 04-27-11, 11:51 AM  
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view AddOns

Forum posts: 362
File comments: 334
Uploads: 46
Re: Changing Font

Originally posted by Herostan
Id like to change the font, is it possible? Its not as simple as changing the name in the LUA. Ty
I did it...
Edit the lua file, first line ...

Code:
local FONT = [=[Interface\AddOns\tekticles\CalibriBold.ttf]=]
I have used the calibri from tekticles.

P.s.
Please update it to works with 4.1 :-)
Report comment to moderator  
Reply With Quote
Unread 04-26-11, 03:33 PM  
Skyggesang
A Kobold Labourer
 
Skyggesang's Avatar

Forum posts: 1
File comments: 16
Uploads: 0
BugGrabber reports the following error with patch 4.1.

Code:
1x Headline\Headline-r13.lua:201: Couldn"t find CVar named "spreadnameplates"
<in C code>
Headline\Headline-r13.lua:201: in function <Headline\Headline.lua:192>

Locals:
self = <unnamed> {
 0 = <userdata>
}
e = "ADDON_LOADED"
name = "Headline"
combat = false
Report comment to moderator  
Reply With Quote
Unread 02-22-11, 02:52 PM  
Herostan
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Changing Font

Id like to change the font, is it possible? Its not as simple as changing the name in the LUA. Ty
Report comment to moderator  
Reply With Quote
Unread 01-05-11, 01:35 AM  
groin
A Cyclonian
AddOn Compiler - Click to view compilations

Forum posts: 45
File comments: 86
Uploads: 3
great addon.

can you help me to move up the frame because i have overlaps with the target face.

i need to have the nameplate over the target, detached from this.

i'm searching for anchors and x,y coords but i can't find the point in lua.

thank you.
Report comment to moderator  
Reply With Quote
Unread 12-27-10, 04:49 PM  
Vardelm
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 15
File comments: 10
Uploads: 1
I love the "target" highlighting function! I've been looking for this on a nameplates addon for a while.

Is there any way to set what alpha level all of the non-target nameplates will be?

Addon seems to perform very well so far. Nice work!
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: