-- must create a anonymous frame so we can track events local myFrame = CreateFrame("Frame") myFrame:SetScript( "OnEvent", function(self, event, ...) if event =="PLAYER_LOGIN" then -- fires on login or reload -- set all your bars MainMenuBarArtFrameBackground:Hide() MainMenuBarArtFrame.LeftEndCap:Hide() MainMenuBarArtFrame.RightEndCap:Hide() ActionBarUpButton:Hide() ActionBarDownButton:Hide() StatusTrackingBarManager:Hide() MainMenuBarArtFrame.PageNumber:Hide() -- hide tooltip GameTooltip:SetScript("OnShow", GameTooltip.Hide) -- set your local r local r = {"MultiBarBottomLeft", "Action"} -- first loop left action bar buttons for b = 1, #r do for i = 1, 12 do -- hide your current button _G[r [b] .. "Button" .. i .. "Name"]:SetAlpha(0) end end -- second loop left action bar buttons for i = 1, 12 do _G["MultiBarBottomLeftButton" .. i .. "HotKey"]:SetAlpha(0) end -- third loop action buttons for i = 1, 12 do -- hide current action button _G["ActionButton" .. i .. "HotKey"]:SetAlpha(0) end elseif event == "PLAYER_ENTERING_WORLD" then -- fires whenever a loading screen is seen -- check to see if you are in a pvp map if C_PvP.IsPVPMap() then --toggle nameplates SetCVar("nameplateShowSelf", GetCVar("nameplateShowSelf") == "0" and 1 or 0) SetCVar("nameplateShowEnemies", 1 - GetCVar("nameplateShowEnemies")) SetCVar("UnitNameFriendlyPlayerName", 1 - GetCVar("UnitNameFriendlyPlayerName")) elseif not C_PvP.IsPVPMap() then --toggle nameplates SetCVar("nameplateShowSelf", GetCVar"nameplateShowSelf"=="0" and 1 or 0) SetCVar("nameplateShowEnemies", 1-GetCVar("nameplateShowEnemies")) SetCVar("UnitNameFriendlyPlayerName", 1-GetCVar("UnitNameFriendlyPlayerName")) end end end ) -- register events to track myFrame:RegisterEvent("PLAYER_LOGIN") -- fires on login or reload myFrame:RegisterEvent("PLAYER_ENTERING_WORLD") -- fires whenever a loading screen is seen