Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
Condition Flags
Condition Flags are new elements you can use in the Theme Editor for more powerful control flow of your theme. Condition flags allow you to keep track of the state of your theme, and allow you to block execution of actions when the current state of the theme should not allow it.

For example: you can use a condition flag to track if a Widget is visible, and then only allow the "Show" action if the widget is currently invisible. If the widget is already visible, the action will not execute. This is especially useful to prevent animations from running when they should not.

You can add Condition Flag items to your theme and choose to display them on you Control screen. If you do, they will show as a checkbox. You can also hide them by unchecking the "Show on controls" property.


Setting or unsetting a condition flag
Condition flag states can be either "set" (checked) or "unset" (unchecked). You can control the state of a condition flag by using the ChangeConditionFlag action, by using either the Set, Unset or Toggle effects.

If desired, you can also allow manual toggling of the condition flag by enabling the "Allow editing" property. If the condition flag item is visible on your controls screen, then you can manually toggle it by clicking on it.


Conditional action execution
To make use of the condition flags to control your theme logic flow, you can use the new Condition column in any Actions list. For each Action to execute, you can use the Condition dropdown to select the condition which must be met for the action to execute. The State checkbox next to the Condition dropdown controls whether the condition must be set (checked) or unset (unchecked) for the action to execute.

For example, this screenshot shows an action that will only be executed if the condition flag "C_VTicker" is NOT set. If the C_VTicker condition is set (checked), the action will not execute:




Syncing Buttons to a condition flags
To more easily visualize the state of a condition flag you can synchronize a button to a condition flag. Sync the button by selecting the condition flag from the dropdown in the button's Condition Flag property. When a button is synced to a condition flag, it will use the "Activated" display properties when the condition flag is set (and the regular display properties when unset). You can change the appearance of the button via the new Activated properties such as Activated Background color, Activated Font color, etc.




Reacting to condition flag state changes
A condition flag can execute its own list of actions whenever the state changes. Simply open the condition flag editor by doubleclicking in the theme explorer, or via the Actions property.