From wiki.ginstr.com
Jump to: navigation, search
m (formatting)
m (Action signatures)
 
Line 23: Line 23:
 
|-
 
|-
 
| <code>actionIfTrue{n}</code>
 
| <code>actionIfTrue{n}</code>
| <div style="text-align: right;">'''optional'''</div>
+
| <div style="text-align: right; background-color: #e5e5e5; padding-right: 7px">'''optional'''</div>
 
[[:Category:Action_Library|Action]] or list of actions separated by <code>;</code> character, executed if <code>conditionAction{n}</code> returns <code>true</code>
 
[[:Category:Action_Library|Action]] or list of actions separated by <code>;</code> character, executed if <code>conditionAction{n}</code> returns <code>true</code>
 
|-
 
|-
 
| <code>actionIfFalse{n}</code>
 
| <code>actionIfFalse{n}</code>
| <div style="text-align: right;">'''optional'''</div>
+
| <div style="text-align: right; background-color: #e5e5e5; padding-right: 7px">'''optional'''</div>
 
[[:Category:Action_Library|Action]] or list of actions separated by <code>;</code> character, executed if <code>conditionAction{n}</code> returns <code>false</code>
 
[[:Category:Action_Library|Action]] or list of actions separated by <code>;</code> character, executed if <code>conditionAction{n}</code> returns <code>false</code>
 
|-
 
|-

Latest revision as of 14:04, 12 July 2017

gn:act_if

Description
Action that acts as a conditional action. It accepts other actions as conditions and other actions that are defined to execute if condition was true or if it was false.
If all conditions are true, action will execute true block of actions, if any condition is false, action will execute false block of actions.
Action returns
void

Action signatures

if action

[gn:act_if]|[conditionAction{n}--actionIfTrue{n}::actionIfFalse{n}]
Parameter Description
conditionAction{n} Action or list of actions separated by ** characters (** = AND condition)

All conditional actions must return boolean

actionIfTrue{n}
optional

Action or list of actions separated by ; character, executed if conditionAction{n} returns true

actionIfFalse{n}
optional

Action or list of actions separated by ; character, executed if conditionAction{n} returns false

Example

[gn:act_hasTableRights]|[bebraTimeRecordingemployee!=C] - conditional action
[gn:act_toast]|[@string/$noWriteRightsToast];[gn:act_break]|[] - executed if conditional action returns true
[gn:act_toast]|[@string/$successToast];[gn:act_break]|[] - executed if conditional action returns false
[gn:act_if]|[[gn:act_hasTableRights]|[bebraTimeRecordingemployee!=C]--[gn:act_toast]|[@string/$noWriteRightsToast];[gn:act_break]|[]::[gn:act_toast]|[@string/$successToast];[gn:act_break]|[]]