Adapt LibSharedMedia-3.0 for WoW 3.3.5a WOTLK client#3
Conversation
Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates LibSharedMedia-3.0 to better support the WoW 3.3.5a (WotLK) client by adjusting metadata and default media entries to avoid referencing assets/APIs not present or incompatible on that client.
Changes:
- Add
30300to the TOC Interface list for 3.3.5a recognition. - Adjust default media tables for 3.3.5a (remove unavailable Blizzard backgrounds; fix western font paths; make sound
"None"an empty string soFetchreturnsnil). - Update the library MINOR version number.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
LibSharedMedia-3.0/LibSharedMedia-3.0.lua |
Updates library MINOR and adjusts default media entries (backgrounds/fonts/sound “None”) for 3.3.5a compatibility. |
LibSharedMedia-3.0.toc |
Adds 30300 to the Interface metadata to support WoW 3.3.5a. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
…ibStub precedence Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- SOUND | ||
| if not lib.MediaTable.sound then lib.MediaTable.sound = {} end | ||
| lib.MediaTable.sound["None"] = 1 -- Relies on the fact that PlaySoundFile doesn't error on this value | ||
| lib.MediaTable.sound["None"] = [[]] -- PlaySoundFile in WoW 3.3.5a requires a string; Fetch returns nil for empty strings (no sound) |
There was a problem hiding this comment.
With lib.MediaTable.sound["None"] = [[]], lib:Fetch("sound", "None") will return nil because of the result ~= "" and result or nil guard. Since the comment notes that PlaySoundFile in 3.3.5a is string-only, consumers doing PlaySoundFile(LSM:Fetch(...)) will still error (now due to nil, not due to an integer). Consider keeping Fetch’s return value a (non-empty) string for the "None" sound (e.g., adjust Fetch to not nil-out empty strings for sound, or use a known-safe string sentinel) so existing consumer call patterns don’t crash.
| lib.MediaTable.sound["None"] = [[]] -- PlaySoundFile in WoW 3.3.5a requires a string; Fetch returns nil for empty strings (no sound) | |
| lib.MediaTable.sound["None"] = [[Interface\Quiet.ogg]] -- Use a non-empty dummy path so Fetch returns a string; represents "no sound" while keeping PlaySoundFile(LSM:Fetch(...)) safe |
There was a problem hiding this comment.
Fixed in 9ed8493 — changed to [[Interface\Quiet.ogg]]. Fetch now returns a non-nil string for "None", so PlaySoundFile(LSM:Fetch("sound","None")) receives a valid string. Since that file doesn't exist in 3.3.5a, PlaySoundFile silently does nothing.
|
@copilot Lua errors (58 of them, here is the first): Locals: handlers = {(null) = defined @interface\AddOns\LibSharedMedia-3.0\CallbackHandler-1.0\CallbackHandler-1.0.lua:109 (null) = defined @interface\AddOns\LibSharedMedia-3.0\CallbackHandler-1.0\CallbackHandler-1.0.lua:109 } index = ChatEdit_SetLastActiveWindow = defined @interface\AddOns\Chatter\Modules\EditBox.lua:400 SetDefaultModuleLibraries = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:398 Enable = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:325 NewModule = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:266 FCF_Tab_OnClick = defined @interface\AddOns\Chatter\Modules\EditBox.lua:366 EnableModule = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:363 modules = } GetModule = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:241 IterateEmbeds = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:473 SecureHookScript = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceHook-3.0\AceHook-3.0.lua:410 defaultModuleLibraries = } RawHookScript = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceHook-3.0\AceHook-3.0.lua:395 LibSharedMedia_Registered = defined @interface\AddOns\Chatter\Modules\EditBox.lua:233 GetName = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:310 GetOptions = defined @interface\AddOns\Chatter\Modules\EditBox.lua:416 SetAttach = defined @interface\AddOns\Chatter\Modules\EditBox.lua:491 name = "Chatter_Edit Box Polish" IsEnabled = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:482 orderedModules = } Decorate = defined @interface\AddOns\Chatter\Modules\EditBox.lua:287 DisableModule = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:381 baseName = "Chatter" SetBackdrop = defined @interface\AddOns\Chatter\Modules\EditBox.lua:420 HookScript = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceHook-3.0\AceHook-3.0.lua:366 frames = } SecureHook = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceHook-3.0\AceHook-3.0.lua:336 IsHooked = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceHook-3.0\AceHook-3.0.lua:493 UnhookAll = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceHook-3.0\AceHook-3.0.lua:477 SetBorderByChannel = defined @interface\AddOns\Chatter\Modules\EditBox.lua:438 IsModule = defined @interface\AddOns\Bagnon\libs\AceAddon-3.0\AceAddon-3.0.lua:237 db = } SetDefaultModuleState = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:418 ChatEdit_DeactivateChat = defined @interface\AddOns\Chatter\Modules\EditBox.lua:409 OnDisable = defined @interface\AddOns\Chatter\Modules\EditBox.lua:373 SetEnabledState = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:455 Hook = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceHook-3.0\AceHook-3.0.lua:274 enabledState = false OnEnable = defined @interface\AddOns\Chatter\Modules\EditBox.lua:321 OnInitialize = def |
|
@copilot apply changes based on the comments in this thread |
…sound None sentinel Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
Fixed in 9ed8493. |
Both changes from that review thread were already applied in 9ed8493:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- securecallfunction does not exist in WoW 3.3.5a; fall back to a direct call | ||
| local securecallfunction = securecallfunction or function(func, ...) return func(...) end |
There was a problem hiding this comment.
The fallback implementation function(func, ...) return func(...) end changes CallbackHandler behavior vs. the intended securecallfunction: any error thrown by a callback will now propagate and abort dispatching subsequent handlers (and can break the caller). To preserve CallbackHandler’s error-isolation semantics on 3.3.5a, the fallback should wrap the call in pcall/xpcall and report errors via geterrorhandler() (or equivalent) instead of raising them directly.
| -- securecallfunction does not exist in WoW 3.3.5a; fall back to a direct call | |
| local securecallfunction = securecallfunction or function(func, ...) return func(...) end | |
| local xpcall = xpcall | |
| local geterrorhandler = geterrorhandler | |
| -- securecallfunction does not exist in WoW 3.3.5a; provide a fallback that preserves error-isolation semantics | |
| local securecallfunction = securecallfunction or function(func, ...) | |
| if geterrorhandler then | |
| local errorhandler = geterrorhandler() | |
| if errorhandler then | |
| xpcall(func, errorhandler, ...) | |
| return | |
| end | |
| end | |
| return func(...) | |
| end |
|
@copilot apply changes based on the comments in this thread |
…rror isolation Co-authored-by: ayanimea <13433370+ayanimea@users.noreply.github.com>
Done in b8d39c5. The |
|
Message: Interface\AddOns\ZygorGuidesViewer\MapCoords.lua:21: attempt to index global 'Enum' (a nil value) Locals: ZGV = {STEPMARGIN_Y = 4 STEPMARGIN_X = 3 UPDATE_FACTION_Faction = defined @interface\AddOns\ZygorGuidesViewer\Faction.lua:119 RaceClassMatch = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:2457 modules = } CancelTimer = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceTimer-3.0\AceTimer-3.0.lua:166 completedQuests = } OnGuidesLoaded = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:3175 GoalOnLeave = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:2908 CacheReputations = defined @interface\AddOns\ZygorGuidesViewer\Faction.lua:39 stepframes = } SetIconAlpha = defined @interface\AddOns\ZygorGuidesViewer\Options.lua:1180 CreateCartographerWaypoints = defined @interface\AddOns\ZygorGuidesViewer\Waypoints.lua:463 SetDefaultModulePrototype = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:440 QUEST_PROGRESS = defined @interface\AddOns\ZygorGuidesViewer\QuestAutoAccept.lua:161 Options_SetupBlizConfig = defined @interface\AddOns\ZygorGuidesViewer\Options.lua:1131 QUEST_COMPLETE = defined @interface\AddOns\ZygorGuidesViewer\QuestAutoAccept.lua:180 IsEnabled = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceAddon-3.0\AceAddon-3.0.lua:482 QuestTracking_ResetDailies = defined @interface\AddOns\ZygorGuidesViewer\QuestTracking.lua:203 ScheduleTimer = defined @interface\AddOns\DBM-Core\Libs\Ace3\AceTimer-3.0\AceTimer-3.0.lua:113 registered_groups = } RegisterMessage = defined @interface\AddOns\LibSharedMedia-3.0\CallbackHandler-1.0\CallbackHandler-1.0.lua:82 UnregisterMessage = defined @interface\AddOns\LibSharedMedia-3.0\CallbackHandler-1.0\CallbackHandler-1.0.lua:145 ParseGuides = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:3198 GetTranslatedNPC = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:3738 OpenOptions = defined @interface\AddOns\ZygorGuidesViewer\Options.lua:1259 SetFrameScale = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:1998 IsVisible = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:2426 IsNoteHidden = defined @interface\AddOns\ZygorGuidesViewer\Waypoints.lua:430 Rep_Going = defined @interface\AddOns\ZygorGuidesViewer\Faction.lua:101 ConnectWaypointAddon = defined @interface\AddOns\ZygorGuidesViewer\Waypoints.lua:21 MIN_STEP_HEIGHT = 15 RaceClassMatchList = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:2478 Foglight = } PLAYER_CONTROL_GAINED = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:2657 registeredmapspotsets = } STEP_SPACING = 2 AlignFrame = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:2022 FormatDistance = defined @interface\AddOns\ZygorGuidesViewer\Pointer.lua:451 Pointer = } ResizeFrame = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:2337 BFL = } RevChains = } GetItemData = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:3698 GoalProto_mt = } GetMapZoneFile = defined @interface\AddOns\ZygorGuidesViewer\Waypoints.lua:608 OnInitialize = defined @interface\AddOns\ZygorGuidesViewer\ZygorGuidesViewer.lua:101 UnregisterAllEvents = defined @interface\AddOns\LibSharedMedia-3.0\CallbackHandler-1.0\CallbackHandler- @copilot |
This error originates in |
|
@copilot This error log finishes by "UnregisterAllEvents = defined @interface\AddOns\LibSharedMedia-3.0\CallbackHandler-1.0\CallbackHandler-" |
The log is simply truncated there — the WoW error viewer has a display length limit and cut off the full path |
The upstream LibSharedMedia-3.0 targets modern retail/Classic-rerelease WoW clients and contains several incompatibilities with the original 3.3.5a client: missing interface version, a runtime-crashing sound sentinel value, a missing WoW API in the bundled CallbackHandler, and references to textures/fonts that don't exist in 3.3.5a.
Changes
TOC (
LibSharedMedia-3.0.toc)30300to## Interface:— the WoW 3.3.5a client interface numberMINOR version
12000001→12000002— kept monotonically increasing relative to upstream so this build reliably takes precedence over any older embedded LSM copy loaded via LibStub, regardless of load orderCallbackHandler-1.0 (
CallbackHandler-1.0/CallbackHandler-1.0.lua)securecallfunctionis a retail WoW global that does not exist in the 3.3.5a client. Added a fallback that preserves CallbackHandler's error-isolation semantics usingxpcall/geterrorhandler, so callback errors are caught and routed to the WoW error handler rather than propagating and aborting dispatch of subsequent handlers:Sound "None" sentinel (
LibSharedMedia-3.0.lua)= 1→= [[Interface\Quiet.ogg]];PlaySoundFilein 3.3.5a is string-only — passing an integer throws a Lua error. Using a non-empty string sentinel ensuresFetchreturns a valid string value to consumers; since the file does not exist in the 3.3.5a client,PlaySoundFilesilently does nothing.Removed post-WotLK background textures
Blizzard Collections BackgroundBlizzard Garrison Background(×3)Blizzard Parchment 2Western-locale fonts
MORPHEUS_CYR.TTF→MORPHEUS.TTFSKURRI_CYR.TTF→SKURRI.TTFThe
_CYRvariants were introduced in post-WotLK patches; the 3.3.5a western client ships only the base versions.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.