Since GetFunctionCPUUsage was removed in 10.1.0 the entire profler
stopped working. This has been replaced by wrapping the functions in a
closure that runs GetTimePreciseSec before and after and keeps track of
the total runtime per function.
This fix ensures that name truncation always happens on codepoint
boundaries and that a name has exactly 5 visible codepoints. This should
cover all possible cases unless names can have grapheme clusters, afaik
this is not the case.
If the field color is supplied from trigger data, these indicators will
now change their color. Currently this change is permanent and not bound to the
trigger.
Trigger now has a new method Trigger:SetData and two new fields
Trigger.defaultData and Trigger.data
Whenever SetData is used it ensures that all the keys and values from
defaultData are present in the new data.
The data argument from Trigger:SetState has been removed and it will now
always use the Trigger.Data field for notifying indicators
MultiTrigger will pass on the data from the highest priority child
trigger.
Fix MultiTrigger
MultiTrigger didn't properly inherit from Trigger and reimplemented some
methods. This happened because it started out as a copy of Trigger
- The indicator will grab a frame from a pool
- Having a frame, it now uses a real border/edge
- There is a stacks number that can optionally be enabled
StatusTrigger will trigger if a status activates (or reaches a certain
activation # of auras). This is an abstraction provided by AuraList
which keeps track of which auras belong to which statuses.
Added type annotations to all touched files
The base Trigger class is now responsible for inverting the trigger
state and also for signaling trigger activation to the target/indicator.
In addition the following non-function changes also occured:
- The triggers moved into their own directory
- The trigger code has been annotated to help lua-language-server
deduce type information
- AuraTrigger was moved into its own file
All these changes should make future development of other triggers easier