View Single Post
08-18-12, 06:10 PM   #94
Meorawr
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 193
I got a basic implementation of a time frame for displays done. At the moment you can set an onset (a delay before it shows) and a duration (the time period for which it shows).

If the onset is 0, there's no delay, and if the duration is 0 then the display will hide when the criteria are no longer met - so you can use either of the features without needing both of them. If both values are zero, you get the current behaviour with no code changes (the implementation is really messy).

A small implementation detail, the rate at which these are processed is limited by your Update Speed setting. If it's too low, you'll notice minor delays in when the displays should show/hide.

In addition I've currently got advanced features which change how these behave. No guarantees these will all survive, but in basic testing they're all working perfectly:
  • Rolling Onset: If the display is deactivated and subsequently reactivated before the onset duration from the initial activation has been exceeded, then the current progress won't be reset. For example, if the onset is set to 5 seconds, and after 2.5 seconds a display is deactivated and reactivated, there'll still be 2.5 seconds left on the initial onset. Turning it off will reset the progress to 0, making it wait a full 5 seconds again. Defaults to true (on).
  • Immortal Onset: If set to true, the display cannot be killed during its onset. By default what happens is if a display's activation criteria are no longer met at the end of its onset, then it won't show. Turning this on will make it immortal, so it'll ignore the state and display for its full duration. This won't have any effect if the duration is set to 0, and the immortality does not affect the display when in the duration phase. Defaults to false (off).
  • Override: If the current active sequence changes and this is set to true, the onset and duration will be replaced by the ones set in this sequence. So for example, say sequence #2 activates with a duration of 5 seconds, and then 2 seconds in sequence #1 is activated with a duration of 7 seconds. If override is true on the sequence #1, the duration becomes 7 seconds. If it's false, then it remains at 5 seconds. This affects the onset, durations and immortality settings - however if a display is currently in the 'show' state and the onset is extended to a duration that should otherwise make the display hide, it won't have any effect. For example, if the display is showing for 7 seconds (duration phase) and a sequence activates with a 20 minute onset, then the display won't hide as it's already passed the onset phase.
  • Rolling Duration: If the display deactivates and subsequently reactivates while inside of its duration phase, then the progress will be altered in a specific way based upon the setting. If 0, the progress will not be touched (so if it has a duration of 15 seconds, and it's scheduled to hide in 5 seconds, it'll hide in 5 seconds). If 1, the progress will be reset to 0 (so in the previous example, it'd show for another 15 seconds). If 2, the time for which it'll be shown is extended by the duration (so it'd show for another 20 seconds, factoring in the 5 that currently remain). There's no cap in the last case, but I included it on the off chance it becomes useful. The default setting is 1, so it'll extend to an amount equal to the duration.

Due to how this is implemented, it's highly unlikely that there'll be a way to use the duration information for timers/bars/triggers and whatnot however. This might change at a later date.

Last edited by Meorawr : 08-18-12 at 06:17 PM.