add gui.confirm(...)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user