Skip to content

Commit

Permalink
feat: hide the combat alert when screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
fang2hou committed Aug 25, 2024
1 parent c430d43 commit a91f4d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Modules/Misc/AutoScreenShot.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local W, F, E, L = unpack((select(2, ...)))
local M = W.Modules.Misc
local CA = W:GetModule("CombatAlert")

local _G = _G
local hooksecurefunc = hooksecurefunc
Expand All @@ -17,8 +18,18 @@ function M:DelayScreenshot(_, _, _, tried)

E:Delay(0.5, function()
if alertFrame and alertFrame.IsShown and alertFrame:IsShown() and _G.Screenshot then
local handleCombatAlert = CA and CA.db and CA.db.enable and CA.alert:IsShown()
if handleCombatAlert then
CA.alert:Hide()
end

_G.Screenshot()
alertFrame = nil

if handleCombatAlert then
CA.alert:Show()
end

E:Delay(1, F.Print, L["Screenshot has been automatically taken."])
else
self:DelayScreenshot(nil, nil, nil, tried + 1)
Expand Down

0 comments on commit a91f4d4

Please sign in to comment.