Originally Posted by syncrow
You're code re-creates your buttons constantly, which would cause massive error junk when you loot beacons right in combat....
It would be much better to pre-create all necessary buttons and only handle the count text upon bag updates.
Here is a little example on how it would look like:
Lua Code:
local buttonSize = 36 local padding = 0; local beacons = { -- rares [146923] = "", -- petrification [147355] = "", -- bloodstrike [146922] = "", -- fel growth [146915] = "", -- greater Torment [146912] = "", -- greater carnage [146914] = "", -- greater engineering [146910] = "", -- greater dominance [146913] = "", -- greater warbeasts [146911] = "", -- greater firestorm -- uncommons [146906] = "", -- carnage [146907] = "", -- warbeasts [146909] = "", -- torment [146908] = "", -- engineering [146903] = "", -- dominance [146905] = "", -- firestorm } ..... ....
The buttons in this example are static and do not hide / show themselves properly, but this is further secure wrapping....
PS: beacons are not stackable, as far as i'm aware
|
My first inclination was to create a table listing them all, but I chose to try this method as a sort of exercise as well as wanting to create them dynamically as found in the bags without knowing their specific names. This would future proof it if Blizzard decided to make a beacon of Murlocs, for example. There are also epic boss ones and epic ones that you take to each broken shore game
This isn't the entire code. I am not trying to show or hide them in combat, there is an inCombat check for a button that shows or hides them all that does nothing in combat.
They do indeed stack.
to 20 as per itemStackCount = GetItemInfo()
Thank you for taking the time. I appreciate it very much. Let me know if you have any ideas about creating them as a loop. Gah I really don;t want to make static tables for this ;/