Skip to content

Commit 26a60e9

Browse files
committed
docs: fix form format
1 parent 4532afc commit 26a60e9

File tree

2 files changed

+44
-41
lines changed

2 files changed

+44
-41
lines changed

docs/apis/GuiAPI/Form.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ A modal form contains a title, a text display, and two buttons.
3131
- If the return value is `Null`, it means the sending failed.
3232

3333
Parameter `callback` The callback function prototype: `function(player,result,reason)`
34+
3435
- player : `Player`
35-
The player object that interacts with the form.
36+
The player object that interacts with the form.
3637
- result : `Boolean`
37-
Player clicks **Confirm** button is `true`, **Cancel** button is `false`.
38-
If the id is `Null`, the player cancels the form.
39-
- reason : `Integer`
40-
The reason why the form is closed.
41-
0 = UserClosed, 1 = UserBusy
42-
The reason may be `null`.
38+
Player clicks **Confirm** button is `true`, **Cancel** button is `false`.
39+
If the id is `Null`, the player cancels the form.
40+
- reason : `Integer`(Added in 0.9.0)
41+
The reason why the form is closed.
42+
0 = UserClosed, 1 = UserBusy
43+
The reason may be `null`.
4344

4445
### Send a Normal Form to the Player
4546

@@ -51,7 +52,6 @@ section to better accomplish this task.
5152
`pl.sendSimpleForm(title,content,buttons,images,callback)`
5253

5354
- Parameters:
54-
5555
- title : `String`
5656
Form title.
5757
- content : `String`
@@ -67,15 +67,16 @@ section to better accomplish this task.
6767
- If the return value is `Null`, it means the sending failed.
6868

6969
Parameter `callback` The callback function prototype: `function(player,id,reason)`
70+
7071
- player : `Player`
71-
The player object that interacts with the form.
72+
The player object that interacts with the form.
7273
- id : `Integer`
73-
The serial number of the form button that the player clicked, starting from 0.
74-
If the id is `Null`, the player cancels the form.
75-
- reason : `Integer`
76-
The reason why the form is closed.
77-
0 = UserClosed, 1 = UserBusy
78-
The reason may be `null`.
74+
The serial number of the form button that the player clicked, starting from 0.
75+
If the id is `Null`, the player cancels the form.
76+
- reason : `Integer`(Added in 0.9.0)
77+
The reason why the form is closed.
78+
0 = UserClosed, 1 = UserBusy
79+
The reason may be `null`.
7980

8081
Use the texture pack path or URL `images` to identify the icon corresponding to the button.
8182
For each button on the form, set the corresponding icon as follows:
@@ -102,15 +103,16 @@ next section to better accomplish this task.
102103
- If the return value is Null, it means the sending failed.
103104

104105
Parameter `callback` The callback function prototype: `function(player,data)`
106+
105107
- player : `Player`
106-
The player object that interacts with the form.
108+
The player object that interacts with the form.
107109
- data : `Array<...>`
108-
The returned form content array.
109-
In the array, the first item must be `Null`, starting from the second item, the content of each control is stored
110-
in
111-
the order of the controls on the form.
112-
If data is only `Null`, the player cancels the form.
113-
- reason : `Integer`
114-
The reason why the form is closed.
115-
0 = UserClosed, 1 = UserBusy
116-
The reason may be `null`.
110+
The returned form content array.
111+
In the array, the first item must be `Null`, starting from the second item, the content of each control is stored
112+
in
113+
the order of the controls on the form.
114+
If data is only `Null`, the player cancels the form.
115+
- reason : `Integer`(Added in 0.9.0)
116+
The reason why the form is closed.
117+
0 = UserClosed, 1 = UserBusy
118+
The reason may be `null`.

docs/apis/GuiAPI/Form.zh.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@
3030
- 如果返回值为`Null`,则代表发送失败
3131

3232
参数`callback`的回调函数原型:`function(player,result,reason)`
33+
3334
- player : `Player`
34-
与表单互动的玩家对象
35+
与表单互动的玩家对象
3536
- result : `Boolean`
36-
玩家点击**确定**按钮为`true`**取消**按钮为`false`
37-
如果id为`Null`,则代表玩家取消了表单
38-
- reason : `Integer`
39-
表单被取消的原因
40-
0 = UserClosed, 1 = UserBusy
41-
reason可能会是`null`.
37+
玩家点击**确定**按钮为`true`**取消**按钮为`false`
38+
如果id为`Null`,则代表玩家取消了表单
39+
- reason : `Integer`(在0.9.0中加入)
40+
表单被取消的原因
41+
0 = UserClosed, 1 = UserBusy
42+
reason可能会是`null`.
4243

4344
### 向玩家发送普通表单
4445

@@ -48,7 +49,6 @@ reason可能会是`null`.
4849
`pl.sendSimpleForm(title,content,buttons,images,callback)`
4950

5051
- 参数:
51-
5252
- title : `String`
5353
表单标题
5454
- content : `String`
@@ -64,15 +64,16 @@ reason可能会是`null`.
6464
- 如果返回值为`Null`,则代表发送失败
6565

6666
参数`callback`的回调函数原型:`function(player,id,reason)`
67+
6768
- player : `Player`
68-
与表单互动的玩家对象
69+
与表单互动的玩家对象
6970
- id : `Integer`
70-
玩家点击的表单按钮的序号,从0开始编号
71-
如果id为`Null`,则代表玩家取消了表单
72-
- reason : `Integer`
73-
表单被取消的原因
74-
0 = UserClosed, 1 = UserBusy
75-
reason可能会是`null`.
71+
玩家点击的表单按钮的序号,从0开始编号
72+
如果id为`Null`,则代表玩家取消了表单
73+
- reason : `Integer`(在0.9.0中加入)
74+
表单被取消的原因
75+
0 = UserClosed, 1 = UserBusy
76+
reason可能会是`null`.
7677

7778
图片路径参数 `images` 使用材质包路径或者URL来标识按钮对应的图标。
7879
对于表单上的每个按钮,如下设置对应的图标
@@ -105,7 +106,7 @@ reason可能会是`null`.
105106
返回的表单内容数组
106107
数组中,第一项一定为`Null`,从第二项开始,按表单上的控件顺序储存了每一个控件的内容
107108
如果data只为`Null`,则代表玩家取消了表单
108-
- reason : `Integer`
109+
- reason : `Integer`(在0.9.0中加入)
109110
表单被取消的原因
110111
0 = UserClosed, 1 = UserBusy
111112
reason可能会是`null`.

0 commit comments

Comments
 (0)