Skip to content

Commit

Permalink
fix: Add temporary hack to keep blizzard objective tracker hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
happenslol committed Aug 6, 2024
1 parent e128a7b commit 7b41b67
Showing 3 changed files with 15 additions and 22 deletions.
22 changes: 4 additions & 18 deletions Core.lua
Original file line number Diff line number Diff line change
@@ -199,31 +199,17 @@ end
function WarpDeplete:ShowBlizzardObjectiveTracker()
-- As SylingTracker replaces the blizzard objective tracker in hiding
-- it, we prevent WarpDeplete to reshown the tracker.
if C_AddOns.IsAddOnLoaded("SylingTracker") then
return
if C_AddOns.IsAddOnLoaded("SylingTracker") then
return
end

ObjectiveTrackerFrame:Show()
end

function WarpDeplete:HideBlizzardObjectiveTracker()
ObjectiveTrackerFrame:Hide()

-- Sometimes, the objective tracker isn't hidden
-- correctly. This can happen when WarpDeplete is
-- loaded before the blizzard dungeon timer.
-- In this case, we can to check again after a bit
-- to make sure we're actually hiding it.
C_Timer.After(1, function()
-- Check if we're still showing WDP
if not self.isShown then
self:PrintDebug("Skipping re-hiding objective frame, wdp closed")
return
end

self:PrintDebug("Re-hiding objective frame")
if ObjectiveTrackerFrame:IsVisible() then
ObjectiveTrackerFrame:Hide()
end)
end
end

function WarpDeplete:ShowExternals()
13 changes: 10 additions & 3 deletions Events.lua
Original file line number Diff line number Diff line change
@@ -427,7 +427,7 @@ function WarpDeplete:UnregisterChallengeEvents()
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end

function WarpDeplete:OnTimerTick(elapsed)
function WarpDeplete:OnTimerTick(elapsed)
if not self.challengeState.inChallenge or
self.challengeState.challengeCompleted or
not self.timerState.running then
@@ -449,9 +449,15 @@ function WarpDeplete:OnTimerTick(elapsed)
local deathPenalty = self.timerState.deaths * 5
local current = GetTime() + self.timerState.startOffset - self.timerState.startTime + deathPenalty

-- if current < 0 then return end

self:SetTimerCurrent(current)

-- FIXME(happens): Blizzard seems to randomly re-show the objective tracker on
-- a lot of events, and even re-hiding it on CLEU events doesn't seem to cover
-- all cases.
-- The best solution would be to somehow hook into the actual function that
-- shows the objective tracker or some event that fires when it's unhidden, but
-- that currently doesn't seem to be possible.
self:HideBlizzardObjectiveTracker()
end

function WarpDeplete:OnCheckChallengeMode(ev)
@@ -481,6 +487,7 @@ function WarpDeplete:OnPlayerDead(ev)
-- good method for deduping though.
-- self:BroadcastDeath()
self:ResetCurrentPull()

-- Blizzard re-shows the objective tracker every time the player
-- dies, so we need to re-hide it
self:HideBlizzardObjectiveTracker()
2 changes: 1 addition & 1 deletion WarpDeplete.toc
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
## Title: WarpDeplete
## Notes-ruRU: WarpDeplete - таймер для подземелий М+ с гибкими настройками
## Author: Happens
## Version: 3.0.1
## Version: 3.0.3
## SavedVariables: WarpDepleteDB
## IconTexture: Interface\AddOns\WarpDeplete\logo
## X-Curse-Project-ID: 460155

0 comments on commit 7b41b67

Please sign in to comment.