There are many addons that do this, but this one is mine. I cringed at how complex everyone else's code was compared to how simple the solution is. The challenge was to write an addon to get the job done better and more efficiently. Just how I like it.
As with the others, this addon was designed to block the obtrusive market announcement dialog that occasionally pops up when you log in. If you ever wish to view it on your own terms, it's still available in the game menu.
1.1
- Sacrificed a little simplicity for more vigilant code
- Fixes issue with the market announcement popping up if there's a store update while logged in
- Check for execution from the game menu is baked into the now single callback function
could we have an option (even a command line option or ini setting) that we can toggle on/off for it to display the AdVert only once the first time the account logs wihtin a 24 hour period?
I'll think about it. I already have a few ideas I'd want to look at if I were to tweak its behavior.
Love it! Love it!! Love it!!! - With that said, could we have an option (even a command line option or ini setting) that we can toggle on/off for it to display the AdVert only once the first time the account logs wihtin a 24 hour period?
I know it's a simple request, but a big programming challenge by comparison. I can understand and appreciate how clean this already is and that would feature would add all sorts of fun little new functions.
Either way, I love it and thank you for taking the time to create this. I'll just have to remember to look for myself for now unless you add the feature.
The code got a little more simplified, yet at the same time, a little more complex. I observed a rare issue where a store update was pushed while I was playing and caused the popup to show mid-session. I rewrote this addon using a scene state handler instead of a run-once callback.
The callback allowed this addon to virtually take up no memory as it would run on login, then effectively be unloaded by the API used. While the state handler always exists now, it's only one function, and a few tricks I developed digging around the SCENE_MANAGER code allowed me to simplify detecting execution from the game menu.
Edit: A last-minute update. Apparently, hooking the scene directly for a state change causes timing issues with canceling the transition animation. This doesn't appear to be the case hooking the same "event" from SCENE_MANAGER where the previously-used SCENE_MANAGER:CallWhen() triggered from. While the function will run more, at least working is better than breaking the UI.
Basically. HLA also has a bug where it procs the first time you try to open the announcement from the game menu after a /reloadui. Without that fix, my code would be a single line.
Anyway, it ties into existing API to hook the necessary scenes instead of writing event and scene state handlers.