vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | TheoryCraft's Button Text feature currently only supports the default Blizzard Action Bars, and spell book. |
2 | I think everything is in place for Flexbar users to be able to add TheoryCraft values to their Action Button |
||
3 | text though. If not, leave a message on http://www.curse-gaming.com/mod.php?addid=3031. |
||
4 | |||
5 | To be able to get data from TC, just call (in order of speed): |
||
6 | TheoryCraft_GetSpellDataByFrame(tooltip) |
||
7 | TheoryCraft_GetSpellDataByName(spellname, spellrank) |
||
8 | TheoryCraft_GetSpellDataByDescription(description) |
||
9 | |||
10 | If there is data for the spell, it will be returned. If not it'll generate it |
||
11 | (if possible), and save it so that future accesses are quick (until the array needs to be reset, eg on |
||
12 | equipping more spell damage gear). The following is an example to get the minimum damage done by a spell: |
||
13 | |||
14 | local spelldata = TheoryCraft_GetSpellDataByName("Immolate", 5) |
||
15 | Print(spelldata.mindamage) |
||
16 | |||
17 | These are all formatted as is on the tooltip, so DPS will be to 1 decimal place, and maxoom will have a "k" |
||
18 | on the end, already divided by 1000. |
||
19 | |||
20 | Please Note that TheoryCraft_GetSpellDataByDescription is extremely slow at generating data if it's not already |
||
21 | present in the array, as it has to generate tooltips for every single spell in your spellbook and compare them |
||
22 | to the description given. I do not expect this function to be used much. |
||
23 | |||
24 | The following are accessible (or nil, depending on the spell) |
||
25 | |||
26 | description |
||
27 | mindamage |
||
28 | maxdamage |
||
29 | critdmgchance |
||
30 | critdmgmin |
||
31 | critdmgmax |
||
32 | critdmgminminusignite |
||
33 | critdmgmaxminusignite |
||
34 | averagedamnocrit |
||
35 | averagedam |
||
36 | manacost (true mana cost, includes regen) |
||
37 | basemanacost |
||
38 | dpm |
||
39 | withdotdpm |
||
40 | dps |
||
41 | withdotdps |
||
42 | maxoomdam |
||
43 | maxevocoomdam |
||
44 | sealunbuffed |
||
45 | sealbuffed |
||
46 | nextagidam |
||
47 | nextcritdam |
||
48 | nexthitdam |
||
49 | nextpendam |
||
50 | nextagidps (hunter's autoshoot only) |
||
51 | nextcritdps (hunter's autoshoot only) |
||
52 | nexthitdps (hunter's autoshoot only) |
||
53 | nextagidamequive |
||
54 | nextcritdamequive |
||
55 | nexthitdamequive |
||
56 | nextpendamequive |
||
57 | nextagidpsequive (hunter's autoshoot only) |
||
58 | nextcritdpsequive (hunter's autoshoot only) |
||
59 | nexthitdpsequive (hunter's autoshoot only) |
||
60 | rotationdps |
||
61 | regendam |
||
62 | icregendam |
||
63 | damcoef |
||
64 | damcoef2 (dot coef) |
||
65 | plusdam |
||
66 | finaldam |
||
67 | dameff |
||
68 | penetration |
||
69 | dpsafterresists |
||
70 | lifetapdps |
||
71 | lifetapdpm |
||
72 | showonbutton (if a tooltip is generated due to mouseover, but it is not supposed to be shown on buttons, this |
||
73 | will be false) |
||
74 | |||
75 | And all of the above with dam/dmg replaced by heal, eg minheal, maxheal, hpm |
||
76 | |||
77 | When any of the above values change, or action bars change, TC will also reset |
||
78 | TheoryCraft_UpdatedButtons to a blank table. |
||
79 | |||
80 | So the easiest way to keep for example button text updated without having to hook in to half a dozen events, |
||
81 | is to update it on the OnUpdate() event (which is called every single frame), update your text, and then set |
||
82 | TheoryCraft_UpdatedButtons[Unique Identifier] to true. If the unique identifier is set when you enter OnUpdate, |
||
83 | do nothing. TC will reset TheoryCraft_UpdatedButtons when a repaint is needed. |
||
84 | |||
85 | You shouldn't need to regenerate the data, but if so call TheoryCraft_GenerateAll(). |
||
86 | |||
87 | Other global functions include :- |
||
88 | |||
89 | TheoryCraft_UpdateTalents(genall) |
||
90 | TheoryCraft_UpdateGear(target, genall) If target ~= "player", will do nothing |
||
91 | TheoryCraft_UpdateBuffs(target, genall) |
||
92 | TheoryCraft_LoadStats() |
||
93 | |||
94 | If genall is true on any of the above, then TheoryCraft_LoadStats() and TheoryCraft_GenerateAll() will not be called |
||
95 | even if they need to be. Normally these will only be called if an array changes, however you may wish to call |
||
96 | UpdateGear, and UpdateBuffs without wanting each to call GenerateAll(), so in that case you would pass genall as |
||
97 | true in both cases. If genall is false they'll call LoadStats as well, and call GenerateAll() automatically if |
||
98 | either the stats array or the buffs/gear array changes. |
||
99 | |||
100 | Finally there is a global function called TheoryCraft_AddToCustom(linkid). Just pass this one an item link and it'll |
||
101 | add it to the custom outfit. |
||
102 | |||
103 | If you need anymore help/info or any modifications just contact me on curse :). |
||
104 | |||
105 | - Aelian |