Skip to content

Commit

Permalink
fix: fix auto screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
ffainy committed Nov 29, 2022
1 parent a2c9ba7 commit 5c7f12e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/modules/misc/screenshot.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
local F, C = unpack(select(2, ...))
local AS = F:RegisterModule('AutoScreenshot')

local function AchievementEarned(...)
local function AchievementEarned(_, _, alreadyEarned)
if not C.DB.General.EarnedNewAchievement then
return
end

local _, _, alreadyEarned = ...

if alreadyEarned then
return
end

F:Delay(1, _G.Screenshot)
F:Delay(1, function()
Screenshot()
end)
end

local function ChallengeModeCompleted()
Expand All @@ -21,7 +21,9 @@ local function ChallengeModeCompleted()
end

_G.ChallengeModeCompleteBanner:HookScript('OnShow', function()
F:Delay(1, _G.Screenshot)
F:Delay(1, function()
Screenshot()
end)
end)
end

Expand All @@ -30,15 +32,19 @@ local function PlayerLevelUp()
return
end

F:Delay(1, _G.Screenshot)
F:Delay(1, function()
Screenshot()
end)
end

local function PlayerDead()
if not C.DB.General.PlayerDead then
return
end

F:Delay(1, _G.Screenshot)
F:Delay(1, function()
Screenshot()
end)
end

function AS:OnLogin()
Expand Down

0 comments on commit 5c7f12e

Please sign in to comment.