Thread Tools Display Modes
08-19-12, 03:32 AM   #1
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
Nameplates Addon editing for MOP, help needed

Hey,

I am now using Nameplates Modifier FanUpdate:

http://www.wowinterface.com/download...FanUpdate.html

Problem is that it doesn't work at all in MOP. I don't know much about coding, if I knew what is wrong exactly, then maybe i could change it myself, but there is no LUA errors, so i have no idea how to fix this addon, if anyone can give me some guidance, on how to fix this addon for MOP i would be rly greatful.

Or maybe someone knows how to create a simple Nameplates addon for MOP, from the scratch, I need 2 functions:

-Default Nameplates with Smooth Texture
-Health Percentages display in the middle of nameplate.

Just like that:

 
08-20-12, 02:02 AM   #2
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
So far i got this code, and nameplates smooth texture works now, any idea what to add to display hp %?

Code:
local numChildren = -1;
local handledNameplates = {};
local TEXTURE_PATH = "Interface\\AddOns\\Nameplates\\images\\smooth"; --Set the new statusbar texture path

local function SkinPlate(frame)
	local healthBar, castBar = frame:GetChildren();
	healthBar:SetStatusBarTexture(TEXTURE_PATH);
	castBar:SetStatusBarTexture(TEXTURE_PATH);

	handledNameplates[frame:GetName()] = true;
end

local function HookFrames(...)
	for index = 1, select('#', ...) do
		local frame = select(index, ...);
		
		if(not handledNameplates[frame:GetName()] and (frame:GetName() and frame:GetName():find("NamePlate%d"))) then
			SkinPlate(frame);
		end
	end
end

CreateFrame('Frame'):SetScript('OnUpdate', function(self, elapsed)
	if(WorldFrame:GetNumChildren() ~= numChildren) then
		numChildren = WorldFrame:GetNumChildren();
		HookFrames(WorldFrame:GetChildren());
	end	
end)
 
08-20-12, 06:31 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Assuming "frame" refers to a nameplate:

Code:
local healthBar, castBar = frame:GetChildren()
local glowRegion, overlayRegion, highlightRegion, nameTextRegion, levelTextRegion, bossIconRegion, raidIconRegion, stateIconRegion = frame:GetRegions()
local _, castbarOverlay, shieldedRegion, spellIconRegion = castBar:GetRegions()
See any of the *Nameplates addons for more examples; the above was copied from caelNameplates.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
08-20-12, 06:43 AM   #4
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
Hey,

Thanks for reply, ive tried pasting your code, but it doesnt work, it might sound noobish, but could you tell me where exactly should i paste it, maybe im doing it wrong

thanks very much
 
08-20-12, 06:48 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
In your code, you'd put something similar inside the "SkinPlates" function. In fact, you're already using the first line I posted in your own code. Those lines simply get references to the various parts of the nameplate, and then you would need to write more code to actually modify them (eg. by moving them, changing the font, etc.).

Alternatively, you could just use a nameplate addon that's actually still maintained, or a more customizable nameplate addon that lets you change textures and fonts in-game.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
08-20-12, 06:53 AM   #6
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
So this should be done like this?, couse ive just tested it, but it still doesnt display hp% ;(

Code:
local numChildren = -1;
local handledNameplates = {};
local TEXTURE_PATH = "Interface\\AddOns\\Nameplates\\images\\smooth"; --Set the new statusbar texture path

local function SkinPlate(frame)
	local healthBar, castBar = frame:GetChildren()
	local glowRegion, overlayRegion, highlightRegion, nameTextRegion, levelTextRegion, bossIconRegion, raidIconRegion, stateIconRegion = frame:GetRegions()
	local _, castbarOverlay, shieldedRegion, spellIconRegion = castBar:GetRegions()
	healthBar:SetStatusBarTexture(TEXTURE_PATH);
	castBar:SetStatusBarTexture(TEXTURE_PATH);

	handledNameplates[frame:GetName()] = true;
end

local function HookFrames(...)
	for index = 1, select('#', ...) do
		local frame = select(index, ...);
		
		if(not handledNameplates[frame:GetName()] and (frame:GetName() and frame:GetName():find("NamePlate%d"))) then
			SkinPlate(frame);
		end
	end
end


CreateFrame('Frame'):SetScript('OnUpdate', function(self, elapsed)
	if(WorldFrame:GetNumChildren() ~= numChildren) then
		numChildren = WorldFrame:GetNumChildren();
		HookFrames(WorldFrame:GetChildren());
	end	
end)
 
08-20-12, 03:42 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by mich125 View Post
So this should be done like this?, couse ive just tested it, but it still doesnt display hp% ;(
Nameplates don't include health text by default. You have to create a font string and update it each time the health changes. Look at the code in the addon I linked in my last post; you should be able to mostly just copy and paste. Look for sections of code that mention "health".
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
 
 

WoWInterface » Site Forums » Archived Beta Forums » MoP Beta archived threads » Nameplates Addon editing for MOP, help needed

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off