ShowPopUp
This effect allows you to display a pop up to the user in the form of an alert or a bottom sheet. An alert displays as a floating pop up, and the bottom sheet is presented from the bottom of the screen much like resources do in the app.
JSON Format
{
"type": "showPopUp",
"pop_up_view": ...,
"pop_up_title": ...,
"pop_up_type": ...,
"display_cancel_button": ...,
"cancel_text": ...,
"display_save_button": ...,
"save_text": ...,
"should_persist_on_save": ...,
"extra_buttons": ...,
"in_edit_mode": ...,
"dismissible": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
pop_up_view | RPGView | ✓ | The RPGView to be displayed as content for the pop up. |
pop_up_title | StatFormulaComponent | ✓ | The title for the pop up. This stat formula must compute to a string. |
pop_up_type | PopUpType | ✓ | Optional. The type for the pop up. If not specified, it will default to bottom sheet. |
display_cancel_button | bool | ✓ | Optional. Defaults to true. Whether to display a cancel button or not. |
cancel_text | StatFormulaComponent | Optional. Defaults to a stat formula that returns "Cancel". A stat formula returning a string to display as text in the cancel button. | |
display_save_button | bool | ✓ | Optional. Defaults to false. Whether to display a save button or not. If this is false but a save_text is provided, the text will override this value and the save button will display. |
save_text | StatFormulaComponent | Optional. Defaults to a stat formula that returns "Save". A stat formula returning a string to display as text in the save button. | |
should_persist_on_save | bool | ✓ | Optional. Defaults to false. Whether or not the given resource should be persisted (saved in the database) upon saving. You would want to set this to true if you are editing a first-level resource. However, if you are editing (for example) a resource within a resource within the character (e.g: an effect, which is in an item, which is in the items stat in the character), you would want to set it as false, as you would want to allow the user to finish editing the whole resource before saving (as they might regret their choices and choose to exit without saving to discard their changes). |
extra_buttons | List<RPGViewBottomSheetExtraButton> | Optional. This allows you to specify an array of buttons to display at the bottom of the pop up. | |
in_edit_mode | bool | Optional. Defaults to false. If the alert should be in edit mode by default. This might be particularly helpful if you are using it to display Stat RPGViews and want to allow the user to edit them. | |
dismissible | bool | Optional. Indicates if the alert should be dismissible by tapping outside of it. If not provided, it will default to dismissible if there is no save button nor save button text specified, and it will default to non-dismissible if there is to prevent the user from accidentally dismissing a sheet in which they were working. |