The PvP and Prestige icons are two different things, though the later replaces the former when applicable. Here's code for two different options.
Restore PVP Icon:
Lua Code:
local OpposingFactions={Horde="Alliance",Alliance="Horde"};
local function UpdatePVPIcon(icon,unit,showmercenary)
local faction=UnitFactionGroup(unit);
local opposite=faction and OpposingFactions[faction];
if UnitIsPVPFreeForAll(unit) then
icon:SetAtlas("UI-HUD-UnitFrame-Player-PVP-FFAIcon",TextureKitConstants.UseAtlasSize);
icon:Show();
elseif UnitIsPVP(unit) and opposite then
icon:SetAtlas(("UI-HUD-UnitFrame-Player-PVP-%sIcon"):format((showmercenary and UnitIsMercenary(unit)) and opposite or faction),TextureKitConstants.UseAtlasSize);
icon:Show();
else icon:Hide(); end
end
hooksecurefunc("PlayerFrame_UpdatePvPStatus",function()
local parent=PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual;
UpdatePVPIcon(parent.PVPIcon,"player",true);
parent.PrestigePortrait:Hide();
parent.PrestigeBadge:Hide();
end);
local function TargetFrame_CheckFaction(self)
local parent=self.TargetFrameContent.TargetFrameContentContextual;
UpdatePVPIcon(parent.PvpIcon,self.unit,false);
parent.PrestigePortrait:Hide();
parent.PrestigeBadge:Hide();
end
hooksecurefunc(TargetFrame,"CheckFaction",TargetFrame_CheckFaction);
hooksecurefunc(FocusFrame,"CheckFaction",TargetFrame_CheckFaction);
Disable both:
Lua Code:
hooksecurefunc("PlayerFrame_UpdatePvPStatus",function()
local parent=PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual;
parent.PrestigePortrait:Hide();
parent.PrestigeBadge:Hide();
parent.PVPIcon:Hide();
PlayerPVPTimerText:Hide();
PlayerPVPTimerText.timeLeft=nil;
end);
local function TargetFrame_CheckFaction(self)
local parent=self.TargetFrameContent.TargetFrameContentContextual;
parent.PrestigePortrait:Hide();
parent.PrestigeBadge:Hide();
parent.PvpIcon:Hide();
end
hooksecurefunc(TargetFrame,"CheckFaction",TargetFrame_CheckFaction);
hooksecurefunc(FocusFrame,"CheckFaction",TargetFrame_CheckFaction);