-- hideblizz.lua -- 2019 Aleksi Blinnikka local _; local InCombatLockdown = InCombatLockdown; -- hiding Blizzard frames somewhat based on ShadowedUF local function hideBlizzardRaidButton() if InCombatLockdown() then return end local manager = CompactRaidFrameManager; -- remove show and unlock buttons from manager manager.displayFrame.hiddenModeToggle:Hide(); manager.displayFrame.lockedModeToggle:Hide(); end local hidden = false; local function hideBlizzardRaid() if hidden then return end hidden = true; local function hide() if InCombatLockdown() then return end CompactRaidFrameContainer:Hide(); local shown = CompactRaidFrameManager_GetSetting("IsShown"); if shown and shown ~= "0" then CompactRaidFrameManager_SetSetting("IsShown", "0"); end end CompactRaidFrameContainer:UnregisterAllEvents(); -- there may still be frames created at startup getting events for i=1,MAX_RAID_MEMBERS do local frame = _G["CompactRaidFrame"..i]; if not frame then break end frame:UnregisterAllEvents(); end hooksecurefunc("CompactRaidFrameManager_UpdateShown", hide); hide(); CompactRaidFrameContainer:HookScript("OnShow", hide); hooksecurefunc("CompactRaidFrameManager_UpdateOptionsFlowContainer", hideBlizzardRaidButton); hideBlizzardRaidButton(); -- hide focus frame for _, frame in pairs({FocusFrame, FocusFrameToT, FocusFrameSpellBar}) do frame:UnregisterAllEvents(); if frame.healthbar then frame.healthbar:UnregisterAllEvents() end if frame.manabar then frame.manabar:UnregisterAllEvents() end if frame.spellbar then frame.spellbar:UnregisterAllEvents() end if frame.powerBarAlt then frame.powerBarAlt:UnregisterAllEvents() end frame:Hide(); end end local hider = CreateFrame("Frame"); hider:Hide(); hider:RegisterEvent("PLAYER_LOGIN"); hider:RegisterEvent("PLAYER_REGEN_ENABLED"); hider:SetScript("OnEvent", function(self, event) if event == "PLAYER_REGEN_ENABLED" then -- if CompactRaidFrameManager_UpdateOptionsFlowContainer was called in combat -- couldn't hide the button hideBlizzardRaidButton(); elseif event == "PLAYER_LOGIN" then hideBlizzardRaid(); end end);