WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Editing PlayerFrame (https://www.wowinterface.com/forums/showthread.php?t=49234)

Spawnova 04-26-14 06:44 PM

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?

Phanx 04-26-14 09:56 PM

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)


Spawnova 04-26-14 11:08 PM

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.

10leej 04-27-14 01:38 AM

Quote:

Originally Posted by Spawnova (Post 292357)
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.

Phanx 04-27-14 02:25 AM

Quote:

Originally Posted by Spawnova (Post 292357)
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

Spawnova 04-27-14 01:34 PM

Ahh thanks leej, I'm looking into UoF now it's seems promising and so far is easy enough to use. =P


All times are GMT -6. The time now is 11:31 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI