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:
Xurkon
2026-04-24 04:24:38 -05:00
parent 97c8f60a28
commit a2a325c8ab
6 changed files with 22 additions and 17 deletions
+5 -5
View File
@@ -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