Make callback on cancel
This commit is contained in:
parent
852a34c011
commit
b2e2075872
7
API.md
7
API.md
@ -38,15 +38,16 @@ You can also choose one of the following pre-defined filter functions:
|
||||
|
||||
### `select_item.register_on_select_item(callback)`
|
||||
Register a call function `callback` to the `select_item` mod.
|
||||
Whenever a player selects an item, `callback` is called.
|
||||
Whenever a player selects an item or cancels the selection,
|
||||
`callback` is called.
|
||||
|
||||
#### `callback` function
|
||||
This has the function signature `callback(playername, itemstring)`.
|
||||
|
||||
* `playername` is the name of the player who selected the item,
|
||||
* `itemstring` is the itemstring of the chosen item.
|
||||
* `itemstring` is the itemstring of the chosen item or `nil` if aborted
|
||||
|
||||
Normally, if the player pushes a button, the formspec is closed.
|
||||
Normally, if the player pushes any button, the formspec is closed.
|
||||
But if you return `false` in this callback, the formspec is *not*
|
||||
Use this when you run into problems.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user