From 5c7f12e016fc40252255863411fc9bbdd9cffc14 Mon Sep 17 00:00:00 2001 From: farfaraway Date: Tue, 29 Nov 2022 13:07:09 +0800 Subject: [PATCH] fix: fix auto screenshot --- src/modules/misc/screenshot.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/modules/misc/screenshot.lua b/src/modules/misc/screenshot.lua index 4fe827951..dceae4a7d 100644 --- a/src/modules/misc/screenshot.lua +++ b/src/modules/misc/screenshot.lua @@ -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() @@ -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 @@ -30,7 +32,9 @@ local function PlayerLevelUp() return end - F:Delay(1, _G.Screenshot) + F:Delay(1, function() + Screenshot() + end) end local function PlayerDead() @@ -38,7 +42,9 @@ local function PlayerDead() return end - F:Delay(1, _G.Screenshot) + F:Delay(1, function() + Screenshot() + end) end function AS:OnLogin()