Post by digitalutopia1
Love them or hate them, the popularity of smartphones have made QR Codes show up nearly everywhere. These square, pixelated codes have become quite a common sight - allowing people to easily scan them with their mobile device, and navigate to the appropriate URL.
So, one day while I was playing, and as is common, looking up something on wowhead on my second monitor, two things came to mind:
1) I'm pretty sure that most people don't have a multi-monitor setup, and even if they play in Windowed (Full screen), there's still the time to switch between their browser and WoW to look up information.
2) Surely, I can't be the only one who keeps their phone within reach while playing- especially considering the existence of the mobile authenticator.
I started thinking: What if you could generate a QR Code from in-game information, containing the appropriate wowhead, or even armory URL, to quickly look it up on your phone, without switching through apps, or having to type everything in?
So, after finding a code sample that would generate QR information in Lua, that's exactly what I did.
Now, if this idea seems interesting to you - please feel free to check it out here.
On the other hand, if you think this is the dumbest idea you've ever heard of...well, it certainly isn't the first time I had a bad idea that seemed fun at the time :p
Post by pelf
Yeah, that reminds me of a phone wallpaper site I was visiting, once. They had QR codes that contained the direct image link on every image's page so you could scan it with your phone and get right to the image.
It is a good idea.
For bonus points, brand the QR codes with a name or logo you choose.
Post by digitalutopia1
You're creating many new frames every time a new QR code is shown. This is a memory leak. Frames cannot be deleted. You should be creating your frames up-front, and then re-using them (by re-arranging, re-coloring, etc) them each time you display a new QR code.
It's also redundant to have so many Frame objects, when you can simply create several Texture objects and parent them all to the viewFrame.
Edit: You're recreating the viewFrame over and over also.
Thanks for the critique - I'm still getting the hang of how WoW deals with the visual elements. That being said, even what I've learned so far, I noticed there were some really ugly things going on. :p
There's an update waiting for approval on Curse, which addresses the excessive, redundant frames down to 2 (root frame and viewFrame) - with most of it being moved to the layout xml, instead of the code.
In addition, QR generation will now reuse the same frames on each generation. Using a combination of point setting and Alpha to "turn" frames on/off as needed.