Advertisement
Walkerbo

hopefully I get this right 3.0

Jul 26th, 2021
1,911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.07 KB | None | 0 0
  1. -- must create a anonymous frame so we can track events
  2. local myFrame = CreateFrame("Frame")
  3. myFrame:SetScript(
  4.     "OnEvent",
  5.     function(self, event, ...)
  6.         if event == "PLAYER_LOGIN" then -- fires on login or reload
  7.             -- hide the bars you don't want to see
  8.             MainMenuBarArtFrameBackground:Hide()
  9.             MainMenuBarArtFrame.LeftEndCap:Hide()
  10.             MainMenuBarArtFrame.RightEndCap:Hide()
  11.             ActionBarUpButton:Hide()
  12.             ActionBarDownButton:Hide()
  13.             StatusTrackingBarManager:Hide()
  14.             MainMenuBarArtFrame.PageNumber:Hide()
  15.             -- hide tooltip
  16.             GameTooltip:SetScript("OnShow", GameTooltip.Hide)
  17.             -- set your local r
  18.             local r = {"MultiBarBottomLeft", "Action"}
  19.             -- first loop left action bar buttons
  20.             for b = 1, #r do
  21.                 for i = 1, 12 do
  22.                     -- hide current button
  23.                     _G[r[b] .. "Button" .. i .. "Name"]:SetAlpha(0)
  24.                 end
  25.             end
  26.             -- second loop left action bar buttons
  27.             for i = 1, 12 do
  28.                 -- hide current button
  29.                 _G["MultiBarBottomLeftButton" .. i .. "HotKey"]:SetAlpha(0)
  30.             end
  31.             -- third loop action buttons
  32.             for i = 1, 12 do
  33.                 -- hide current action button
  34.                 _G["ActionButton" .. i .. "HotKey"]:SetAlpha(0)
  35.             end
  36.         elseif event == "PLAYER_ENTERING_WORLD" then -- fires whenever a loading screen is seen
  37.             -- check to see if you are in a pvp map, arena, brawl, wargame or battleground
  38.             if C_PvP.IsPVPMap() or C_PvP.IsRatedMap() or C_PvP.IsBattleground() or C_PvP.IsRatedBattleground() or C_PvP.IsArena() or C_PvP.IsInBrawl() or IsWargame() then                
  39.                 --show all nameplates
  40.                 SetCVar("nameplateShowSelf", 1)
  41.                 SetCVar("nameplateShowEnemies", 1)
  42.                 SetCVar("UnitNameFriendlyPlayerName", 1)
  43.                 -- show only enemy nameplates
  44.             elseif IsInRaid() or IsInInstance() then
  45.                 SetCVar("nameplateShowSelf", 0)
  46.                 SetCVar("nameplateShowEnemies", 1)
  47.                 SetCVar("UnitNameFriendlyPlayerName", 0)
  48.             else
  49.                 --hide all nameplates
  50.                 SetCVar("nameplateShowSelf", 0)
  51.                 SetCVar("nameplateShowEnemies", 0)
  52.                 SetCVar("UnitNameFriendlyPlayerName", 0)
  53.             end
  54.         elseif event == "PLAYER_ENTERING_BATTLEGROUND" then -- fires whenever a player enters a battleground
  55.             --show nameplates
  56.             SetCVar("nameplateShowSelf", 1)
  57.             SetCVar("nameplateShowEnemies", 1)
  58.             SetCVar("UnitNameFriendlyPlayerName", 1)
  59.         end
  60.     end
  61. )
  62. -- register events to track
  63. myFrame:RegisterEvent("PLAYER_LOGIN") -- fires on login or reload
  64. myFrame:RegisterEvent("PLAYER_ENTERING_WORLD") -- fires whenever a loading screen is seen
  65. myFrame:RegisterEvent("PLAYER_ENTERING_BATTLEGROUND") -- fires whenever a player enters a battleground
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement