I would like to have my frames on the right and enemy frames on left but it looks wonky with portraits. Is there a way to reverse unit and target frames or maybe something to remove the portrait from these frames so it doesn’t really matter to reverse it? In a perfect world this solution also allows me to enlarge the frames a little bit as well. thanks for the help!
Theres tons of unit frame addons that will give you that customizability.
ElvUI
Z-Perl
SUF
Pitbull
etc.
For portraits:
/run local function Flip(self)self:SetTexCoord(1, 0, 0, 1) end hooksecurefunc("SetPortraitTexture", function()Flip(PlayerPortrait) for i=1, 4 do Flip(_G["PartyMemberFrame"..i.."Portrait"]) end end) SetPortraitTexture(PlayerPortrait, "player")
Edited to stop it flipping back.
(they never remeber DUF
)
lol legit didn’t know you’d made a unitframe addon.
I didn’t make it, just keep it chugging along but it has been around since Vanilla.
As you noted, there is a bunch of good choices out there
Yo fizzlemizz, I appreciate the reply! But this isn’t exactly what I meant, I would want the whole portrait moved to the other side, as in my UF would look like enemy frames and vice versa not just reversing the way the portrait is facing. Thank you a lot if you can find a way
As Elvenbane’s post noted, it would take something like a unit frame addon and a whole lot of effort to adjust all the elements of all the unit frames you want.
You could do it without a unit frame addon, but that wouldn’t remove the requirement for “a lot of effort” and probably add the bonus of extra time time because you couldn’t see what’s going on without lots of reloads
You might be able to get a quick start using the anchoring, textures etc. from the XML for the various frames as a starting point transposing target to player/party etc… What else might be required for bits like threat and other animations is anyones guess.
PlayerFrame also has to contend with vehicles. And there’s dozens of little bits to account for and every little change is a potential for taint that will completely break the UI. It would be easier just to create a new unit frame addon than to adjust existing frames to flip them over.
I use a add-on called Adapt for the Portraits. I happen to notice if I target myself the target portrait is facing right same as me. But some targets don’t and facing left.
Is there a way to have to have the target portrait face left at all times?
Adapt doesn’t have the option but it’s still a good add-on
2d target protraits are created dynamicaly at the time they are set (which is why they always have the current look/gear). If one faces left and another faces right then that’s Blizz. setting the angle but there is no information on whichy way the 2d texture is “facing”.
You could use:
TargetFrame.TargetFrameContainer.Portrait:SetTexCoord(1, 0, 0, 1)
Which would “flip” horizonally the cuirrent setting but you woud still the same thing just reversed.
Worth a try. That be cool if it could detect and all a sudden face the player frame like you got their attention. Little details like that make a difference with in game feel
You could work with PLAYER_TARGET_CHANGED, PLAYER_REGEN_DISABLED, PLAYER_REGEN_ENABLED events to set/reset/flip the portrait toward you whan entering/leaving combat and changion targets but you would have to know which way it was facing normally, which I don’t think is available unless it’s something like NPCs face left and players face right.
I haven’t used 2D portraits since vanilla so have no idea if there’s some logic or function to know that information.
I wanted to show you the progress of my Player / Target Frames!
Let there be dragons! I’ll probably make different colors for the skin.
The scales and eye is always white so the color can be changed for any purpose in weakauras.
I’m about to use that code for the target frame see how it goes!
Thanks for helping me on this Fizz! I’m trying to to replace the Flash Frame Texture for the Target Frame now. The same way you helped me with the Player Frame but I’m guessing the Lua is a little different for that. I’m messing with the Lua as I go to see if I can get it to work but no luck so far. If you’re around and can help me that would be awesome!
TargetFrame.TargetFrameContainer.Flash
is the texture if that’s what you’re looking for.
But you can export the Blizzard UI and find all this yourself:
Yeah that’s the frame. I’m looking at the main Lua for Target Frame and see
function TargetFrame_CheckFocus()
if ( UnitIsUnit("target", "focus") ) then
TargetFrameFlash:Show();
else
TargetFrameFlash:Hide();
end
end
and
if (classification == "minus") then
self.TargetFrameContainer.FrameTexture:SetAtlas("UI-HUD-UnitFrame-Target-MinusMob-PortraitOn", TextureKitConstants.UseAtlasSize);
-- self.threatIndicator should just be set to self.TargetFrameContainer.Flash. See 'threatFrame' in TargetFrameMixin:OnLoad.
if (self.threatIndicator) then
self.threatIndicator:SetAtlas("UI-HUD-UnitFrame-Target-MinusMob-PortraitOn-InCombat", TextureKitConstants.UseAtlasSize);
end
But I’m stuck on how to change it for my own texture even with the code you gave me for the player frame ( which works great! ). Sorry bud I’m trying my best trying to understand it.
I’m still an amateur on this. I’ll keep trying in the meantime.
As far as I can tell, the target flash texture doesn’t change after it’s been set so
TargetFrame.TargetFrameContainer.Flash:SetTexture([your texture])
Should do the job.
So far I’ve tried
TargetFrame.TargetFrameContainer.Flash:SetTexture("Interface\\Addons\\Images\\DragonFlashFrame")
TargetFrame.TargetFrameContainer.Flash:SetTexCoord(1, 0, 0, 1)
And also
local function ReplaceFlashAtlas()
TargetFrame.TargetFrameContainer.Flash:SetTexture("Interface\\Addons\\Images\\DragonFlashFrame")
end
TargetFrame.TargetFrameContainer.Flash:SetTexCoord(1, 0, 0, 1)
But that didn’t work. I don’t know if it needs a hook function or not.
I tried putting in different one’s with a hook like TargetFrame_CheckFocus ect but it’s saying it’s not a function. This is my lay out so far. I tried adding the Target Frame flash code on top also with the Player Frame Function then the SetTexCord on the bottom.
local function ReplaceFlashAtlas()
PlayerFrame.PlayerFrameContainer.FrameFlash:SetTexture("Interface\\Addons\\Images\\DragonFlashFrame")
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.StatusTexture:SetTexture("Interface\\Addons\\Images\\DragonFlashFrame")
end
hooksecurefunc("PlayerFrame_ToPlayerArt", ReplaceFlashAtlas)
hooksecurefunc("PlayerFrame_ToVehicleArt", ReplaceFlashAtlas)
ReplaceFlashAtlas()
PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.StatusTexture:SetTexCoord(1, 0, 0, 1)
PlayerFrame.PlayerFrameContainer.FrameFlash:SetTexCoord(1, 0, 0, 1)
TargetFrame.TargetFrameContainer.Flash:SetTexture("Interface\\Addons\\Images\\DragonFlashFrame")
TargetFrame.TargetFrameContainer.Flash:SetTexCoord(1, 0, 0, 1)
It’s being processed in an OnUpdate which will keep hiding it until it’s needed to indicate something
When you’r in the game
/run TargetFrame.TargetFrameContainer.Flash:Show()
It will flash up briefly until the next OnUpdate.
TargetFrame.TargetFrameContainer.Flash:SetTexture("Interface\\Addons\\Images\\DragonFlashFrame")
hooksecurefunc(TargetFrame.TargetFrameContainer.Flash, "SetAtlas", function(self) self:SetTexture("Interface\\Addons\\Images\\DragonFlashFrame") end)