ResourceArray
This view allows you to display (and potentially edit) an array of resources
JSON Format
{
"type": "resourceArray",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"resource_id": ...,
"stat": ...,
"left_view": ...,
"pop_up_type": ...,
"pop_up_button_text": ...,
"view_type": ...,
"hide_line": ...,
"auto_add_first": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | String | ✓ | A unique identifier for the view. You can use it to reference view values in stat formulas by doing $view.view_id (where view_id is the id that was assigned to this view by you in the system definition) |
type | RPGViewType | ✓ | The type of this view. Note that these are all in camelCase. |
margin_left | double | Optional. How much margin to add to the left of this view. | |
margin_right | double | Optional. How much margin to add to the right of this view. | |
margin_top | double | Optional. How much margin to add to the top of this view. | |
margin_bottom | double | Optional. How much margin to add to the bottom of this view. | |
is_visible | StatFormulaComponent | Optional. A formula to specify if the view should be visible or not. Must return a bool. | |
validation_message | StatFormulaComponent | Optional. If this view is an input, you can define this formula to return a message when the input value is invalid. If the input is valid, you should return null. Otherwise, make the formula return the string that should be shown to the user. | |
resource_id | String | ✓ | The resource id for the type of resources being displayed (ie: the one defined in your resource within the system file). |
stat | String | ✓ | The path to the stat that contains the resource instances to display. This path can use the syntax for paths defined in the GetStat stat formula. The stat has to be an array of resources. If you want to display a single resource, please see Resource view. |
left_view | RPGView | Optional. Defaults to nothing. An RPGView to display at the top-left of the array, next to the "add resource" button (if edit view_type) | |
pop_up_type | ResourceArrayRPGViewPopUpTypes | Optional. Defaults to none (ie: the resources appropriate views will display inline and now pop-up will be used). This property allows you to define (in the case you want the app to display pop-up buttons to edit the resources) the type of pop-up that should be used. This only works for the edit view_type. | |
pop_up_button_text | StatFormulaComponent | Optional. Defaults to none (see pop_up_type). This property should be specified if pop_up_type is. The formula for the text to use in the button texts. This formula will have direct access to the resource instance that is being displayed (ie: the stats accessible from it will be that of the resource specified in resource_id). | |
view_type | ResourceViewTypes | ✓ | The type of view to display for each resource instance. Choosing edit will allow the user to add and remove resource instances from the array. |
hide_line | bool | Optional. Defaults to false. Whether to hide the line on the left side of the screen that showcases the extent of the array's resources. | |
auto_add_first | bool | Optional. Defaults. to false. Whether a resource should automatically be added for the user if the array is empty. This is useful for fields that are required to have at least one entry. |