Skip to content

Commit

Permalink
chore: Update kaliels tracker integration
Browse files Browse the repository at this point in the history
  • Loading branch information
happenslol committed Dec 13, 2024
1 parent 57735e2 commit 4b0fd1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
18 changes: 4 additions & 14 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ WarpDeplete.Util = Util
WarpDeplete.LSM = LibStub("LibSharedMedia-3.0")
WarpDeplete.Glow = LibStub("LibCustomGlow-1.0")

-- Check if Kaliel's Tracker is loaded, since it creates a
-- background frame for the objective window that will not be
-- hidden if only the objective window itself is hidden.
---@class KT : AceAddon
---@field frame Frame
local KT = LibStub("AceAddon-3.0"):GetAddon("!KalielsTracker", true)

function WarpDeplete:OnInitialize()
local frames = {}

Expand Down Expand Up @@ -133,9 +126,6 @@ end

function WarpDeplete:HookObjectiveTracker()
local frame
if KT then frame = KT.frame
else frame = ObjectiveTrackerFrame end

hooksecurefunc(frame, "Show", function()
-- Prevent objective tracker from re-showing
-- while WarpDeplete is shown
Expand All @@ -150,8 +140,8 @@ function WarpDeplete:ShowObjectiveTracker()
return
end

if KT then
KT.frame:Show()
if KalielsTracker and KalielsTracker.Toggle then
KalielsTracker.Toggle(true)
return
end

Expand All @@ -162,8 +152,8 @@ function WarpDeplete:ShowObjectiveTracker()
end

function WarpDeplete:HideObjectiveTracker()
if KT then
KT.frame:Hide()
if KalielsTracker and KalielsTracker.Toggle then
KalielsTracker.Toggle(false)
return
end

Expand Down
6 changes: 6 additions & 0 deletions _meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ MDT = {}
---@param npcID integer?
function MDT:GetEnemyForces(npcID) end

---@class KalielsTracker
KalielsTracker = {}

---@param show boolean
function KalielsTracker.Toggle(show) end

---@class ObjectiveTrackerFrame : Frame
ObjectiveTrackerFrame = {}

Expand Down

0 comments on commit 4b0fd1b

Please sign in to comment.