Guard all LibSharedMedia-3.0 usages against nil LSM - OptionalDep may not load
- Use LibStub(..., true) silent flag on all LSM acquisition sites - Guard HashTable() calls in Options files (returns nil if no font type registered) - Guard all Fetch() call sites with inline 'LSM30 and LSM30:Fetch() or fallback' - Make font values lazy functions in options dropdowns so LSM has time to register - Affects: QuestieOptionsTracker, QuestieOptionsArrow, QuestieArrow, QuestieTracker, TrackerHeaderFrame, TrackerLinePool, TrackerQuestTimers
This commit is contained in:
@@ -48,7 +48,7 @@ local GetQuestLogTitle = QuestieCompat.GetQuestLogTitle
|
||||
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
|
||||
local GetItemInfo = QuestieCompat.GetItemInfo
|
||||
|
||||
local LSM30 = LibStub("LibSharedMedia-3.0")
|
||||
local LSM30 = LibStub and LibStub("LibSharedMedia-3.0", true)
|
||||
|
||||
-- Local Vars
|
||||
local trackerLineWidth = 0
|
||||
@@ -1275,7 +1275,7 @@ function QuestieTracker:Update()
|
||||
line.label:SetPoint("TOPLEFT", line, "TOPLEFT", lineWidthQBC, 0)
|
||||
|
||||
-- Set Timer font
|
||||
line.label:SetFont(LSM30:Fetch("font", Questie.db.profile.trackerFontObjective),
|
||||
line.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective) or Questie.db.profile.trackerFontObjective,
|
||||
Questie.db.profile.trackerFontSizeObjective, Questie.db.profile.trackerFontOutline)
|
||||
|
||||
-- Set Timer Title based on states
|
||||
|
||||
@@ -26,7 +26,7 @@ local QuestieQuest = QuestieLoader:ImportModule("QuestieQuest")
|
||||
local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
|
||||
---@type l10n
|
||||
local l10n = QuestieLoader:ImportModule("l10n")
|
||||
local LSM30 = LibStub("LibSharedMedia-3.0")
|
||||
local LSM30 = LibStub and LibStub("LibSharedMedia-3.0", true)
|
||||
|
||||
--- COMPATIBILITY ---
|
||||
local C_QuestLog = QuestieCompat.C_QuestLog
|
||||
@@ -209,7 +209,7 @@ function TrackerHeaderFrame:Update()
|
||||
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)
|
||||
headerFrame.trackedQuests.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontHeader) or Questie.db.profile.trackerFontHeader, trackerFontSizeHeader, Questie.db.profile.trackerFontOutline)
|
||||
|
||||
local maxQuestAmount = "/" .. C_QuestLog.GetMaxNumQuestsCanAccept()
|
||||
local _, activeQuests = GetNumQuestLogEntries()
|
||||
|
||||
@@ -37,7 +37,7 @@ local C_QuestLog = QuestieCompat.C_QuestLog
|
||||
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
|
||||
|
||||
local LibDropDown = QuestieCompat.LibUIDropDownMenu or LibStub:GetLibrary("LibUIDropDownMenuQuestie-4.0")
|
||||
local LSM30 = LibStub("LibSharedMedia-3.0")
|
||||
local LSM30 = LibStub and LibStub("LibSharedMedia-3.0", true)
|
||||
|
||||
local linePoolSize = 250
|
||||
local lineIndex = 0
|
||||
@@ -562,7 +562,7 @@ function TrackerLinePool.Initialize(questFrame)
|
||||
|
||||
-- Charges Updates
|
||||
self.count:Hide()
|
||||
self.count:SetFont(LSM30:Fetch("font", Questie.db.profile.trackerFontQuest), Questie.db.profile.trackerFontSizeQuest, "OUTLINE")
|
||||
self.count:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontQuest) or Questie.db.profile.trackerFontQuest, Questie.db.profile.trackerFontSizeQuest, "OUTLINE")
|
||||
if self.charges > 1 then
|
||||
self.count:SetText(self.charges)
|
||||
self.count:Show()
|
||||
@@ -1089,16 +1089,16 @@ TrackerLinePool.SetMode = function(self, mode)
|
||||
self.mode = mode
|
||||
if mode == "zone" then
|
||||
local trackerFontSizeZone = Questie.db.profile.trackerFontSizeZone
|
||||
self.label:SetFont(LSM30:Fetch("font", Questie.db.profile.trackerFontZone), trackerFontSizeZone, Questie.db.profile.trackerFontOutline)
|
||||
self.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontZone) or Questie.db.profile.trackerFontZone, trackerFontSizeZone, Questie.db.profile.trackerFontOutline)
|
||||
self.label:SetHeight(trackerFontSizeZone)
|
||||
elseif mode == "quest" or mode == "achieve" then
|
||||
local trackerFontSizeQuest = Questie.db.profile.trackerFontSizeQuest
|
||||
self.label:SetFont(LSM30:Fetch("font", Questie.db.profile.trackerFontQuest), trackerFontSizeQuest, Questie.db.profile.trackerFontOutline)
|
||||
self.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontQuest) or Questie.db.profile.trackerFontQuest, trackerFontSizeQuest, Questie.db.profile.trackerFontOutline)
|
||||
self.label:SetHeight(trackerFontSizeQuest)
|
||||
self.button = nil
|
||||
elseif mode == "objective" then
|
||||
local trackerFontSizeObjective = Questie.db.profile.trackerFontSizeObjective
|
||||
self.label:SetFont(LSM30:Fetch("font", Questie.db.profile.trackerFontObjective), trackerFontSizeObjective, Questie.db.profile.trackerFontOutline)
|
||||
self.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective) or Questie.db.profile.trackerFontObjective, trackerFontSizeObjective, Questie.db.profile.trackerFontOutline)
|
||||
self.label:SetHeight(trackerFontSizeObjective)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@ local QuestieCombatQueue = QuestieLoader:ImportModule("QuestieCombatQueue")
|
||||
--- COMPATIBILITY ---
|
||||
local GetQuestLogIndexByID = QuestieCompat.GetQuestLogIndexByID
|
||||
|
||||
local LSM30 = LibStub("LibSharedMedia-3.0")
|
||||
local LSM30 = LibStub and LibStub("LibSharedMedia-3.0", true)
|
||||
|
||||
local WatchFrame = QuestTimerFrame or WatchFrame
|
||||
local blizzardTimerLocation = {}
|
||||
@@ -163,7 +163,7 @@ function TrackerQuestTimers:UpdateTimerFrame()
|
||||
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:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective) or 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
|
||||
|
||||
Reference in New Issue
Block a user