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:
@@ -27,14 +27,19 @@ QuestieOptions.tabs.tracker = { ... }
|
||||
local _GetShortcuts
|
||||
local trackerOptions = {}
|
||||
|
||||
local SharedMedia = LibStub("LibSharedMedia-3.0")
|
||||
local SharedMedia = LibStub and LibStub("LibSharedMedia-3.0", true)
|
||||
|
||||
-- Build expanded font list from SharedMedia + common WoW fonts
|
||||
local function GetExpandedFontList()
|
||||
local fonts = {}
|
||||
-- Add SharedMedia fonts (HashTable returns key-value table)
|
||||
for name, _ in pairs(SharedMedia:HashTable("font")) do
|
||||
fonts[name] = name
|
||||
-- Add SharedMedia fonts if available (HashTable returns nil if media type not registered yet)
|
||||
if SharedMedia and SharedMedia.HashTable then
|
||||
local lsmFonts = SharedMedia:HashTable("font")
|
||||
if lsmFonts then
|
||||
for name, _ in pairs(lsmFonts) do
|
||||
fonts[name] = name
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Add common WoW fonts not typically in SharedMedia
|
||||
local wowFonts = {
|
||||
|
||||
Reference in New Issue
Block a user