Thread Tools Display Modes
04-26-14, 06:44 PM   #1
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
Editing PlayerFrame

Is there anyway to edit the PlayerFrame through an addon?

Such as removing the character portrait or certain ui elements without having to completely make new frames?
  Reply With Quote
04-26-14, 09:56 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Code:
CharacterFramePortrait:Hide()
CharacterFramePortrait.Show = function() end
However, if you just remove the portrait, you'll still have the circular portrait frame, because that's built into the frame's background texture. To get rid of that, you'd need to make a modified version of the default texture that didn't include the circle sticking out of the corner, or just change the frame's background entirely (eg. give it a tooltip-like background).

Code:
local noop = function() end

local function HideTextures(frame)
	if not frame then return end
	for i = 1, select("#", frame:GetRegions()) do
		local region = select(i, frame:GetRegions())
		if region:IsObjectType("Texture") then
			region:SetTexture("")
			region.SetTexture = noop
		end
	end
end

CharacterFramePortrait:Hide()
CharacterFramePortrait.Show = noop

HideTextures(CharacterFrame)
HideTextures(CharacterFrame.Inset)
HideTextures(CharacterModelFrame)

CharacterFrame:SetBackdrop(GameTooltip:GetBackdrop())
CharacterFrame:SetBackdropColor(0, 0, 0)
CharacterFrame:SetBackdropBorderColor(0.8, 0.8, 0.8)
__________________
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.
  Reply With Quote
04-26-14, 11:08 PM   #3
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
The problem I am having is that none of the changes actually take effect.

I can't seem to find any info on CharacterFrame or CharacterFramePortrait.

/fstack only shows PlayerFrame/health/mana no portrait frame or anything else really.

Just having the health/mana bars visible and resized with everything else hidden is what I'm looking for at the moment.

I've not edited existing frames before but I figured it would be easier then having to replicate them with all the little things that make up the frame itself such as incoming heals, absorbs etc. I'm still searching through google but I can't seem to find much about the PlayerFrames really.
  Reply With Quote
04-27-14, 01:38 AM   #4
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Originally Posted by Spawnova View Post
The problem I am having is that none of the changes actually take effect
because you havce the hook a secure funcion or call your changes on an event.

Here's how I used to modify the player frame, I'm on ouf now. Much more managable.
__________________
Tweets YouTube Website
  Reply With Quote
04-27-14, 02:25 AM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Spawnova View Post
I'm still searching through google but I can't seem to find much about the PlayerFrames really.
I'm not surprised. There's really no point in writing up documentation about the default UI's frames, when you can just look directly at their Lua and XML source code.

http://wowpedia.org/Viewing_Blizzard's_interface_code
__________________
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.
  Reply With Quote
04-27-14, 01:34 PM   #6
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
Ahh thanks leej, I'm looking into UoF now it's seems promising and so far is easy enough to use. =P
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Editing PlayerFrame

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