Mysterious Lua error regarding the StorePurchaseAlertFrame and Bonus Rolls (?)
rdw-software opened this issue ยท 5 comments
Source: WowAce
1x Rarity\Core.lua:4079: attempt to index global 'StorePurchaseAlertFrame' (a nil value)
Needs more info.
Does the following still exist in Blizzard's FrameXML?
- StorePurchaseAlertFrame: NOPE
- StorePurchaseAlertFrame_ShowAlert: NOPE
- BonusRollFrame_StartBonusRoll: YES
- BONUS_ROLL_REQUIRED_CURRENCY: YES
- BLIZZARD_STORE_PURCHASE_COMPLETE_DESC: YES
I see a comment in the code stating that this is seemingly broken, but I can't tell if Blizzard just removed it or if this could be fixed.
Potentially now reproducible: https://www.wowace.com/projects/rarity/issues/436
Looks like the StorePurchaseAlertFrame_ShowAlert
functionality was replaced at some point (source: unknown, with a different (setup-based) system and eventually removed (there's nothing of this name in FrameXML now).
Rarity apparently used this to display the item that could be bonus rolled using Blizzard's shop confirmation dialog frames... which is awkward to say the least.
It seems Blizzard replaced the shop with a browser-based dialog that isn't really accessible to Lua (it only says GlobalFXDialogModelScene
and you can't select any of the individual parts using /framestack
or /tinspect
). It then clearly opens the BattleNet website in a non-frame dialog if you do attempt to purchase anything.
All things considered, the purpose of informing the user that an item can be bonus rolled may also be achieved by simply printing a message in the default chat window if they have bonus roll items... so for simplicity's sake I'll do just that.
Edit: It might also be worth adding an option to disable this, as people might find their chat being spammed annoyed?
There actually appears to be another issue: The order of execution is
- Attempt is added for the eligible item
BonusRollFrame
is opened and the secure hook called- Rarity cached the last item if it's eligible for a bonus roll attempt
Due to the asynchronous nature and reliance on first caching the item before displaying the notice, it's unlikely this can work now, and possibly never worked correctly in the first place?
In fact, considering how little value (if any) the message provides and how much time I already spent just investigating this error, it's probably best to just remove the broken code entirely and leave it at that.
Removed in 9e44e13. If there ever is a need for displaying this information again, a better solution will have to be found.