-
Notifications
You must be signed in to change notification settings - Fork 0
development responses
Responses represent the actions that the player can perform to transition from one InputRequest to another (or the same in certain circumstances).
Sample
Response::with('Choice 1', 'sample_02a')
This is a very basic response with text to display the choice and a destination InputRequest. Responses are always used as part of an InputRequest.
Adjusments performed when the response is selected (and before transitioning to the next InputRequest).
Responses support a number of different configurations for Conditions and the resulting state (ResponseState) of the Response. The state of the Response determines how and if it is displayed.
This response will be displayed and may be selected.
This response will be displayed and cannot be selected.
This response will not be displayed.
There are six methods that allow conditions to be specified. They are divided into two groups.
If any of the specified conditions pass the resulting state will be returned.
setHiddenOnAnyConditions
setDisabledOnAnyConditions
setEnabledOnAnyConditions
If all of the specified conditions pass the resulting state will be returned.
setHiddenOnAllConditions
setDisabledOnAllConditions
setEnabledOnAllConditions
If a state check fails it will fall through in this order. If a check passes the resulting state is returned immediately.
HiddenOnAllConditions
HiddenOnAnyConditions
DisabledOnAllConditions
DisabledOnAnyConditions
EnabledOnAllConditions
EnabledOnAnyConditions
To allow for extensive control over the condition logic each response can have its own custom default state (if all condition checks fail). By default the returned state is Enabled.
Sample
$response->setDefaultState(ResponseState::Disabled);