Class: ModalFormData
Beta
Used to create a fully customizable pop-up form for a player. 用于为玩家创建完全可自定义的弹出表单。
Example
showBasicModalForm.ts
Constructors
Constructor
new ModalFormData():
ModalFormData
Beta
Returns
ModalFormData
Methods
divider()
divider():
ModalFormData
Beta
Returns
ModalFormData
Remarks
Adds a section divider to the form. 向表单添加一个分隔线。
dropdown()
dropdown(
label,items,dropdownOptions?):ModalFormData
Beta
Parameters
label
any
The label to display for the dropdown. 下拉菜单显示的标签。
items
any[]
The selectable items for the dropdown. 下拉菜单的可选项目。
dropdownOptions?
The optional additional values for the dropdown creation. 创建下拉菜单时可选的附加参数。
Returns
ModalFormData
Remarks
Adds a dropdown with choices to the form. 向表单添加一个包含选项的下拉菜单。
header()
header(
text):ModalFormData
Beta
Parameters
text
any
Text to display. 要显示的文本。
Returns
ModalFormData
Remarks
Adds a header to the form. 向表单添加一个标题。
label()
label(
text):ModalFormData
Beta
Parameters
text
any
Text to display. 要显示的文本。
Returns
ModalFormData
Remarks
Adds a label to the form. 向表单添加一个标签。
show()
show(
player):Promise<ModalFormResponse>
World Mutation Beta
Parameters
player
Player
Player to show this dialog to. 要显示此对话框的玩家。
Returns
Promise<ModalFormResponse>
Remarks
Creates and shows this modal popup form. Returns asynchronously when the player confirms or cancels the dialog. 创建并显示此模态弹出表单。当玩家确认或取消对话框时异步返回。
Throws
This function can throw errors.
slider()
slider(
label,minimumValue,maximumValue,sliderOptions?):ModalFormData
Beta
Parameters
label
any
The label to display for the slider. 滑块显示的标签。
minimumValue
number
The minimum selectable possible value. 可选择的最小值。
maximumValue
number
The maximum selectable possible value. 可选择的最大值。
sliderOptions?
The optional additional values for the slider creation. 创建滑块时可选的附加参数。
Returns
ModalFormData
Remarks
Adds a numeric slider to the form. 向表单添加一个数值滑块。
submitButton()
submitButton(
submitButtonText):ModalFormData
Beta
Parameters
submitButtonText
any
Returns
ModalFormData
textField()
textField(
label,placeholderText,textFieldOptions?):ModalFormData
Beta
Parameters
label
any
The label to display for the textfield. 文本字段显示的标签。
placeholderText
any
The place holder text to display. 要显示的占位文本。
textFieldOptions?
The optional additional values for the textfield creation. 创建文本字段时可选的附加参数。
Returns
ModalFormData
Remarks
Adds a textbox to the form. 向表单添加一个文本框。
title()
title(
titleText):ModalFormData
Beta
Parameters
titleText
any
Returns
ModalFormData
Remarks
This builder method sets the title for the modal dialog. 此构建器方法设置模态对话框的标题。
toggle()
toggle(
label,toggleOptions?):ModalFormData
Beta
Parameters
label
any
The label to display for the toggle. 开关显示的标签。
toggleOptions?
The optional additional values for the toggle creation. 创建开关时可选的附加参数。
Returns
ModalFormData
Remarks
Adds a toggle checkbox button to the form. 向表单添加一个开关复选框按钮。
