Skip to content

Fix ItemRack failing to load and set hotkeys on current Classic Era - #318

Open
JSchott3 wants to merge 1 commit into
Rottenbeer:masterfrom
JSchott3:fix/classic-era-addon-api-and-keybinds
Open

Fix ItemRack failing to load and set hotkeys on current Classic Era#318
JSchott3 wants to merge 1 commit into
Rottenbeer:masterfrom
JSchott3:fix/classic-era-addon-api-and-keybinds

Conversation

@JSchott3

Copy link
Copy Markdown

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/IsAddOnLoaded were removed as globals in favour of C_AddOns.*. ItemRack.lua's very first executable line called GetAddOnMetadata unconditionally, so the whole file errored out immediately on load (attempt to call a nil value) and nothing in the addon ever initialized.
  • SetSetBindings() required GetCurrentBindingSet()'s return value to also be present in Enum.BindingSet before calling SetBindingClick. 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.
  • The per-set hotkey macro mixed an insecure /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 a PostClick handler (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

  • Fresh login with the patched addon: no load errors, buttons appear and can be added via Alt+Click as before
  • Set a gear-set hotkey (F1-F6), confirmed it shows in Key Bindings and GetBindingAction reflects it
  • Pressed the hotkey in and out of combat, confirmed the gear set actually equips

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant