Nenue@6: Turok: Dinosaur HUD Nenue@6: Nenue@6: 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: Nenue@6: Project Goals: Nenue@6: Nenue@6: - Focus bar with dynamic coloring and prediction lines based on talent effects Nenue@6: - Unit cast bars that are thematically linked with everything else Nenue@6: - Dynamically arranged tracking icons and sliders cooldown/aura information Nenue@6: - Quality-of-life alerts for Lone Wolf and Aspect of the Pack Nenue@6: Nenue@6: Coding Conventions: Nenue@6: Nenue@6: Although AceAddon modules are used, the addon is not truly modular. Nenue@6: The structure provides simple control over the internal loading sequence. Nenue@6: So if needed, "module" enables can be scattered over several post-load frames to make in-combat /reload less hazardous. Nenue@6: Nenue@6: SavedVars data is arranged in a non-propagating hierarchical metatable. Nenue@6: Accessing a deeply-nested member will traverse its parents until one of them contains data. Nenue@6: The only exception to this is on lazy read expressions, such as: Nenue@6: Nenue@6: > if (childtable.unsetvar) then Nenue@6: Nenue@6: This will always yield a false, whether or not a value is assigned in its parents. Nenue@6: To check for hierarchical flag variables, you can compare the index against nil, like so: Nenue@6: Nenue@6: > if (childtable.unsetvar ~= nil) then Nenue@6: Nenue@6: The operation will trigger __index and a value from the hierarchy will be presented. Nenue@6: Any positive flag state will be copied down when direct assignment is used. Nenue@6: To get a useful flag state, you need to run the first logical expression within a ternary idiom: Nenue@6: Nenue@6: > childflag = (childtable.unsetvar) and true or nil -- pulls the true flag value Nenue@6: > parentflag = childtable.unsetvar -- pulls any non-nil value Nenue@6: Nenue@6: Another thing to note is hierarchical values are not assigned downstream. Nenue@6: If an empty child value is indexed, it will always traverse up the tree. Nenue@6: As a result, values consulted frequently will be computationally taxing. Nenue@6: These should be copied into a local variable and read from that instead. Nenue@6: Then, when an event that might change the value is detected, the local variable is updated instead. Nenue@6: From a performance standpoint, the effects are net-positive, since assignments potentially cover dozens of keys. Nenue@6: The memory footprint also isn't much different, while the assignment operations are carried out in spaced intervals.