WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   LF: Addon or Script to hide Prestige/PvP Icons. DF (https://www.wowinterface.com/forums/showthread.php?t=59486)

Imissmycatx 01-25-23 09:51 AM

LF: Addon or Script to hide Prestige/PvP Icons. DF
 
Hello, i hope some1 here can be helpful, and somehow know a script or addon that works. Ever since DF, i been looking for a Addon or Script to hide the prestige icons for Player,Target and Focus frames. Since its so big, and ugly.

So i was wondering if any1 knows a addon or script, that can help me remove em.

The addons from SL does no longer work.

Best regards,

SDPhantom 01-25-23 08:32 PM

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:
  1. local OpposingFactions={Horde="Alliance",Alliance="Horde"};
  2. local function UpdatePVPIcon(icon,unit,showmercenary)
  3.     local faction=UnitFactionGroup(unit);
  4.     local opposite=faction and OpposingFactions[faction];
  5.  
  6.     if UnitIsPVPFreeForAll(unit) then
  7.         icon:SetAtlas("UI-HUD-UnitFrame-Player-PVP-FFAIcon",TextureKitConstants.UseAtlasSize);
  8.         icon:Show();
  9.     elseif UnitIsPVP(unit) and opposite then
  10.         icon:SetAtlas(("UI-HUD-UnitFrame-Player-PVP-%sIcon"):format((showmercenary and UnitIsMercenary(unit)) and opposite or faction),TextureKitConstants.UseAtlasSize);
  11.         icon:Show();
  12.     else icon:Hide(); end
  13. end
  14.  
  15. hooksecurefunc("PlayerFrame_UpdatePvPStatus",function()
  16.     local parent=PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual;
  17.  
  18.     UpdatePVPIcon(parent.PVPIcon,"player",true);
  19.     parent.PrestigePortrait:Hide();
  20.     parent.PrestigeBadge:Hide();
  21. end);
  22.  
  23. local function TargetFrame_CheckFaction(self)
  24.     local parent=self.TargetFrameContent.TargetFrameContentContextual;
  25.  
  26.     UpdatePVPIcon(parent.PvpIcon,self.unit,false);
  27.     parent.PrestigePortrait:Hide();
  28.     parent.PrestigeBadge:Hide();
  29. end
  30.  
  31. hooksecurefunc(TargetFrame,"CheckFaction",TargetFrame_CheckFaction);
  32. hooksecurefunc(FocusFrame,"CheckFaction",TargetFrame_CheckFaction);



Disable both:
Lua Code:
  1. hooksecurefunc("PlayerFrame_UpdatePvPStatus",function()
  2.     local parent=PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual;
  3.     parent.PrestigePortrait:Hide();
  4.     parent.PrestigeBadge:Hide();
  5.     parent.PVPIcon:Hide();
  6.     PlayerPVPTimerText:Hide();
  7.     PlayerPVPTimerText.timeLeft=nil;
  8. end);
  9.  
  10. local function TargetFrame_CheckFaction(self)
  11.     local parent=self.TargetFrameContent.TargetFrameContentContextual;
  12.     parent.PrestigePortrait:Hide();
  13.     parent.PrestigeBadge:Hide();
  14.     parent.PvpIcon:Hide();
  15. end
  16.  
  17. hooksecurefunc(TargetFrame,"CheckFaction",TargetFrame_CheckFaction);
  18. hooksecurefunc(FocusFrame,"CheckFaction",TargetFrame_CheckFaction);

gmarco 01-26-23 12:09 AM

I was looking for and trying to achive the same thing but, as usual, SDPhantom's code is perfect.

Thanks so much for this.

Imissmycatx 01-26-23 04:38 AM

You are a fucking legend. Thank you so much for this script. Really appreiciate it. Cheers bro


All times are GMT -6. The time now is 08:48 AM.

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