Fix ItemRack failing to load and set hotkeys on current Classic Era - #318
Open
JSchott3 wants to merge 1 commit into
Open
Fix ItemRack failing to load and set hotkeys on current Classic Era#318JSchott3 wants to merge 1 commit into
JSchott3 wants to merge 1 commit into
Conversation
Three issues surfaced after a recent Classic Era client update: 1. GetAddOnMetadata/LoadAddOn/EnableAddOn/DisableAddOn/IsAddOnLoaded were removed as globals in favour of C_AddOns.*. The very first line of ItemRack.lua called GetAddOnMetadata unconditionally, so the whole file errored out immediately on load and nothing in the addon ever initialized (no buttons, no bindings, nothing). 2. SetSetBindings() gated on GetCurrentBindingSet()'s result also being present in Enum.BindingSet before it would call SetBindingClick. That membership check never passes on Classic Era, so it silently retried a few times and gave up without ever binding any hotkeys. 3. The per-set hotkey macro mixed an insecure "/script ...RunSetBinding" line with protected "/equipslot [combat]" commands in the same macro body. That combination gets silently vetoed, so even once bindings were registered, pressing the key did nothing. Moved the Lua call to a PostClick handler (matching how the rest of the addon already handles its other buttons) and left only the protected commands in the macro itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three issues traced to recent Classic Era client changes that together left ItemRack completely non-functional (no buttons, no bindings) or with hotkeys registered but not firing:
GetAddOnMetadata/LoadAddOn/EnableAddOn/DisableAddOn/IsAddOnLoadedwere removed as globals in favour ofC_AddOns.*.ItemRack.lua's very first executable line calledGetAddOnMetadataunconditionally, so the whole file errored out immediately on load (attempt to call a nil value) and nothing in the addon ever initialized.SetSetBindings()requiredGetCurrentBindingSet()'s return value to also be present inEnum.BindingSetbefore callingSetBindingClick. That membership check never passes on current Classic Era, so it silently retried a few times and gave up without ever binding any set hotkeys./script ItemRack.RunSetBinding(...)line with protected/equipslot [combat]...commands in the same macro body. That combination is silently vetoed, so even once a binding was registered and visible in the Key Bindings UI, pressing the key did nothing. Moved the Lua call to aPostClickhandler (the same pattern the addon's other buttons already use) and left only the protected commands in the macro text.All three were verified against a live 1.15.9 (interface 11509) Classic Era client — reproduced each failure, confirmed the fix resolves it, and confirmed gear-set hotkeys work end-to-end afterward (registration, live binding, and actual keypress).
Test plan
GetBindingActionreflects it