mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
add gui.confirm(...)
This commit is contained in:
parent
e2f6c263e7
commit
7fce735ca1
6 changed files with 76 additions and 5 deletions
|
|
@ -61,3 +61,21 @@ gui.escape_markup(
|
|||
```
|
||||
|
||||
Escapes markup in text.
|
||||
|
||||
```lua
|
||||
gui.confirm(
|
||||
-- message (does not translate automatically, use gui.str(...))
|
||||
message: str,
|
||||
-- function called upon confirmation
|
||||
on_confirm: function() -> nil,
|
||||
-- function called upon denial/cancellation
|
||||
[optional] on_deny: function() -> nil,
|
||||
-- text for the confirmation button (default: "Yes")
|
||||
-- use an empty string for the default value if you want to specify no_text.
|
||||
[optional] yes_text: str,
|
||||
-- text for the denial button (default: "No")
|
||||
[optional] no_text: str,
|
||||
)
|
||||
```
|
||||
|
||||
Requests confirmation from the user for an action. **Does not** stop code execution.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue