Nenue@6
|
1 Turok: Dinosaur HUD
|
Nenue@6
|
2
|
Nenue@6
|
3 Hardcode of various WeakAura configurations. This is created as a personal learning challenge, so it may or may not be faster than the actual jumble of WeakAuras because that addon is written very well.
|
Nenue@6
|
4
|
Nenue@6
|
5 Project Goals:
|
Nenue@6
|
6
|
Nenue@6
|
7 - Focus bar with dynamic coloring and prediction lines based on talent effects
|
Nenue@6
|
8 - Unit cast bars that are thematically linked with everything else
|
Nenue@6
|
9 - Dynamically arranged tracking icons and sliders cooldown/aura information
|
Nenue@6
|
10 - Quality-of-life alerts for Lone Wolf and Aspect of the Pack
|
Nenue@6
|
11
|
Nenue@6
|
12 Coding Conventions:
|
Nenue@6
|
13
|
Nenue@6
|
14 Although AceAddon modules are used, the addon is not truly modular.
|
Nenue@6
|
15 The structure provides simple control over the internal loading sequence.
|
Nenue@6
|
16 So if needed, "module" enables can be scattered over several post-load frames to make in-combat /reload less hazardous.
|
Nenue@6
|
17
|
Nenue@6
|
18 SavedVars data is arranged in a non-propagating hierarchical metatable.
|
Nenue@6
|
19 Accessing a deeply-nested member will traverse its parents until one of them contains data.
|
Nenue@6
|
20 The only exception to this is on lazy read expressions, such as:
|
Nenue@6
|
21
|
Nenue@6
|
22 > if (childtable.unsetvar) then
|
Nenue@6
|
23
|
Nenue@6
|
24 This will always yield a false, whether or not a value is assigned in its parents.
|
Nenue@6
|
25 To check for hierarchical flag variables, you can compare the index against nil, like so:
|
Nenue@6
|
26
|
Nenue@6
|
27 > if (childtable.unsetvar ~= nil) then
|
Nenue@6
|
28
|
Nenue@6
|
29 The operation will trigger __index and a value from the hierarchy will be presented.
|
Nenue@6
|
30 Any positive flag state will be copied down when direct assignment is used.
|
Nenue@6
|
31 To get a useful flag state, you need to run the first logical expression within a ternary idiom:
|
Nenue@6
|
32
|
Nenue@6
|
33 > childflag = (childtable.unsetvar) and true or nil -- pulls the true flag value
|
Nenue@6
|
34 > parentflag = childtable.unsetvar -- pulls any non-nil value
|
Nenue@6
|
35
|
Nenue@6
|
36 Another thing to note is hierarchical values are not assigned downstream.
|
Nenue@6
|
37 If an empty child value is indexed, it will always traverse up the tree.
|
Nenue@6
|
38 As a result, values consulted frequently will be computationally taxing.
|
Nenue@6
|
39 These should be copied into a local variable and read from that instead.
|
Nenue@6
|
40 Then, when an event that might change the value is detected, the local variable is updated instead.
|
Nenue@6
|
41 From a performance standpoint, the effects are net-positive, since assignments potentially cover dozens of keys.
|
Nenue@6
|
42 The memory footprint also isn't much different, while the assignment operations are carried out in spaced intervals. |