v9.7.2: Ebonhold Database integration and core logic refinements

This commit is contained in:
Xurkon
2026-02-14 21:13:44 -06:00
parent 0a2cc15641
commit 6ef85d4e2d
573 changed files with 1751730 additions and 2 deletions
File diff suppressed because it is too large Load Diff
+585
View File
@@ -0,0 +1,585 @@
---@class TrackerBaseFrame
local TrackerBaseFrame = QuestieLoader:CreateModule("TrackerBaseFrame")
-------------------------
--Import QuestieTracker modules.
-------------------------
---@type QuestieTracker
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
---@type TrackerFadeTicker
local TrackerFadeTicker = QuestieLoader:ImportModule("TrackerFadeTicker")
-------------------------
--Import Questie modules.
-------------------------
---@type QuestieCombatQueue
local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
---@type l10n
local l10n = QuestieLoader:ImportModule("l10n")
--- COMPATIBILITY ---
local C_Timer = QuestieCompat.C_Timer
local BackdropTemplateMixin = not QuestieCompat.Is335 and BackdropTemplateMixin
local WatchFrame = QuestWatchFrame or WatchFrame
local baseFrame, sizer, sizerSetPoint, sizerSetPointY, sizerLine1, sizerLine2, sizerLine3
local updateTimer
TrackerBaseFrame.IsInitialized = false
TrackerBaseFrame.isSizing = false
TrackerBaseFrame.isMoving = false
local _OnEnter, _SetSizerTooltip
function TrackerBaseFrame.Initialize()
baseFrame = CreateFrame("Frame", "Questie_BaseFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate")
baseFrame:SetClampedToScreen(true) -- We don't want this frame to be able to move off screen at all!
baseFrame:SetFrameStrata("MEDIUM")
baseFrame:SetFrameLevel(0)
baseFrame:SetSize(25, 25)
baseFrame:EnableMouse(true)
baseFrame:SetMovable(true)
baseFrame:SetResizable(true)
baseFrame:SetScript("OnMouseDown", TrackerBaseFrame.OnDragStart)
baseFrame:SetScript("OnMouseUp", TrackerBaseFrame.OnDragStop)
baseFrame:SetScript("OnEnter", TrackerFadeTicker.Unfade)
baseFrame:SetScript("OnLeave", TrackerFadeTicker.Fade)
baseFrame:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true,
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 },
})
baseFrame:SetBackdropColor(0, 0, 0, 0)
baseFrame:SetBackdropBorderColor(1, 1, 1, 0)
local QuestieTrackerLoc = Questie.db.profile.TrackerLocation
if QuestieTrackerLoc and (QuestieTrackerLoc[1] == "BOTTOMLEFT" or QuestieTrackerLoc[1] == "BOTTOMRIGHT") then
sizerSetPoint = "TOPRIGHT"
sizerSetPointY = -4
else
sizerSetPoint = "BOTTOMRIGHT"
sizerSetPointY = 4
end
sizer = CreateFrame("Frame", "Questie_Sizer", baseFrame)
sizer:SetPoint(sizerSetPoint, 0, 0)
sizer:SetWidth(25)
sizer:SetHeight(25)
sizer:SetAlpha(0)
sizer:EnableMouse(true)
sizer:SetScript("OnMouseDown", TrackerBaseFrame.OnResizeStart)
sizer:SetScript("OnMouseUp", TrackerBaseFrame.OnResizeStop)
sizer:SetScript("OnEnter", _OnEnter)
sizer:SetScript("OnLeave", function(self)
if GameTooltip:IsShown() then
GameTooltip:Hide()
GameTooltip._SizerToolTip = nil
end
TrackerFadeTicker.Fade(self)
end)
baseFrame.sizer = sizer
sizerLine1 = sizer:CreateTexture(nil, "BACKGROUND")
sizerLine1:SetWidth(14)
sizerLine1:SetHeight(14)
sizerLine1:SetPoint(sizerSetPoint, -4, sizerSetPointY)
sizerLine1:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
local x = 0.1 * 14 / 17
if QuestieTrackerLoc and (QuestieTrackerLoc[1] == "BOTTOMLEFT" or QuestieTrackerLoc[1] == "BOTTOMRIGHT") then
sizerLine1:SetTexCoord(1 / 32, 0.5 + x, 1 / 32 - x, 0.5, 1 / 32 + x, 0.5, 1 / 32, 0.5 - x)
else
sizerLine1:SetTexCoord(1 / 32 - x, 0.5, 1 / 32, 0.5 + x, 1 / 32, 0.5 - x, 1 / 32 + x, 0.5)
end
sizerLine2 = sizer:CreateTexture(nil, "BACKGROUND")
sizerLine2:SetWidth(11)
sizerLine2:SetHeight(11)
sizerLine2:SetPoint(sizerSetPoint, -4, sizerSetPointY)
sizerLine2:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
x = 0.1 * 11 / 17
if QuestieTrackerLoc and (QuestieTrackerLoc[1] == "BOTTOMLEFT" or QuestieTrackerLoc[1] == "BOTTOMRIGHT") then
sizerLine2:SetTexCoord(1 / 32, 0.5 + x, 1 / 32 - x, 0.5, 1 / 32 + x, 0.5, 1 / 32, 0.5 - x)
else
sizerLine2:SetTexCoord(1 / 32 - x, 0.5, 1 / 32, 0.5 + x, 1 / 32, 0.5 - x, 1 / 32 + x, 0.5)
end
sizerLine3 = sizer:CreateTexture(nil, "BACKGROUND")
sizerLine3:SetWidth(8)
sizerLine3:SetHeight(8)
sizerLine3:SetPoint(sizerSetPoint, -4, sizerSetPointY)
sizerLine3:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
x = 0.1 * 8 / 17
if QuestieTrackerLoc and (QuestieTrackerLoc[1] == "BOTTOMLEFT" or QuestieTrackerLoc[1] == "BOTTOMRIGHT") then
sizerLine3:SetTexCoord(1 / 32, 0.5 + x, 1 / 32 - x, 0.5, 1 / 32 + x, 0.5, 1 / 32, 0.5 - x)
else
sizerLine3:SetTexCoord(1 / 32 - x, 0.5, 1 / 32, 0.5 + x, 1 / 32, 0.5 - x, 1 / 32 + x, 0.5)
end
if Questie.db.profile.TrackerLocation then
-- we need to pcall this because it can error if something like MoveAnything is used to move the tracker
local result, reason = pcall(baseFrame.SetPoint, baseFrame, unpack(Questie.db.profile.TrackerLocation))
if (not result) then
Questie.db.profile.TrackerLocation = nil
print(l10n("Error: Questie tracker in invalid location, resetting..."))
Questie:Debug(Questie.DEBUG_CRITICAL, "Resetting reason:", reason)
if WatchFrame then
local result2, _ = pcall(baseFrame.SetPoint, baseFrame, unpack({ WatchFrame:GetPoint() }))
Questie.db.profile.trackerSetpoint = "TOPLEFT"
if (not result2) then
Questie.db.profile.TrackerLocation = nil
TrackerBaseFrame:SetSafePoint()
end
else
TrackerBaseFrame:SetSafePoint()
end
end
else
if WatchFrame then
local result, reason = pcall(baseFrame.SetPoint, baseFrame, unpack({ WatchFrame:GetPoint() }))
Questie.db.profile.trackerSetpoint = "TOPLEFT"
if not result then
Questie.db.profile.TrackerLocation = nil
print(l10n("Error: Questie tracker in invalid location, resetting..."))
Questie:Debug(Questie.DEBUG_CRITICAL, "Resetting reason:", reason)
TrackerBaseFrame:SetSafePoint()
end
else
TrackerBaseFrame:SetSafePoint()
end
end
baseFrame:Hide()
baseFrame.isSizing = false
baseFrame.isMoving = false
TrackerBaseFrame.IsInitialized = true
TrackerBaseFrame.baseFrame = baseFrame
return baseFrame
end
function TrackerBaseFrame:Update()
if Questie.db.char.isTrackerExpanded and QuestieTracker:HasQuest() then
if Questie.db.profile.trackerBackdropEnabled then
if Questie.db.profile.trackerBorderEnabled then
if not Questie.db.profile.trackerBackdropFader then
baseFrame:SetBackdropColor(0, 0, 0, Questie.db.profile.trackerBackdropAlpha)
baseFrame:SetBackdropBorderColor(1, 1, 1, Questie.db.profile.trackerBackdropAlpha)
else
baseFrame:SetBackdropColor(0, 0, 0, 0)
baseFrame:SetBackdropBorderColor(1, 1, 1, 0)
end
else
if not Questie.db.profile.trackerBackdropFader then
baseFrame:SetBackdropColor(0, 0, 0, Questie.db.profile.trackerBackdropAlpha)
else
baseFrame:SetBackdropColor(0, 0, 0, 0)
end
baseFrame:SetBackdropBorderColor(1, 1, 1, 0)
end
else
baseFrame:SetBackdropColor(0, 0, 0, 0)
baseFrame:SetBackdropBorderColor(1, 1, 1, 0)
end
if Questie.db.profile.moveHeaderToBottom then
-- Move Sizer to Top Right corner
sizer:ClearAllPoints()
sizer:SetPoint("TOPRIGHT", 0, 0)
sizerLine1:ClearAllPoints()
sizerLine1:SetPoint("TOPRIGHT", -4, -4)
local x = 0.1 * 14 / 17
sizerLine1:SetTexCoord(1 / 32, 0.5 + x, 1 / 32 - x, 0.5, 1 / 32 + x, 0.5, 1 / 32, 0.5 - x)
sizerLine2:ClearAllPoints()
sizerLine2:SetPoint("TOPRIGHT", -4, -4)
x = 0.1 * 11 / 17
sizerLine2:SetTexCoord(1 / 32, 0.5 + x, 1 / 32 - x, 0.5, 1 / 32 + x, 0.5, 1 / 32, 0.5 - x)
sizerLine3:ClearAllPoints()
sizerLine3:SetPoint("TOPRIGHT", -4, -4)
x = 0.1 * 8 / 17
sizerLine3:SetTexCoord(1 / 32, 0.5 + x, 1 / 32 - x, 0.5, 1 / 32 + x, 0.5, 1 / 32, 0.5 - x)
else
-- Move Sizer to Bottom Right corner
sizer:ClearAllPoints()
sizer:SetPoint("BOTTOMRIGHT", 0, 0)
sizerLine1:ClearAllPoints()
sizerLine1:SetPoint("BOTTOMRIGHT", -4, 4)
local x = 0.1 * 14 / 17
sizerLine1:SetTexCoord(1 / 32 - x, 0.5, 1 / 32, 0.5 + x, 1 / 32, 0.5 - x, 1 / 32 + x, 0.5)
sizerLine2:ClearAllPoints()
sizerLine2:SetPoint("BOTTOMRIGHT", -4, 4)
x = 0.1 * 11 / 17
sizerLine2:SetTexCoord(1 / 32 - x, 0.5, 1 / 32, 0.5 + x, 1 / 32, 0.5 - x, 1 / 32 + x, 0.5)
sizerLine3:ClearAllPoints()
sizerLine3:SetPoint("BOTTOMRIGHT", -4, 4)
x = 0.1 * 8 / 17
sizerLine3:SetTexCoord(1 / 32 - x, 0.5, 1 / 32, 0.5 + x, 1 / 32, 0.5 - x, 1 / 32 + x, 0.5)
end
if Questie.db.profile.sizerHidden then
baseFrame.sizer:SetAlpha(0)
end
else
baseFrame.sizer:SetAlpha(0)
baseFrame:SetBackdropColor(0, 0, 0, 0)
baseFrame:SetBackdropBorderColor(1, 1, 1, 0)
end
-- Enables Click-Through when the tracker is locked
if IsControlKeyDown() or (not Questie.db.profile.trackerLocked) then
QuestieCombatQueue:Queue(function()
baseFrame:EnableMouse(true)
baseFrame:SetMovable(true)
baseFrame:SetResizable(true)
end)
else
QuestieCombatQueue:Queue(function()
baseFrame:EnableMouse(false)
baseFrame:SetMovable(false)
baseFrame:SetResizable(false)
end)
end
QuestieTracker:UpdateDurabilityFrame()
QuestieTracker:UpdateVoiceOverFrame()
end
function TrackerBaseFrame:SetSafePoint()
if TrackerBaseFrame.isMoving ~= true and TrackerBaseFrame.isResizing ~= true then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:SetSafePoint]")
else
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:SetSafePoint] - Frame is moving or resizing! --> Exiting.")
return
end
local xOff, yOff = baseFrame:GetWidth() / 2, baseFrame:GetHeight() / 2
local trackerSetPoint = Questie.db.profile.trackerSetpoint
local resetCords = { ["BOTTOMLEFT"] = { x = -xOff, y = -yOff }, ["BOTTOMRIGHT"] = { x = xOff, y = -yOff }, ["TOPLEFT"] = { x = -xOff, y = yOff }, ["TOPRIGHT"] = { x = xOff, y = yOff } }
baseFrame:ClearAllPoints()
if trackerSetPoint then
baseFrame:SetPoint(trackerSetPoint, UIParent, "CENTER", resetCords[trackerSetPoint].x, resetCords[trackerSetPoint].y)
Questie.db.profile.TrackerLocation = { trackerSetPoint, "UIParent", "CENTER", resetCords[trackerSetPoint].x, resetCords[trackerSetPoint].y }
end
QuestieTracker:Update()
end
function TrackerBaseFrame.ShrinkToMinSize(minSize)
baseFrame:SetHeight(minSize)
end
---@param button string @The mouse button that is pressed when dragging starts
function TrackerBaseFrame.OnDragStart(frame, button)
if GameTooltip:IsShown() then
GameTooltip:Hide()
GameTooltip._SizerToolTip = nil
end
if InCombatLockdown() or IsShiftKeyDown() or IsAltKeyDown() then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStart] - In Combat or shift key or alt key detected! --> Exiting.")
return
else
if (IsControlKeyDown() and Questie.db.profile.trackerLocked and not ChatEdit_GetActiveWindow()) or not Questie.db.profile.trackerLocked then
if TrackerBaseFrame.isMoving ~= false or TrackerBaseFrame.isSizing == true then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStart] - Frame is already moving or frame is already resizing! --> Exiting.")
return
end
else
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStart] - Tracker is Locked. Use CTRL Key. --> Exiting.")
return
end
end
if TrackerBaseFrame.isMoving ~= true and TrackerBaseFrame.isSizing ~= true then
if IsMouseButtonDown(button) and button ~= "MiddleButton" then
if (IsControlKeyDown() and Questie.db.profile.trackerLocked and not ChatEdit_GetActiveWindow()) or not Questie.db.profile.trackerLocked then
if baseFrame:IsMovable() then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStart] - Dragging Started.")
TrackerBaseFrame.isMoving = true
TrackerBaseFrame.baseFrame.isMoving = true
baseFrame:StartMoving()
TrackerBaseFrame:Update()
else
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStart] - Frame is not movable!")
end
end
end
end
end
local function _UpdateTrackerPosition()
if TrackerBaseFrame.isMoving ~= true and TrackerBaseFrame.isResizing ~= true then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:UpdateTrackerPosition]")
else
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:UpdateTrackerPosition] - Frame is moving or resizing! --> Exiting.")
return
end
local xLeft, yTop, xRight, yBottom = baseFrame:GetLeft(), baseFrame:GetTop(), baseFrame:GetRight(), baseFrame:GetBottom()
local trackerSetPoint = Questie.db.profile.trackerSetpoint
baseFrame:ClearAllPoints()
if trackerSetPoint == "BOTTOMLEFT" then
baseFrame:SetPoint("BOTTOMLEFT", UIParent, xLeft, yBottom)
Questie.db.profile.TrackerLocation = { "BOTTOMLEFT", "UIParent", "BOTTOMLEFT", xLeft, yBottom }
elseif trackerSetPoint == "BOTTOMRIGHT" then
baseFrame:SetPoint("BOTTOMRIGHT", UIParent, -(GetScreenWidth() - xRight), yBottom)
Questie.db.profile.TrackerLocation = { "BOTTOMRIGHT", "UIParent", "BOTTOMRIGHT", -(GetScreenWidth() - xRight), yBottom }
elseif trackerSetPoint == "TOPRIGHT" then
baseFrame:SetPoint("TOPRIGHT", UIParent, -(GetScreenWidth() - xRight), -(GetScreenHeight() - yTop))
Questie.db.profile.TrackerLocation = { "TOPRIGHT", "UIParent", "TOPRIGHT", -(GetScreenWidth() - xRight), -(GetScreenHeight() - yTop) }
else
baseFrame:SetPoint("TOPLEFT", UIParent, xLeft, -(GetScreenHeight() - yTop))
Questie.db.profile.TrackerLocation = { "TOPLEFT", "UIParent", "TOPLEFT", xLeft, -(GetScreenHeight() - yTop) }
end
C_Timer.After(0.12, function()
QuestieCombatQueue:Queue(function()
QuestieTracker:Update()
end)
end)
end
function TrackerBaseFrame.OnDragStop(frame, button)
if IsShiftKeyDown() or IsAltKeyDown() then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStop] - Shift key or alt key detected! --> Exiting.")
return
else
if TrackerBaseFrame.isMoving ~= true or TrackerBaseFrame.isSizing == true then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStop] - Frame isn't moving or frame is resizing! --> Exiting.")
return
end
end
if TrackerBaseFrame.isMoving ~= false and TrackerBaseFrame.isSizing ~= true then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnDragStop] - Dragging Stopped.")
TrackerBaseFrame.isMoving = false
TrackerBaseFrame.baseFrame.isMoving = false
baseFrame:StopMovingOrSizing()
QuestieCombatQueue:Queue(_UpdateTrackerPosition)
end
end
---@param button string @The mouse button that is pressed when resize starts
function TrackerBaseFrame.OnResizeStart(frame, button)
if GameTooltip:IsShown() then
GameTooltip:Hide()
GameTooltip._SizerToolTip = nil
end
if InCombatLockdown() or IsAltKeyDown() then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStart] - In Combat or alt key detected! --> Exiting.") -- TODO: Why is the alt key a problem?
return
else
if (IsControlKeyDown() and Questie.db.profile.trackerLocked and not ChatEdit_GetActiveWindow()) or not Questie.db.profile.trackerLocked then
if TrackerBaseFrame.isSizing ~= false or TrackerBaseFrame.isMoving == true then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStart] - Frame is already resizing or frame is moving! --> Exiting.")
return
end
else
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStart] - Tracker is Locked. Use CTRL Key. --> Exiting.")
return
end
end
if TrackerBaseFrame.isSizing ~= true and TrackerBaseFrame.isMoving ~= true then
if IsMouseButtonDown(button) and button ~= "MiddleButton" then
if (IsControlKeyDown() and Questie.db.profile.trackerLocked and not ChatEdit_GetActiveWindow()) or not Questie.db.profile.trackerLocked then
if baseFrame:IsResizable() then
if button == "LeftButton" then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStart] - Sizing Started.")
TrackerBaseFrame.isSizing = true
TrackerBaseFrame.baseFrame.isSizing = true
updateTimer = C_Timer.NewTicker(0.12, function()
local QuestieTrackerLoc = Questie.db.profile.TrackerLocation
if QuestieTrackerLoc == nil then
updateTimer:Cancel()
return
end
Questie.db.profile.TrackerWidth = baseFrame:GetWidth()
Questie.db.profile.TrackerHeight = baseFrame:GetHeight()
-- This keeps the trackers SetPoint "clamped" to the players desired location
-- while the tracker lines expand and shrink due to Text Wrapping.
baseFrame:StopMovingOrSizing()
baseFrame:ClearAllPoints()
baseFrame:SetPoint(QuestieTrackerLoc[1], QuestieTrackerLoc[2], QuestieTrackerLoc[3], QuestieTrackerLoc[4], QuestieTrackerLoc[5])
------------------------------------------------------------------------------
-- This switches ON the Tracker Background and Border and switches OFF
-- the Tracker Fader to make it easier to see the Trackers boundaries.
Questie.db.profile.trackerBackdropEnabled = true
Questie.db.profile.trackerBorderEnabled = true
Questie.db.profile.trackerBackdropFader = false
------------------------------------------------------------------------------
if QuestieTrackerLoc and (QuestieTrackerLoc[1] == "BOTTOMLEFT" or QuestieTrackerLoc[1] == "BOTTOMRIGHT") then
baseFrame:StartSizing("TOPRIGHT")
else
baseFrame:StartSizing("BOTTOMRIGHT")
end
QuestieTracker:Update()
end)
end
else
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStart] - Frame is not resizable!")
end
if button == "RightButton" then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStart] - Resetting Sizer mode.")
Questie.db.profile.TrackerWidth = 0
Questie.db.profile.TrackerHeight = 0
end
end
end
end
end
---@param button string @The mouse button that is pressed when resize stops
function TrackerBaseFrame.OnResizeStop(frame, button)
if IsAltKeyDown() then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStop] - Alt key detected! --> Exiting.") -- TODO: Why is the alt key a problem?
return
else
if TrackerBaseFrame.isSizing ~= true or TrackerBaseFrame.isMoving == true then
if button == "LeftButton" or button == "MiddleButton" then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStop] - Frame isn't resizing or frame is moving! --> Exiting.")
return
end
if button == "RightButton" then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStop] - Sizer mode reset. Updating Tracker.")
QuestieCombatQueue:Queue(function()
QuestieTracker:Update()
end)
return
end
end
end
if TrackerBaseFrame.isSizing ~= false and TrackerBaseFrame.isMoving ~= true then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerBaseFrame:OnResizeStop] - Sizing Stopped.")
TrackerBaseFrame.isSizing = false
TrackerBaseFrame.baseFrame.isSizing = false
-- This returns the players desired Background, Border and Fader to the correct setting
Questie.db.profile.trackerBackdropEnabled = Questie.db.profile.currentBackdropEnabled
Questie.db.profile.trackerBorderEnabled = Questie.db.profile.currentBorderEnabled
Questie.db.profile.trackerBackdropFader = Questie.db.profile.currentBackdropFader
baseFrame:StopMovingOrSizing()
updateTimer:Cancel()
QuestieCombatQueue:Queue(_UpdateTrackerPosition)
end
end
function TrackerBaseFrame:OnProfileChange()
local QuestieTrackerLoc = Questie.db.profile.TrackerLocation
if (not baseFrame) and Questie.db.profile.trackerEnabled then
-- The Tracker was disabled and is now enabled
QuestieTracker:Enable()
return
elseif baseFrame and (not Questie.db.profile.trackerEnabled) then
-- The Tracker was enabled and is now disabled
QuestieTracker:Disable()
return
end
if QuestieTrackerLoc then
baseFrame:ClearAllPoints()
baseFrame:SetPoint(QuestieTrackerLoc[1], QuestieTrackerLoc[2], QuestieTrackerLoc[3], QuestieTrackerLoc[4], QuestieTrackerLoc[5])
C_Timer.After(0.12, function()
QuestieCombatQueue:Queue(function()
QuestieTracker:Update()
end)
end)
else
_UpdateTrackerPosition()
end
end
_OnEnter = function(self)
if InCombatLockdown() then
if GameTooltip:IsShown() then
GameTooltip:Hide()
return
end
end
-- Set initial tooltip
if not Questie.db.profile.sizerHidden then
GameTooltip._owner = self
GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
_SetSizerTooltip()
-- Update tooltip
GameTooltip._SizerToolTip = _SetSizerTooltip
end
TrackerFadeTicker.Unfade(self)
end
_SetSizerTooltip = function()
-- Set Sizer mode
local trackerSizeMode
if Questie.db.profile.TrackerHeight == 0 then
trackerSizeMode = Questie:Colorize(l10n("Auto"), "green")
else
trackerSizeMode = Questie:Colorize(l10n("Manual"), "orange")
end
if IsShiftKeyDown() then
GameTooltip:ClearLines()
GameTooltip:AddLine(Questie:Colorize(l10n("Sizer Mode") .. ": ", "white") .. trackerSizeMode)
if Questie.db.profile.trackerLocked then
GameTooltip:AddLine(Questie:Colorize(l10n("Ctrl + Left Click + Hold") .. ": ", "gray") .. l10n("Resize Tracker"))
GameTooltip:AddLine(Questie:Colorize(l10n("Ctrl + Right Click") .. ": ", "gray") .. l10n("Reset Sizer"))
else
GameTooltip:AddLine(Questie:Colorize(l10n("Left Click + Hold") .. ": ", "gray") .. l10n("Resize Tracker"))
GameTooltip:AddLine(Questie:Colorize(l10n("Right Click") .. ": ", "gray") .. l10n("Reset Sizer"))
end
GameTooltip:AddLine(" ")
GameTooltip:AddLine(Questie:Colorize(l10n("NOTE") .. ": ", "red") .. l10n("The Tracker Height Ratio\nis ignored while in Manual mode"))
GameTooltip:Show()
else
GameTooltip:ClearLines()
GameTooltip:AddLine(Questie:Colorize(l10n("Sizer Mode") .. ": ", "white") .. trackerSizeMode)
GameTooltip:AddLine(Questie:Colorize("(" .. l10n("Hold Shift") .. ")", "gray"))
GameTooltip:Show()
end
end
+127
View File
@@ -0,0 +1,127 @@
---@class TrackerFadeTicker
local TrackerFadeTicker = QuestieLoader:CreateModule("TrackerFadeTicker")
-------------------------
--Import QuestieTracker modules.
-------------------------
---@type QuestieTracker
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
---@type TrackerLinePool
local TrackerLinePool = QuestieLoader:ImportModule("TrackerLinePool")
--- COMPATIBILITY ---
local C_Timer = QuestieCompat.C_Timer
local fadeTicker
local fadeTickerDirection
local fadeTickerValue = 0
local fadeTickerStarted = false
local trackerBaseFrame, trackerHeaderFrame
function TrackerFadeTicker.Initialize(baseFrame, headerFrame)
trackerBaseFrame = baseFrame
trackerHeaderFrame = headerFrame
fadeTickerStarted = true
TrackerFadeTicker.Start()
end
function TrackerFadeTicker.Start()
if (not fadeTicker) and fadeTickerStarted then
fadeTicker = C_Timer.NewTicker(0.02, function()
if fadeTickerDirection then
-- Un-Fade All
if fadeTickerValue < 0.3 then
fadeTickerValue = fadeTickerValue + 0.02
-- Un-fade the background and border(if enabled)
if (Questie.db.char.isTrackerExpanded and Questie.db.profile.trackerBackdropEnabled and Questie.db.profile.trackerBackdropFader) then
trackerBaseFrame:SetBackdropColor(0, 0, 0, math.min(Questie.db.profile.trackerBackdropAlpha, fadeTickerValue * 3.3))
if Questie.db.profile.trackerBorderEnabled then
trackerBaseFrame:SetBackdropBorderColor(1, 1, 1, math.min(Questie.db.profile.trackerBackdropAlpha, fadeTickerValue * 3.3))
end
end
-- Un-fade the Questie Icon
if (Questie.db.char.isTrackerExpanded and not Questie.db.profile.trackerHeaderEnabled) then
trackerHeaderFrame.questieIcon:SetAlpha(fadeTickerValue * 3.3)
end
-- Un-fade the re-sizer
if (Questie.db.char.isTrackerExpanded and not Questie.db.profile.sizerHidden) then
trackerBaseFrame.sizer:SetAlpha(fadeTickerValue * 3.3)
end
-- Un-fade the minimize buttons
if (Questie.db.char.isTrackerExpanded and Questie.db.profile.trackerFadeMinMaxButtons) then
TrackerLinePool.SetAllExpandQuestAlpha(fadeTickerValue * 3.3)
end
-- Un-fade the quest item buttons
if (Questie.db.char.isTrackerExpanded and Questie.db.profile.trackerFadeQuestItemButtons) then
TrackerLinePool.SetAllItemButtonAlpha(fadeTickerValue * 3.3)
end
else
fadeTicker:Cancel()
fadeTicker = nil
end
else
-- Fade All
if fadeTickerValue >= 0 then
fadeTickerValue = fadeTickerValue - 0.02
if fadeTickerValue < 0 then
fadeTickerValue = 0
fadeTicker:Cancel()
fadeTicker = nil
end
-- Fade the background and border(if enabled)
if (Questie.db.char.isTrackerExpanded and Questie.db.profile.trackerBackdropEnabled and Questie.db.profile.trackerBackdropFader) then
trackerBaseFrame:SetBackdropColor(0, 0, 0, math.min(Questie.db.profile.trackerBackdropAlpha, fadeTickerValue * 3.3))
if Questie.db.profile.trackerBorderEnabled then
trackerBaseFrame:SetBackdropBorderColor(1, 1, 1, math.min(Questie.db.profile.trackerBackdropAlpha, fadeTickerValue * 3.3))
end
end
-- Fade the Questie Icon
if (Questie.db.char.isTrackerExpanded and not Questie.db.profile.trackerHeaderEnabled) then
trackerHeaderFrame.questieIcon:SetAlpha(fadeTickerValue * 3.3)
end
-- Fade the re-sizer
if (Questie.db.char.isTrackerExpanded and not Questie.db.profile.sizerHidden) then
trackerBaseFrame.sizer:SetAlpha(fadeTickerValue * 3.3)
end
-- Fade the minimize buttons
if (Questie.db.char.isTrackerExpanded and Questie.db.profile.trackerFadeMinMaxButtons) then
TrackerLinePool.SetAllExpandQuestAlpha(fadeTickerValue * 3.3)
end
-- Fade the quest item buttons
if (Questie.db.char.isTrackerExpanded and Questie.db.profile.trackerFadeQuestItemButtons) then
TrackerLinePool.SetAllItemButtonAlpha(fadeTickerValue * 3.3)
end
else
fadeTickerValue = 0
TrackerLinePool.SetAllItemButtonAlpha(0)
fadeTicker:Cancel()
fadeTicker = nil
end
end
end)
end
end
function TrackerFadeTicker.Unfade()
if QuestieTracker:HasQuest() then
fadeTickerDirection = true
TrackerFadeTicker.Start()
end
end
function TrackerFadeTicker.Fade()
if QuestieTracker:HasQuest() then
fadeTickerDirection = false
TrackerFadeTicker.Start()
end
end
+275
View File
@@ -0,0 +1,275 @@
---@class TrackerHeaderFrame
local TrackerHeaderFrame = QuestieLoader:CreateModule("TrackerHeaderFrame")
-------------------------
--Import QuestieTracker modules.
-------------------------
---@type QuestieTracker
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
---@type TrackerBaseFrame
local TrackerBaseFrame = QuestieLoader:ImportModule("TrackerBaseFrame")
---@type TrackerFadeTicker
local TrackerFadeTicker = QuestieLoader:ImportModule("TrackerFadeTicker")
---@type TrackerUtils
local TrackerUtils = QuestieLoader:ImportModule("TrackerUtils")
-------------------------
--Import Questie modules.
-------------------------
---@type QuestieLib
local QuestieLib = QuestieLoader:ImportModule("QuestieLib")
---@type QuestieOptions
local QuestieOptions = QuestieLoader:ImportModule("QuestieOptions")
---@type QuestieJourney
local QuestieJourney = QuestieLoader:ImportModule("QuestieJourney")
---@type QuestieQuest
local QuestieQuest = QuestieLoader:ImportModule("QuestieQuest")
---@type QuestieCombatQueue
local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
---@type l10n
local l10n = QuestieLoader:ImportModule("l10n")
local LSM30 = LibStub("LibSharedMedia-3.0")
--- COMPATIBILITY ---
local C_QuestLog = QuestieCompat.C_QuestLog
local headerFrame, trackerBaseFrame
function TrackerHeaderFrame.Initialize(baseFrame)
trackerBaseFrame = baseFrame
headerFrame = CreateFrame("Button", "Questie_HeaderFrame", trackerBaseFrame)
TrackerHeaderFrame.PositionTrackerHeaderFrame()
-- Questie Icon Settings
local questieIcon = CreateFrame("Button", nil, trackerBaseFrame)
questieIcon:SetPoint("TOPLEFT", headerFrame, "TOPLEFT", 0, 0)
questieIcon:SetAlpha(1)
-- Questie Icon Texture Settings
questieIcon.texture = questieIcon:CreateTexture(nil, "BACKGROUND", nil, 0)
questieIcon.texture:SetTexture(Questie.icons["complete"])
questieIcon.texture:SetPoint("CENTER", 0, 0)
questieIcon:EnableMouse(true)
questieIcon:RegisterForClicks("LeftButtonUp", "RightButtonUp")
questieIcon:SetScript("OnClick", function(_, button)
if button == "LeftButton" then
if QuestieJourney:IsShown() then
QuestieJourney.ToggleJourneyWindow()
end
QuestieCombatQueue:Queue(function()
QuestieOptions:OpenConfigWindow()
end)
return
elseif button == "RightButton" then
if QuestieConfigFrame:IsShown() then
QuestieConfigFrame:Hide()
end
QuestieCombatQueue:Queue(function()
QuestieJourney.ToggleJourneyWindow()
end)
return
end
end)
questieIcon:SetScript("OnEnter", function(self)
if InCombatLockdown() then
if GameTooltip:IsShown() then
GameTooltip:Hide()
return
end
end
GameTooltip._owner = self
GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
GameTooltip:AddLine("Questie " .. QuestieLib:GetAddonVersionString(), 1, 1, 1)
GameTooltip:AddLine(Questie:Colorize(l10n("Left Click") .. ": ", "gray") .. l10n("Toggle Options"))
GameTooltip:AddLine(Questie:Colorize(l10n("Right Click") .. ": ", "gray") .. l10n("Toggle My Journey"))
GameTooltip:AddLine(" ")
GameTooltip:AddLine(Questie:Colorize(l10n("Left Click + Hold") .. ": ", "gray") .. l10n("Drag while Unlocked"))
GameTooltip:AddLine(Questie:Colorize(l10n("Ctrl + Left Click + Hold") .. ": ", "gray") .. l10n("Drag while Locked"))
local VoiceOver, TomTom = TrackerUtils:IsVoiceOverLoaded(), IsAddOnLoaded("TomTom")
if VoiceOver or TomTom then
GameTooltip:AddLine(" ")
GameTooltip:AddLine(Questie:Colorize(l10n("Questie Tracker Integrations") .. ": ", "gray"))
if VoiceOver then
GameTooltip:AddLine(Questie:Colorize(l10n("VoiceOver") .. ": ", "white") .. l10n("Hold shift to see PlayButtons"))
end
if TomTom then
GameTooltip:AddLine(Questie:Colorize(l10n("TomTom") .. ": ", "white") .. l10n("Ctrl + Left Click or Right Click a Quest Title"))
end
end
GameTooltip:Show()
TrackerFadeTicker.Unfade(self)
end)
questieIcon:SetScript("OnLeave", function(self)
if GameTooltip:IsShown() then
GameTooltip:Hide()
end
TrackerFadeTicker.Fade(self)
end)
questieIcon:Hide()
headerFrame.questieIcon = questieIcon
-- Questie Tracked Quests Settings
local trackedQuests = CreateFrame("Button", nil, trackerBaseFrame)
trackedQuests:SetPoint("TOPLEFT", questieIcon, "TOPLEFT", 10, 0)
-- Questie Tracked Quests Label
trackedQuests.label = headerFrame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
trackedQuests.label:SetPoint("TOPLEFT", headerFrame, "TOPLEFT", 0, 0)
trackedQuests.SetMode = function(self, mode)
if mode ~= self.mode then
self.mode = mode
end
end
if Questie.db.char.isTrackerExpanded then
trackedQuests:SetMode(1)
else
trackedQuests:SetMode(0)
end
trackedQuests:EnableMouse(true)
trackedQuests:RegisterForDrag("LeftButton")
trackedQuests:RegisterForClicks("RightButtonUp", "LeftButtonUp")
trackedQuests:SetScript("OnClick", function(self)
if InCombatLockdown() then
return
end
if self.mode == 1 then
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerHeaderFrame:OnClick] - Tracker Minimized")
self:SetMode(0)
Questie.db.char.isTrackerExpanded = false
else
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerHeaderFrame:OnClick] - Tracker Maximized")
self:SetMode(1)
Questie.db.char.isTrackerExpanded = true
end
QuestieCombatQueue:Queue(function()
QuestieTracker:Update()
end)
end)
trackedQuests:SetScript("OnDragStart", TrackerBaseFrame.OnDragStart)
trackedQuests:SetScript("OnDragStop", TrackerBaseFrame.OnDragStop)
trackedQuests:SetScript("OnEnter", TrackerFadeTicker.Unfade)
trackedQuests:SetScript("OnLeave", TrackerFadeTicker.Fade)
trackedQuests:Hide()
headerFrame.trackedQuests = trackedQuests
if Questie.db.profile.trackerHeaderEnabled or (not QuestieTracker:HasQuest()) then
headerFrame:SetSize(1, Questie.db.profile.trackerFontSizeHeader) -- Width is updated later on
else
headerFrame:SetSize(1, 1)
end
headerFrame:SetFrameLevel(0)
headerFrame:Hide()
TrackerHeaderFrame.headerFrame = headerFrame
return headerFrame
end
function TrackerHeaderFrame:Update()
local trackerFontSizeHeader = Questie.db.profile.trackerFontSizeHeader
local trackerFontSizeZone = Questie.db.profile.trackerFontSizeZone
if Questie.db.profile.trackerHeaderEnabled or (not QuestieTracker:HasQuest()) then
headerFrame:ClearAllPoints()
headerFrame.questieIcon.texture:SetWidth(trackerFontSizeHeader)
headerFrame.questieIcon.texture:SetHeight(trackerFontSizeHeader)
headerFrame.questieIcon:ClearAllPoints()
headerFrame.questieIcon:SetWidth(trackerFontSizeHeader)
headerFrame.questieIcon:SetHeight(trackerFontSizeHeader)
headerFrame.questieIcon:SetAlpha(1)
headerFrame.questieIcon:SetPoint("TOPLEFT", headerFrame, "TOPLEFT", 6, 0)
headerFrame.questieIcon:Show()
headerFrame.trackedQuests.label:SetFont(LSM30:Fetch("font", Questie.db.profile.trackerFontHeader), trackerFontSizeHeader, Questie.db.profile.trackerFontOutline)
local maxQuestAmount = "/" .. C_QuestLog.GetMaxNumQuestsCanAccept()
local _, activeQuests = GetNumQuestLogEntries()
if Questie.db.char.isTrackerExpanded then
headerFrame.trackedQuests.label:SetText(l10n("Questie Tracker") .. ": " .. tostring(activeQuests) .. maxQuestAmount)
else
headerFrame.trackedQuests.label:SetText(l10n("Questie Tracker") .. " +")
end
headerFrame.trackedQuests.label:SetPoint("TOPLEFT", headerFrame.questieIcon, "TOPRIGHT", 2, 0)
headerFrame.trackedQuests:SetWidth(headerFrame.trackedQuests.label:GetUnboundedStringWidth())
headerFrame.trackedQuests:SetHeight(trackerFontSizeHeader)
headerFrame.trackedQuests:SetPoint("TOPLEFT", headerFrame.questieIcon, "TOPRIGHT", 2, 0)
headerFrame.trackedQuests:Show()
headerFrame:SetWidth(headerFrame.trackedQuests.label:GetUnboundedStringWidth() + trackerFontSizeHeader)
headerFrame:SetHeight(trackerFontSizeHeader + 5)
headerFrame:Show()
TrackerHeaderFrame.PositionTrackerHeaderFrame(headerFrame, trackerBaseFrame)
QuestieCompat.SetResizeBounds(trackerBaseFrame, headerFrame.trackedQuests.label:GetUnboundedStringWidth(), trackerFontSizeHeader)
else
headerFrame:Hide()
headerFrame.questieIcon.texture:SetWidth(trackerFontSizeZone)
headerFrame.questieIcon.texture:SetHeight(trackerFontSizeZone)
headerFrame.questieIcon:ClearAllPoints()
headerFrame.questieIcon:SetWidth(trackerFontSizeZone)
headerFrame.questieIcon:SetHeight(trackerFontSizeZone)
headerFrame.questieIcon:SetAlpha(0)
local QuestieTrackerLoc = Questie.db.profile.TrackerLocation
if Questie.db.profile.moveHeaderToBottom then
headerFrame.questieIcon:SetPoint("BOTTOMRIGHT", trackerBaseFrame, "BOTTOMRIGHT", -4, 8)
else
headerFrame.questieIcon:SetPoint("TOPRIGHT", trackerBaseFrame, "TOPRIGHT", -4, -8)
end
headerFrame.questieIcon:Show()
headerFrame.trackedQuests:Hide()
end
end
function TrackerHeaderFrame.PositionTrackerHeaderFrame()
local QuestieTrackerLoc = Questie.db.profile.TrackerLocation
if Questie.db.profile.moveHeaderToBottom then
-- Move tracker header to the bottom
headerFrame:SetPoint("BOTTOMLEFT", trackerBaseFrame, "BOTTOMLEFT", 0, 5)
else
if Questie.db.char.isTrackerExpanded then
-- Move tracker header to the top
headerFrame:SetPoint("TOPLEFT", trackerBaseFrame, "TOPLEFT", 0, -10)
else
-- Tracker minimized. Move tracker header to the bottom
headerFrame:SetPoint("BOTTOMLEFT", trackerBaseFrame, "BOTTOMLEFT", 0, 5)
end
end
end
File diff suppressed because it is too large Load Diff
+579
View File
@@ -0,0 +1,579 @@
---@class TrackerMenu
local TrackerMenu = QuestieLoader:CreateModule("TrackerMenu")
-------------------------
--Import QuestieTracker modules.
-------------------------
---@type QuestieTracker
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
---@type TrackerBaseFrame
local TrackerBaseFrame = QuestieLoader:ImportModule("TrackerBaseFrame")
---@type TrackerUtils
local TrackerUtils = QuestieLoader:ImportModule("TrackerUtils")
-------------------------
--Import Questie modules.
-------------------------
---@type QuestieQuest
local QuestieQuest = QuestieLoader:ImportModule("QuestieQuest")
---@type QuestieMap
local QuestieMap = QuestieLoader:ImportModule("QuestieMap")
---@type QuestieLink
local QuestieLink = QuestieLoader:ImportModule("QuestieLink")
---@type QuestieCombatQueue
local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
---@type QuestieLib
local QuestieLib = QuestieLoader:ImportModule("QuestieLib")
---@type QuestieDB
local QuestieDB = QuestieLoader:ImportModule("QuestieDB")
---@type l10n
local l10n = QuestieLoader:ImportModule("l10n")
--- COMPATIBILITY ---
local C_Timer = QuestieCompat.C_Timer
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
local LibDropDown = QuestieCompat.LibUIDropDownMenu or LibStub:GetLibrary("LibUIDropDownMenuQuestie-4.0")
TrackerMenu.menuFrame = LibDropDown:Create_UIDropDownMenu("QuestieTrackerMenuFrame", UIParent)
local tinsert = table.insert
-- Create local Quest Menu functions
TrackerMenu.addFocusOption = function(menu, quest, objective)
if Questie.db.char.TrackerFocus and type(Questie.db.char.TrackerFocus) == "string" and Questie.db.char.TrackerFocus == tostring(quest.Id) .. " " .. tostring(objective.Index) then
tinsert(menu, {
text = l10n('Unfocus'),
func = function()
LibDropDown:CloseDropDownMenus()
TrackerUtils:UnFocus()
QuestieQuest:ToggleNotes(true)
end
})
else
tinsert(menu, {
text = l10n('Focus Objective'),
func = function()
LibDropDown:CloseDropDownMenus()
TrackerUtils:FocusObjective(quest.Id, objective.Index)
QuestieQuest:ToggleNotes(false)
end
})
end
end
TrackerMenu.addTomTomOption = function(menu, quest, objective)
tinsert(menu, {
text = l10n('Set |cFF54e33bTomTom|r Target'),
func = function()
LibDropDown:CloseDropDownMenus()
local spawn, zone, name = QuestieMap:GetNearestQuestSpawn(quest)
if (not spawn) and objective ~= nil then
spawn, zone, name = QuestieMap:GetNearestSpawn(objective)
end
if spawn then
TrackerUtils:SetTomTomTarget(name, zone, spawn[1], spawn[2])
end
end
})
end
TrackerMenu.minMaxQuestOption = function(menu, quest)
if Questie.db.char.collapsedQuests[quest.Id] then
tinsert(menu, {
text = l10n('Maximize Quest'),
func = function()
Questie.db.char.collapsedQuests[quest.Id] = false
QuestieCombatQueue:Queue(function()
QuestieTracker:Update()
end)
end
})
else
tinsert(menu, {
text = l10n('Minimize Quest'),
func = function()
Questie.db.char.collapsedQuests[quest.Id] = true
QuestieCombatQueue:Queue(function()
QuestieTracker:Update()
end)
end
})
end
end
TrackerMenu.addShowHideObjectivesOption = function(menu, quest, objective)
if objective.HideIcons then
tinsert(menu, {
text = l10n('Show Icons'),
func = function()
LibDropDown:CloseDropDownMenus()
objective.HideIcons = nil
Questie.db.char.TrackerHiddenObjectives[tostring(quest.Id) .. " " .. tostring(objective.Index)] = nil
QuestieQuest:ToggleNotes(true)
end
})
else
tinsert(menu, {
text = l10n('Hide Icons'),
func = function()
LibDropDown:CloseDropDownMenus()
objective.HideIcons = true
Questie.db.char.TrackerHiddenObjectives[tostring(quest.Id) .. " " .. tostring(objective.Index)] = true
QuestieQuest:ToggleNotes(false)
end
})
end
end
TrackerMenu.addShowHideQuestsOption = function(menu, quest)
if quest.HideIcons then
tinsert(menu, {
text = l10n('Show Icons'),
func = function()
quest.HideIcons = nil
Questie.db.char.TrackerHiddenQuests[quest.Id] = nil
QuestieQuest:ToggleNotes(true)
end
})
else
tinsert(menu, {
text = l10n('Hide Icons'),
func = function()
quest.HideIcons = true
Questie.db.char.TrackerHiddenQuests[quest.Id] = true
QuestieQuest:ToggleNotes(false)
end
})
end
end
TrackerMenu.addShowObjectivesOnMapOption = function(menu, quest, objective)
tinsert(menu, {
text = l10n('Show on Map'),
func = function()
LibDropDown:CloseDropDownMenus()
local needHiddenUpdate = false
if (Questie.db.char.TrackerFocus and type(Questie.db.char.TrackerFocus) == "string" and Questie.db.char.TrackerFocus ~= tostring(quest.Id) .. " " .. tostring(objective.Index))
or (Questie.db.char.TrackerFocus and type(Questie.db.char.TrackerFocus) == "number" and Questie.db.char.TrackerFocus ~= quest.Id) then
TrackerUtils:UnFocus()
needHiddenUpdate = true
end
if objective.HideIcons then
objective.HideIcons = nil
needHiddenUpdate = true
end
if quest.HideIcons then
quest.HideIcons = nil
needHiddenUpdate = true
end
if needHiddenUpdate then
QuestieQuest:ToggleNotes(true)
end
TrackerUtils:ShowObjectiveOnMap(objective)
end
})
end
TrackerMenu.addShowFinisherOnMapOption = function(menu, quest)
if quest:IsComplete() == 1 then
tinsert(menu, {
text = l10n('Show on Map'),
func = function()
LibDropDown:CloseDropDownMenus()
TrackerUtils:ShowFinisherOnMap(quest)
end
})
end
end
TrackerMenu.addObjectiveOption = function(menu, subMenu, quest)
if quest:IsComplete() == 0 then
tinsert(menu, { text = l10n('Objectives'), hasArrow = true, menuList = subMenu })
end
end
TrackerMenu.addLinkToChatOption = function(menu, quest)
tinsert(menu, {
text = l10n('Link Quest to chat'),
func = function()
LibDropDown:CloseDropDownMenus()
if (not ChatFrame1EditBox:IsVisible()) then
ChatFrame_OpenChat(QuestieLink:GetQuestLinkString(quest.level, quest.name, quest.Id))
else
ChatEdit_InsertLink(QuestieLink:GetQuestLinkString(quest.level, quest.name, quest.Id))
end
end
})
end
TrackerMenu.addShowInQuestLogOption = function(menu, quest)
tinsert(menu, {
text = l10n('Show in Quest Log'),
func = function()
LibDropDown:CloseDropDownMenus()
TrackerUtils:ShowQuestLog(quest)
end
})
end
TrackerMenu.addAbandonedQuest = function(menu, quest)
tinsert(menu, {
text = l10n('Abandon Quest'),
func = function()
LibDropDown:CloseDropDownMenus()
local lastQuest = GetQuestLogSelection()
local questLogIndex = (GetQuestLogIndexByID and GetQuestLogIndexByID(quest.Id)) or 0
if questLogIndex and questLogIndex > 0 then
SelectQuestLogEntry(questLogIndex)
end
SetAbandonQuest()
local items = GetAbandonQuestItems()
if items then
StaticPopup_Hide("ABANDON_QUEST")
StaticPopup_Show("ABANDON_QUEST_WITH_ITEMS", GetAbandonQuestName(), items)
else
StaticPopup_Hide("ABANDON_QUEST_WITH_ITEMS")
StaticPopup_Show("ABANDON_QUEST", GetAbandonQuestName())
end
SelectQuestLogEntry(lastQuest)
local questLogFrame = QuestLogExFrame or ClassicQuestLog or QuestLogFrame
if questLogFrame:IsShown() then
QuestLog_Update()
end
end
})
end
TrackerMenu.addUntrackOption = function(menu, quest)
tinsert(menu, {
text = l10n('Untrack Quest'),
func = function()
LibDropDown:CloseDropDownMenus()
QuestieTracker:UntrackQuestId(quest.Id)
local questLogFrame = QuestLogExFrame or ClassicQuestLog or QuestLogFrame
if questLogFrame:IsShown() then
QuestLog_Update()
end
end
})
end
TrackerMenu.addFocusUnfocusOption = function(menu, quest)
if Questie.db.char.TrackerFocus and type(Questie.db.char.TrackerFocus) == "number" and Questie.db.char.TrackerFocus == quest.Id then
tinsert(menu, {
text = l10n('Unfocus'),
func = function()
LibDropDown:CloseDropDownMenus()
TrackerUtils:UnFocus()
QuestieQuest:ToggleNotes(true)
end
})
else
tinsert(menu, {
text = l10n('Focus Quest'),
func = function()
LibDropDown:CloseDropDownMenus()
TrackerUtils:FocusQuest(quest.Id)
QuestieQuest:ToggleNotes(false)
end
})
end
end
TrackerMenu.addLockUnlockOption = function(menu)
if Questie.db.profile.trackerLocked then
tinsert(menu, {
text = l10n('Unlock Tracker'),
func = function()
LibDropDown:CloseDropDownMenus()
Questie.db.profile.trackerLocked = false
TrackerBaseFrame:Update()
end
})
else
tinsert(menu, {
text = l10n('Lock Tracker'),
func = function()
LibDropDown:CloseDropDownMenus()
Questie.db.profile.trackerLocked = true
TrackerBaseFrame:Update()
end
})
end
end
-- Register the WoWHead Quest popup dialog
StaticPopupDialogs["QUESTIE_WOWHEAD_URL"] = {
text = "WoWHead URL",
button2 = CLOSE,
hasEditBox = true,
editBoxWidth = 280,
EditBoxOnEnterPressed = function(self)
self:GetParent():Hide()
end,
EditBoxOnEscapePressed = function(self)
self:GetParent():Hide()
end,
OnShow = function(self)
local questID = self.text.text_arg1 or self.data
local quest_wow = QuestieDB.GetQuest(questID)
local name = quest_wow.name
-- self.text:SetText(self.text:GetText() .. "\n\n|cffff7f00" .. name .. "|r")
self.text:SetFont("GameFontNormal", 12)
-- self.text:SetText(self.text:GetText() .. "\n\n|c FFFFB9 00" .. name .. "|r")
self.text:SetText(self.text:GetText() .. Questie:Colorize("\n\n" .. name, "gold"))
local langShort = string.sub(l10n:GetUILocale(), 1, 2) .. "."
if langShort == "en." then
langShort = ""
end
local wowheadLink
if Questie.IsWotlk then
if langShort then
langShort = langShort:gsub("%.", "/") -- The Wotlk WoWHead URL differs to the other Classic URLs
end
wowheadLink = "https://" .. "wowhead.com/wotlk/" .. langShort .. "quest=" .. questID
elseif Questie.IsTBC then
wowheadLink = "https://" .. langShort .. "tbc.wowhead.com/quest=" .. questID
else
wowheadLink = "https://" .. langShort .. "classic.wowhead.com/quest=" .. questID
end
self.editBox:SetText(wowheadLink)
self.editBox:SetFocus()
self.editBox:HighlightText()
self.editBox:SetScript("OnKeyDown", function(_, key)
if key == "C" and IsControlKeyDown() then
C_Timer.After(0.1, function()
self.editBox:GetParent():Hide()
ActionStatus_DisplayMessage(l10n("Copied URL to clipboard"), true)
end)
end
end)
end,
whileDead = true,
hideOnEscape = true,
timeout = 0 -- 335
}
-- Create Quest Menu
function TrackerMenu:GetMenuForQuest(quest)
local menu = {}
local subMenu = {}
for _, objective in pairs(quest.Objectives) do
local objectiveMenu = {}
TrackerMenu.addFocusOption(objectiveMenu, quest, objective)
TrackerMenu.addTomTomOption(objectiveMenu, nil, objective)
TrackerMenu.addShowHideObjectivesOption(objectiveMenu, quest, objective)
TrackerMenu.addShowObjectivesOnMapOption(objectiveMenu, quest, objective)
tinsert(subMenu, { text = objective.Description, hasArrow = true, menuList = objectiveMenu })
end
if next(quest.SpecialObjectives) then
for _, objective in pairs(quest.SpecialObjectives) do
local objectiveMenu = {}
TrackerMenu.addFocusOption(objectiveMenu, quest, objective)
TrackerMenu.addTomTomOption(objectiveMenu, nil, objective)
TrackerMenu.addShowHideObjectivesOption(objectiveMenu, quest, objective)
TrackerMenu.addShowObjectivesOnMapOption(objectiveMenu, quest, objective)
tinsert(subMenu, { text = objective.Description, hasArrow = true, menuList = objectiveMenu })
end
end
local coloredQuestName = QuestieLib:GetColoredQuestName(quest.Id, Questie.db.profile.enableTooltipsQuestLevel, true, true)
tinsert(menu, { text = coloredQuestName, isTitle = true })
TrackerMenu.addObjectiveOption(menu, subMenu, quest)
TrackerMenu.addFocusUnfocusOption(menu, quest)
TrackerMenu.addTomTomOption(menu, quest, nil)
TrackerMenu.minMaxQuestOption(menu, quest)
TrackerMenu.addShowHideQuestsOption(menu, quest)
TrackerMenu.addShowFinisherOnMapOption(menu, quest)
TrackerMenu.addShowInQuestLogOption(menu, quest)
TrackerMenu.addLinkToChatOption(menu, quest)
TrackerMenu.addUntrackOption(menu, quest)
TrackerMenu.addAbandonedQuest(menu, quest)
tinsert(menu, {
text = "|cFF39c0edWoWHead URL|r",
func = function()
StaticPopup_Show("QUESTIE_WOWHEAD_URL", quest.Id, nil, quest.Id)
end
})
TrackerMenu.addLockUnlockOption(menu)
tinsert(menu, {
text = l10n('Cancel'),
func = function()
end
})
return menu
end
-- Create local Achievement Menu functions
TrackerMenu.addAchieveLinkToChatOption = function(menu, achieve)
tinsert(menu, {
text = l10n('Link Achievement to chat'),
func = function()
LibDropDown:CloseDropDownMenus()
if (not ChatFrame1EditBox:IsVisible()) then
ChatFrame_OpenChat(GetAchievementLink(achieve.Id))
else
ChatEdit_InsertLink(GetAchievementLink(achieve.Id))
end
end
})
end
TrackerMenu.addShowInAchievementsOption = function(menu, achieve)
tinsert(menu, {
text = l10n('Show in Achievements Log'),
func = function()
LibDropDown:CloseDropDownMenus()
if (not AchievementFrame) then
AchievementFrame_LoadUI()
end
if (not AchievementFrame:IsShown()) then
AchievementFrame_ToggleAchievementFrame()
AchievementFrame_SelectAchievement(achieve.Id)
else
if (AchievementFrameAchievements.selection ~= achieve.Id) then
AchievementFrame_SelectAchievement(achieve.Id)
end
end
end
})
end
TrackerMenu.addUntrackAchieveOption = function(menu, achieve)
tinsert(menu, {
text = l10n('Untrack Achievement'),
func = function()
LibDropDown:CloseDropDownMenus()
QuestieTracker:UntrackAchieveId(achieve.Id)
QuestieTracker:UpdateAchieveTrackerCache(achieve.Id)
if (not AchievementFrame) then
AchievementFrame_LoadUI()
end
AchievementFrameAchievements_ForceUpdate()
QuestieCombatQueue:Queue(function()
QuestieTracker:Update()
end)
end
})
end
-- Register the WoWHead Achievement popup dialog
StaticPopupDialogs["QUESTIE_WOWHEAD_AURL"] = {
text = "WoWHead URL",
button2 = CLOSE,
hasEditBox = true,
editBoxWidth = 280,
EditBoxOnEnterPressed = function(self)
self:GetParent():Hide()
end,
EditBoxOnEscapePressed = function(self)
self:GetParent():Hide()
end,
OnShow = function(self)
local achieveID = self.text.text_arg1 or self.data
local name = select(2, GetAchievementInfo(achieveID))
self.text:SetFont("GameFontNormal", 12)
self.text:SetText(self.text:GetText() .. Questie:Colorize("\n\n" .. name, "gold"))
local langShort = string.sub(l10n:GetUILocale(), 1, 2) .. "."
if langShort == "en." then
langShort = ""
end
local wowheadLink
if langShort then
langShort = langShort:gsub("%.", "/") -- The Wotlk wowhead URL differs to the other Classic URLs
end
wowheadLink = "https://" .. "wowhead.com/wotlk/" .. langShort .. "achievement=" .. achieveID
self.editBox:SetText(wowheadLink)
self.editBox:SetFocus()
self.editBox:HighlightText()
self.editBox:SetScript("OnKeyDown", function(_, key)
if key == "C" and IsControlKeyDown() then
C_Timer.After(0.1, function()
self.editBox:GetParent():Hide()
ActionStatus_DisplayMessage(l10n("Copied URL to clipboard"), true)
end)
end
end)
end,
whileDead = true,
hideOnEscape = true,
timeout = 0 -- 335
}
-- Create Achievement Menu
function TrackerMenu:GetMenuForAchievement(achieve)
local menu = {}
tinsert(menu, { text = "|cFFFFFF00" .. select(2, GetAchievementInfo(achieve.Id)) .. "|r", isTitle = true })
TrackerMenu.addAchieveLinkToChatOption(menu, achieve)
TrackerMenu.addShowInAchievementsOption(menu, achieve)
for trackedId, _ in pairs(Questie.db.char.trackedAchievementIds) do
if trackedId == achieve.Id then
TrackerMenu.addUntrackAchieveOption(menu, achieve)
end
end
tinsert(menu, {
text = "|cFF39c0edWoWHead URL|r",
func = function()
StaticPopup_Show("QUESTIE_WOWHEAD_AURL", achieve.Id, nil, achieve.Id)
end
})
TrackerMenu.addLockUnlockOption(menu)
tinsert(menu, {
text = l10n('Cancel'),
func = function()
end
})
return menu
end
+137
View File
@@ -0,0 +1,137 @@
---@class TrackerQuestFrame
local TrackerQuestFrame = QuestieLoader:CreateModule("TrackerQuestFrame")
-------------------------
--Import QuestieTracker modules.
-------------------------
---@type QuestieCombatQueue
local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
---@type TrackerBaseFrame
local TrackerBaseFrame = QuestieLoader:ImportModule("TrackerBaseFrame")
---@type TrackerFadeTicker
local TrackerFadeTicker = QuestieLoader:ImportModule("TrackerFadeTicker")
---@type QuestieTracker
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
local questFrame, trackerBaseFrame, trackerHeaderFrame
function TrackerQuestFrame.Initialize(baseFrame, headerFrame)
trackerBaseFrame = baseFrame
trackerHeaderFrame = headerFrame
-- TrackerQuestFrame
questFrame = CreateFrame("Frame", "TrackedQuests", trackerBaseFrame)
questFrame:SetWidth(25)
questFrame:SetHeight(25)
TrackerQuestFrame.PositionTrackedQuestsFrame()
questFrame:EnableMouse(true)
questFrame:SetMovable(true)
questFrame:SetResizable(true)
questFrame:RegisterForDrag("LeftButton")
questFrame:SetScript("OnDragStart", TrackerBaseFrame.OnDragStart)
questFrame:SetScript("OnDragStop", TrackerBaseFrame.OnDragStop)
questFrame:SetScript("OnEnter", TrackerFadeTicker.Unfade)
questFrame:SetScript("OnLeave", TrackerFadeTicker.Fade)
local scrollFrameTemplete
if Questie.IsWotlk and (not QuestieCompat.Is335) then
scrollFrameTemplete = "ScrollFrameTemplate"
else
scrollFrameTemplete = "UIPanelScrollFrameTemplate"
end
-- ScrollFrame
questFrame.ScrollFrame = CreateFrame("ScrollFrame", "TrackedQuestsScrollFrame", questFrame, scrollFrameTemplete)
questFrame.ScrollFrame:SetAllPoints(questFrame)
if not Questie.IsWotlk or QuestieCompat.Is335 then
local frameName = questFrame.ScrollFrame:GetName()
questFrame.ScrollBar = _G[frameName .. "ScrollBar"]
questFrame.ScrollBar:ClearAllPoints()
questFrame.ScrollBar:SetPoint("TOPRIGHT", questFrame.ScrollUpButton, "BOTTOMRIGHT", -1, 4)
questFrame.ScrollBar:SetPoint("BOTTOMRIGHT", questFrame.scrolldownbutton, "TOPRIGHT", -1, -2)
questFrame.ScrollBar:SetValueStep(25)
questFrame.ScrollBar.scrollStep = 25
questFrame.ScrollBar:SetValue(0)
questFrame.scrollBarHideable = true
questFrame.ScrollBar:Hide()
questFrame.ScrollUpButton = _G[frameName .. "ScrollBarScrollUpButton"]
questFrame.ScrollUpButton:ClearAllPoints()
questFrame.ScrollUpButton:SetPoint("TOPRIGHT", questFrame.ScrollFrame, "TOPRIGHT", -4, -1)
questFrame.ScrollUpButton:Hide()
questFrame.ScrollDownButton = _G[frameName .. "ScrollBarScrollDownButton"]
questFrame.ScrollDownButton:ClearAllPoints()
questFrame.ScrollDownButton:SetPoint("BOTTOMRIGHT", questFrame.ScrollFrame, "BOTTOMRIGHT", -4, -7)
questFrame.ScrollDownButton:Hide()
questFrame.ScrollBg = questFrame.ScrollBar:CreateTexture(nil, "BACKGROUND")
questFrame.ScrollBg:SetAllPoints(questFrame.ScrollBar)
if (not QuestieCompat.Is335) then
questFrame.ScrollBg:SetColorTexture(0, 0, 0, 0.75)
end
questFrame.ScrollBg:Hide()
questFrame.ScrollChildFrame = CreateFrame("Frame", _G[frameName .. "ScrollChildFrame"])
else
questFrame.ScrollFrame.ScrollBar:Hide()
questFrame.ScrollChildFrame = CreateFrame("Frame", "TrackedQuestsScrollChildFrame")
end
questFrame.ScrollChildFrame:SetSize(questFrame.ScrollFrame:GetWidth(), (questFrame.ScrollFrame:GetHeight()))
questFrame.ScrollFrame:SetScrollChild(questFrame.ScrollChildFrame)
questFrame:Hide()
TrackerQuestFrame.questFrame = questFrame
return questFrame
end
function TrackerQuestFrame:Update()
if Questie.db.char.isTrackerExpanded then
questFrame:ClearAllPoints()
TrackerQuestFrame.PositionTrackedQuestsFrame()
questFrame:Show()
-- Enables Click-Through when the tracker is locked
if IsControlKeyDown() or (not Questie.db.profile.trackerLocked) then
QuestieCombatQueue:Queue(function()
questFrame:EnableMouse(true)
questFrame:SetMovable(true)
questFrame:SetResizable(true)
end)
else
QuestieCombatQueue:Queue(function()
questFrame:EnableMouse(false)
questFrame:SetMovable(false)
questFrame:SetResizable(false)
end)
end
else
questFrame:Hide()
end
end
function TrackerQuestFrame.PositionTrackedQuestsFrame()
local QuestieTrackerLoc = Questie.db.profile.TrackerLocation
if Questie.db.profile.trackerHeaderEnabled or (Questie.db.profile.alwaysShowTracker and not QuestieTracker:HasQuest()) then
if Questie.db.profile.moveHeaderToBottom then
-- Move the tracker header to the bottom
questFrame:SetPoint("BOTTOMLEFT", trackerHeaderFrame, "TOPLEFT", 0, 4)
else
-- Move the tracker header to the top
questFrame:SetPoint("TOPLEFT", trackerHeaderFrame, "BOTTOMLEFT", 0, 0)
end
elseif QuestieTrackerLoc and (QuestieTrackerLoc[1] == "BOTTOMLEFT" or QuestieTrackerLoc[1] == "BOTTOMRIGHT") then
-- No header. TrackedQuestsFrame is attached to the bottom.
questFrame:SetPoint("BOTTOMLEFT", trackerBaseFrame, "BOTTOMLEFT", 0, 10)
else
-- No header. TrackedQuestsFrame is attached to the top.
questFrame:SetPoint("TOPLEFT", trackerBaseFrame, "TOPLEFT", 0, -10)
end
end
+174
View File
@@ -0,0 +1,174 @@
---@class TrackerQuestTimers
local TrackerQuestTimers = QuestieLoader:CreateModule("TrackerQuestTimers")
-------------------------
--Import QuestieTracker modules.
-------------------------
---@type QuestieTracker
local QuestieTracker = QuestieLoader:ImportModule("QuestieTracker")
---@type TrackerLinePool
local TrackerLinePool = QuestieLoader:ImportModule("TrackerLinePool")
-------------------------
--Import Questie modules.
-------------------------
---@type QuestieCombatQueue
local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
--- COMPATIBILITY ---
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
local LSM30 = LibStub("LibSharedMedia-3.0")
local WatchFrame = QuestTimerFrame or WatchFrame
local blizzardTimerLocation = {}
local timer
-- Save the default location of the Blizzard QuestTimerFrame
if not (Questie.IsWotlk or QuestieCompat.Is335) then
blizzardTimerLocation = { QuestTimerFrame:GetPoint() }
end
function TrackerQuestTimers:Initialize()
Questie:Debug(Questie.DEBUG_DEVELOP, "[TrackerQuestTimers:Initialize]")
if QuestieTracker.started or (not Questie.db.profile.trackerEnabled) then
return
end
-- All Classic expansions
WatchFrame:HookScript("OnShow", function()
if Questie.db.profile.showBlizzardQuestTimer then
TrackerQuestTimers:ShowBlizzardTimer()
else
TrackerQuestTimers:HideBlizzardTimer()
end
end)
-- Pre-Classic WotLK
if not (Questie.IsWotlk or QuestieCompat.Is335) then
local timeElapsed = 0
WatchFrame:HookScript("OnUpdate", function(_, elapsed)
timeElapsed = timeElapsed + elapsed
if timeElapsed > 1 then
TrackerQuestTimers:UpdateTimerFrame()
timeElapsed = 0
end
end)
end
end
function TrackerQuestTimers:HideBlizzardTimer()
if Questie.IsWotlk or QuestieCompat.Is335 then
-- Classic WotLK
WatchFrame:Hide()
else
-- Classic WoW: This moves the QuestTimerFrame off screen. A faux Hide().
-- Otherwise, if the frame is hidden then the OnUpdate doesn't work.
WatchFrame:ClearAllPoints()
WatchFrame:SetPoint("TOP", "UIParent", -10000, -10000)
end
end
function TrackerQuestTimers:ShowBlizzardTimer()
if Questie.IsWotlk or QuestieCompat.Is335 then
-- Classic WotLK
WatchFrame:Show()
else
-- Classic WoW: This moves the QuestTimerFrame
-- back its default location. A faux Show()
if blizzardTimerLocation[1] then
WatchFrame:ClearAllPoints()
WatchFrame:SetPoint(unpack(blizzardTimerLocation))
end
end
end
---@param quest table
---@param frame frame
---@param clear boolean
---@return string|nil timeRemainingString, number|nil timeRemaining
function TrackerQuestTimers:GetRemainingTime(quest, frame, clear)
local timeRemainingString, timeRemaining = TrackerQuestTimers:GetRemainingTimeByQuestId(quest.Id)
if (timeRemainingString == nil) then
quest.timedBlizzardQuest = nil
quest.trackTimedQuest = false
return nil
end
if clear then
timer = nil
elseif frame then
timer = {
frame = frame,
questId = quest.Id
}
end
if timeRemaining then
if Questie.db.profile.showBlizzardQuestTimer then
TrackerQuestTimers:ShowBlizzardTimer()
quest.timedBlizzardQuest = true
quest.trackTimedQuest = false
else
TrackerQuestTimers:HideBlizzardTimer()
quest.timedBlizzardQuest = false
quest.trackTimedQuest = true
end
end
return timeRemainingString, timeRemaining
end
---@param questId number
---@return string timeRemainingString, number timeRemaining, nil
function TrackerQuestTimers:GetRemainingTimeByQuestId(questId)
local questLogIndex = GetQuestLogIndexByID(questId)
if (not questLogIndex) then
return nil
end
local questTimers = GetQuestTimers(questId)
if (not questTimers) then
return nil
end
if type(questTimers) == "number" then
local currentQuestLogSelection = GetQuestLogSelection()
SelectQuestLogEntry(questLogIndex)
-- We can't use GetQuestTimers because we don't know for which quest the timer is.
-- GetQuestLogTimeLeft returns the correct value though.
local timeRemaining = GetQuestLogTimeLeft(questLogIndex)
SelectQuestLogEntry(currentQuestLogSelection)
if timeRemaining ~= nil then
local timeRemainingString = SecondsToTime(timeRemaining, false, true)
if not strfind(timeRemainingString, "Seconds?") then
timeRemainingString = timeRemainingString .. " 0 Seconds"
end
return timeRemainingString, timeRemaining
else
return nil
end
else
Questie:Error("The return value of GetQuestTimers is not number, something is off. Please report this!")
end
return nil
end
function TrackerQuestTimers:UpdateTimerFrame()
if timer and (Questie.db.profile.trackerEnabled and Questie.db.char.isTrackerExpanded and (QuestieTracker.disableHooks ~= true)) then
local timeRemainingString, timeRemaining = TrackerQuestTimers:GetRemainingTimeByQuestId(timer.questId)
if timeRemainingString ~= nil then
Questie:Debug(Questie.DEBUG_SPAM, "[TrackerQuestTimers:UpdateTimerFrame] - ", timeRemainingString)
timer.frame.label:SetFont(LSM30:Fetch("font", Questie.db.profile.trackerFontObjective), Questie.db.profile.trackerFontSizeObjective, Questie.db.profile.trackerFontOutline)
timer.frame.label:SetText(Questie:Colorize(timeRemainingString, "blue"))
timer.frame:SetWidth(timer.frame.label:GetWidth() + ((34) - (18 - Questie.db.profile.trackerFontSizeQuest)) + Questie.db.profile.trackerFontSizeQuest)
else
Questie:Debug(Questie.DEBUG_SPAM, "[TrackerQuestTimers] Quest Timer Expired!")
return
end
end
end
File diff suppressed because it is too large Load Diff