Go to Page... |
Thread Tools | Display Modes |
04-06-17, 04:21 AM | #1 |
Roll the Bones addon for Rogue
Hi all,
I am currently trying to create Roll the Bones indicator for Outlaw Rogue and here is a draft for what I have done so far. (Pretty sure I made something similar to this before, but w/e...) Lua Code:
There are two things that I am unhappy with. 1. Structure of local functions, CheckPlayerSpec & UpdateRolltheBonesBuff 2. Their usage I don't know why, but they just don't feel right to me and both their structure and usage seems soooooooooooooooooooo awkward to me. Could I get some advice, please? Also, any recommendation or criticism are welcomed !! Thank you. |
|
04-06-17, 10:41 AM | #2 |
You don't have to do frame:SetScript("OnEvent", xxxxx) more than once. You set that Script once and whenever a event thats registered to that frame fires the function(xxxxx) gets called.
Lua Code:
Lua Code:
Another problem is that you use SetCooldown a lot. Maybe something like this would be better: Lua Code:
The whole code: Lua Code:
Last edited by pas06 : 04-06-17 at 10:49 AM. |
|
04-06-17, 04:28 PM | #3 |
Hi pas06,
Thank you for your reply. 1. For :SetScript("OnEvent", ...), I was trying to minimize the memory usage when it is not needed, but I definitely should have called RegisterUnitEvent, not RegisterEvent for UNIT_AURA 2. I also tried that approach for Roll the Bones id table, but the way you've done it will insert the rest of GetSpellInfo(193359) data into the table (like rank, icon, castingTime, minRange, maxRange, spellID) as well. 3. Same for UNIT_AURA function. I've tried a same approach and as you've guessed, there was a small taint which I really didn't like |
|
04-06-17, 04:41 PM | #4 |
Here's a fix for UpdateRolltheBonesBuff function.
Lua Code:
Currently it is working as I expected |
|
04-09-17, 03:47 AM | #5 |
Your function UpdateRolltheBonesBuff should be local.
|
|
04-09-17, 03:50 PM | #6 |
Yeap, it is declared as local on variables section (L#17) !!
|
|
WoWInterface » Developer Discussions » General Authoring Discussion » Roll the Bones addon for Rogue |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|